feat: browser UI – unlock, table view, create/edit/delete with client-side crypto

Vanilla HTML/CSS/JS frontend served by Flask:
- Unlock screen: passphrase -> Argon2id session key, held in memory
  only (never sent to the server); "Sperren" wipes key and DOM rows.
- Records table (Person A/B, start/end, action) rendered via
  textContent only (no HTML injection); undecryptable rows are flagged.
- Create/edit modal encrypts payloads with XChaCha20-Poly1305 before
  any network call; updates carry the server version (optimistic lock,
  conflict toast on 409); delete fetches current version first.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
2026-10-11 00:02:40 +02:00
parent 7cbc2eecd2
commit a963baa8de
3 changed files with 488 additions and 0 deletions
+129
View File
@@ -0,0 +1,129 @@
/* crushdb – simple, clean dark UI */
:root {
--bg: #101418;
--panel: #1a2028;
--panel-2: #202830;
--border: #2c3642;
--text: #e6edf3;
--muted: #8b98a5;
--accent: #4da3ff;
--danger: #ff5d5d;
--ok: #47d68a;
}
* { box-sizing: border-box; }
body {
margin: 0 auto;
max-width: 960px;
padding: 2rem 1rem;
font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
background: var(--bg);
color: var(--text);
line-height: 1.5;
}
h1 { margin: 0 0 0.25rem; font-size: 1.6rem; }
.tagline { margin: 0 0 1.5rem; color: var(--muted); }
#flash {
min-height: 1.4rem;
margin-bottom: 1rem;
color: var(--ok);
}
#flash.error { color: var(--danger); }
#unlock {
max-width: 420px;
margin: 3rem auto;
background: var(--panel);
border: 1px solid var(--border);
border-radius: 10px;
padding: 1.5rem;
}
#unlock label { display: block; margin-bottom: 0.5rem; }
#unlock input {
width: 100%;
margin-bottom: 1rem;
}
.hint { color: var(--muted); font-size: 0.85rem; margin-top: 1rem; }
input, button {
font: inherit;
color: var(--text);
}
input {
background: var(--panel-2);
border: 1px solid var(--border);
border-radius: 6px;
padding: 0.5rem 0.7rem;
}
input:focus { outline: 1px solid var(--accent); }
button {
background: var(--accent);
color: #0b1016;
border: none;
border-radius: 6px;
padding: 0.5rem 1rem;
cursor: pointer;
font-weight: 600;
}
button:hover { filter: brightness(1.1); }
#app .toolbar {
display: flex;
gap: 0.75rem;
margin-bottom: 1rem;
}
#lock-btn { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
table {
width: 100%;
border-collapse: collapse;
background: var(--panel);
border: 1px solid var(--border);
border-radius: 10px;
overflow: hidden;
}
th, td {
padding: 0.6rem 0.75rem;
text-align: left;
border-bottom: 1px solid var(--border);
}
thead th { background: var(--panel-2); color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--panel-2); }
.row-error td { color: var(--danger); font-size: 0.9rem; }
td:last-child, td button { white-space: nowrap; }
td button + button { margin-left: 0.4rem; }
/* modal */
#editor-backdrop {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.6);
display: flex;
align-items: center;
justify-content: center;
}
#editor {
background: var(--panel);
border: 1px solid var(--border);
border-radius: 10px;
padding: 1.5rem;
width: min(440px, 92vw);
}
#editor h2 { margin-top: 0; font-size: 1.15rem; }
#editor label { display: block; margin-bottom: 0.75rem; color: var(--muted); }
#editor input { width: 100%; margin-top: 0.25rem; }
#editor .actions { display: flex; gap: 0.75rem; margin-top: 1rem; }
#editor-cancel { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }