cipher/public/index.html
maverick 360bfeb5ab Cipher: E2E encrypted messenger scaffold (Signal Protocol + Cloudflare)
- Hono Worker: auth, key directory (X3DH prekey bundles), message relay, R2 media
- Mailbox Durable Object: WebSocket delivery + offline ciphertext queue
- PWA client: libsignal (vendored), IndexedDB key store, chat UI, media E2E
- Server only ever holds public keys + ciphertext; private keys stay on device

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 01:56:59 +10:00

98 lines
4.9 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
<meta name="theme-color" content="#0b141a" />
<title>Cipher — encrypted messaging</title>
<link rel="manifest" href="/manifest.webmanifest" />
<link rel="icon" href="/icons/icon.svg" type="image/svg+xml" />
<link rel="apple-touch-icon" href="/icons/icon.svg" />
<style>
:root {
--bg: #0b141a;
--panel: #111b21;
--panel-2: #202c33;
--accent: #00a884;
--accent-2: #005c4b;
--text: #e9edef;
--muted: #8696a0;
--bubble-in: #202c33;
--bubble-out: #005c4b;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
background: var(--bg); color: var(--text); height: 100dvh; overflow: hidden;
}
#app { height: 100dvh; }
/* ---- auth ---- */
.auth-card {
max-width: 360px; margin: 12vh auto 0; padding: 32px 24px;
background: var(--panel); border-radius: 16px; display: flex; flex-direction: column; gap: 12px;
box-shadow: 0 10px 40px rgba(0,0,0,.4);
}
.auth-card h1 { margin: 0; text-align: center; color: var(--accent); letter-spacing: .5px; }
.tagline { margin: 0 0 8px; text-align: center; color: var(--muted); font-size: 13px; }
.auth-card input {
padding: 12px 14px; border-radius: 10px; border: 1px solid var(--panel-2);
background: var(--panel-2); color: var(--text); font-size: 15px;
}
.auth-card input:focus { outline: 2px solid var(--accent); }
.auth-err { color: #f15c6d; font-size: 13px; min-height: 16px; text-align: center; }
button { cursor: pointer; font-size: 15px; padding: 12px 14px; border-radius: 10px; border: none; }
button.primary { background: var(--accent); color: #04140f; font-weight: 600; }
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button:disabled { opacity: .6; cursor: default; }
/* ---- shell ---- */
.shell { display: grid; grid-template-columns: 340px 1fr; height: 100dvh; }
.sidebar { background: var(--panel); border-right: 1px solid #0a0f13; display: flex; flex-direction: column; min-height: 0; }
.side-header { padding: 16px; border-bottom: 1px solid #0a0f13; }
.me { font-weight: 600; }
.handle { color: var(--muted); font-size: 13px; }
.new-chat { margin: 12px; background: var(--panel-2); color: var(--text); text-align: left; }
.chat-list { overflow-y: auto; flex: 1; }
.chat-item { display: flex; gap: 12px; padding: 12px 16px; cursor: pointer; align-items: center; }
.chat-item:hover { background: var(--panel-2); }
.avatar {
width: 42px; height: 42px; border-radius: 50%; background: var(--accent-2);
display: grid; place-items: center; font-weight: 700; color: var(--text); flex: none;
}
.chat-name { font-weight: 500; }
.chat-sub { color: var(--muted); font-size: 13px; }
/* ---- main ---- */
.main { display: flex; flex-direction: column; min-height: 0; background:
linear-gradient(rgba(11,20,26,.95), rgba(11,20,26,.95)); }
.empty { margin: auto; color: var(--muted); }
.chat-head { display: flex; gap: 12px; align-items: center; padding: 12px 16px; background: var(--panel); border-bottom: 1px solid #0a0f13; }
.thread { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 65%; padding: 8px 10px 6px; border-radius: 10px; font-size: 14.5px; line-height: 1.35; position: relative; word-wrap: break-word; }
.bubble.in { background: var(--bubble-in); align-self: flex-start; border-top-left-radius: 2px; }
.bubble.out { background: var(--bubble-out); align-self: flex-end; border-top-right-radius: 2px; }
.bubble .time { font-size: 10.5px; color: var(--muted); text-align: right; margin-top: 2px; }
.media-img { max-width: 260px; border-radius: 8px; display: block; }
.media-file { color: var(--text); text-decoration: none; }
.composer { display: flex; gap: 10px; padding: 12px 16px; background: var(--panel); align-items: center; }
.composer input[type=text], .composer input:not([type]) {
flex: 1; padding: 11px 14px; border-radius: 20px; border: none; background: var(--panel-2); color: var(--text); font-size: 15px;
}
.composer input:focus { outline: none; }
.attach { cursor: pointer; font-size: 20px; user-select: none; }
.send { background: var(--accent); color: #04140f; font-weight: 600; border-radius: 20px; }
@media (max-width: 720px) {
.shell { grid-template-columns: 1fr; }
.sidebar { display: none; }
.shell.chat-open .sidebar { display: none; }
}
</style>
</head>
<body>
<div id="app"></div>
<script type="module" src="/js/app.js"></script>
</body>
</html>