Files
ink-note-app/electron/capture.html
T
Your NameandClaude Sonnet 5.5 313c41f867 feat(electron): main process, vault, search index, links, import, capture
Vault on plain .md files with FTS5 index, link rewriting, canvas files,
history/trash/backup, link previews, image fetch, tasks and unlinked
mentions, Notion/Obsidian importer, quick-capture window and shortcut.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 11:57:09 +02:00

53 lines
3.2 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; script-src 'unsafe-inline'" />
<title>Quick capture</title>
<style>
:root { --bg:#161617; --raise:#222224; --line:rgba(255,255,255,.13); --ink:#ececed; --ink-2:#a1a1a6; --ink-3:#6c6c71; --blush:#e4ada5; --blush-ink:#2a1714; color-scheme:dark; }
:root[data-theme="light"] { --bg:#fbfbfb; --raise:#f3f3f4; --line:rgba(0,0,0,.14); --ink:#1c1c1e; --ink-2:#5c5c61; --ink-3:#9a9a9f; --blush:#b8695f; --blush-ink:#fff8f5; color-scheme:light; }
* { box-sizing:border-box; }
html, body { height:100%; margin:0; }
body { background:var(--bg); color:var(--ink); font:14px/1.5 'Inter Variable', Inter, ui-sans-serif, system-ui, sans-serif; -webkit-font-smoothing:antialiased; display:flex; flex-direction:column; padding:14px; gap:10px; border:1px solid var(--line); border-radius:10px; }
textarea { flex:1; resize:none; border:0; outline:0; background:transparent; color:inherit; font:inherit; font-size:15px; }
textarea::placeholder { color:var(--ink-3); }
.bar { display:flex; align-items:center; gap:8px; color:var(--ink-3); font-size:12px; }
.bar span { flex:1; }
.seg { display:flex; background:var(--raise); border-radius:7px; padding:2px; }
.seg button { border:0; background:none; color:var(--ink-2); font:inherit; font-size:12px; padding:3px 10px; border-radius:5px; cursor:pointer; }
.seg button.on { background:var(--bg); color:var(--ink); box-shadow:0 0 0 1px var(--line); }
.go { border:0; background:var(--blush); color:var(--blush-ink); font:inherit; font-size:12.5px; font-weight:600; padding:5px 12px; border-radius:7px; cursor:pointer; }
kbd { font:inherit; color:var(--ink-2); }
</style>
</head>
<body>
<textarea id="t" placeholder="Capture a thought…" spellcheck="true" autofocus></textarea>
<div class="bar">
<div class="seg" role="radiogroup" aria-label="Where it goes">
<button data-to="daily" role="radio">Today's note</button>
<button data-to="inbox" role="radio">Inbox</button>
</div>
<span><kbd>Enter</kbd> save · <kbd>Shift</kbd>+<kbd>Enter</kbd> new line · <kbd>Esc</kbd> close</span>
<button class="go" id="go">Save</button>
</div>
<script>
let to = 'daily';
const t = document.getElementById('t');
const mark = () => document.querySelectorAll('.seg button').forEach((b) => { b.classList.toggle('on', b.dataset.to === to); b.setAttribute('aria-checked', String(b.dataset.to === to)); });
document.querySelectorAll('.seg button').forEach((b) => b.addEventListener('click', () => { to = b.dataset.to; mark(); t.focus(); }));
async function save() {
if (!t.value.trim()) return window.capture.close();
await window.capture.save(t.value, to);
}
document.getElementById('go').addEventListener('click', save);
t.addEventListener('keydown', (e) => {
if (e.key === 'Enter' && !e.shiftKey && !e.isComposing) { e.preventDefault(); save(); }
if (e.key === 'Escape') { e.preventDefault(); window.capture.close(); }
});
window.capture.info().then((i) => { document.documentElement.dataset.theme = i.theme; to = i.to; mark(); t.focus(); });
mark();
</script>
</body>
</html>