feat: restyle the ui in gmail's design language
This commit is contained in:
parent
a6b972fec9
commit
9842302c50
3 changed files with 288 additions and 132 deletions
|
|
@ -7,14 +7,15 @@
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header class="topbar">
|
||||||
<h1>smol mail</h1>
|
<div class="brand">smol mail</div>
|
||||||
<div id="account" class="account"></div>
|
<input id="search" class="search" placeholder="search mail" spellcheck="false">
|
||||||
<nav class="actions">
|
<div class="top-actions">
|
||||||
<button id="fetch">fetch</button>
|
<button id="fetch">fetch</button>
|
||||||
<button id="write">write</button>
|
|
||||||
<button id="settings-open">settings</button>
|
<button id="settings-open">settings</button>
|
||||||
</nav>
|
<div id="account" class="account"></div>
|
||||||
|
<div id="avatar" class="avatar"></div>
|
||||||
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main id="setup" class="setup" hidden>
|
<main id="setup" class="setup" hidden>
|
||||||
|
|
@ -29,10 +30,13 @@
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<main id="app" hidden>
|
<main id="app" hidden>
|
||||||
<nav id="folders" class="folders">
|
<nav class="rail">
|
||||||
<button data-folder="inbox" class="active">inbox</button>
|
<button id="write" class="compose">compose</button>
|
||||||
<button data-folder="sent">sent</button>
|
<div id="folders">
|
||||||
<button data-folder="contacts">contacts</button>
|
<button data-folder="inbox" class="active">inbox <span id="count-inbox" class="count"></span></button>
|
||||||
|
<button data-folder="sent">sent</button>
|
||||||
|
<button data-folder="contacts">contacts</button>
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<section id="list" class="list"></section>
|
<section id="list" class="list"></section>
|
||||||
<article id="view" class="view"><p class="placeholder">select a message</p></article>
|
<article id="view" class="view"><p class="placeholder">select a message</p></article>
|
||||||
|
|
@ -40,9 +44,9 @@
|
||||||
|
|
||||||
<dialog id="compose">
|
<dialog id="compose">
|
||||||
<form id="compose-form" method="dialog">
|
<form id="compose-form" method="dialog">
|
||||||
<label>to <input name="to" required spellcheck="false" placeholder="alice@example.org or smol://…"></label>
|
<input name="to" required spellcheck="false" placeholder="to: alice@example.org or smol://…">
|
||||||
<label>subject <input name="subject" spellcheck="false"></label>
|
<input name="subject" spellcheck="false" placeholder="subject">
|
||||||
<textarea name="body" rows="12"></textarea>
|
<textarea name="body" rows="12" placeholder="message"></textarea>
|
||||||
<footer>
|
<footer>
|
||||||
<label class="anon"><input type="checkbox" name="anonymous"> anonymous — omit my address</label>
|
<label class="anon"><input type="checkbox" name="anonymous"> anonymous — omit my address</label>
|
||||||
<span id="compose-error" class="error"></span>
|
<span id="compose-error" class="error"></span>
|
||||||
|
|
@ -87,7 +91,7 @@
|
||||||
<footer><button id="settings-close">close</button></footer>
|
<footer><button id="settings-close">close</button></footer>
|
||||||
</dialog>
|
</dialog>
|
||||||
|
|
||||||
<div id="status" class="status"></div>
|
<div id="status" class="toast" hidden></div>
|
||||||
<script type="module" src="js/app.js"></script>
|
<script type="module" src="js/app.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
107
web/js/app.js
107
web/js/app.js
|
|
@ -12,14 +12,28 @@ import { connectStream } from "./transport.js";
|
||||||
|
|
||||||
const $ = (id) => document.getElementById(id);
|
const $ = (id) => document.getElementById(id);
|
||||||
|
|
||||||
|
// The status line is a toast: click to dismiss, empty means hidden.
|
||||||
function status(text, warn = false) {
|
function status(text, warn = false) {
|
||||||
$("status").textContent = text;
|
const toast = $("status");
|
||||||
$("status").className = warn ? "status warn" : "status";
|
toast.textContent = text;
|
||||||
|
toast.hidden = !text;
|
||||||
|
toast.className = "toast" + (warn ? " warn" : "");
|
||||||
}
|
}
|
||||||
|
$("status").onclick = () => status("");
|
||||||
|
|
||||||
const fmtTime = (seconds) =>
|
const fmtTime = (seconds) =>
|
||||||
new Date(seconds * 1000).toLocaleString(undefined, { dateStyle: "medium", timeStyle: "short" });
|
new Date(seconds * 1000).toLocaleString(undefined, { dateStyle: "medium", timeStyle: "short" });
|
||||||
|
|
||||||
|
// Gmail-style row stamp: time for today, date within this year, full date older.
|
||||||
|
const fmtRowTime = (seconds) => {
|
||||||
|
const date = new Date(seconds * 1000), today = new Date();
|
||||||
|
if (date.toDateString() === today.toDateString())
|
||||||
|
return date.toLocaleTimeString(undefined, { hour: "numeric", minute: "2-digit" });
|
||||||
|
if (date.getFullYear() === today.getFullYear())
|
||||||
|
return date.toLocaleDateString(undefined, { month: "short", day: "numeric" });
|
||||||
|
return date.toLocaleDateString(undefined, { year: "numeric", month: "short", day: "numeric" });
|
||||||
|
};
|
||||||
|
|
||||||
// The stored account as an address object, default port included when custom.
|
// The stored account as an address object, default port included when custom.
|
||||||
function accountAddress() {
|
function accountAddress() {
|
||||||
const account = store.account();
|
const account = store.account();
|
||||||
|
|
@ -86,8 +100,9 @@ function renderAccount() {
|
||||||
const me = store.identity();
|
const me = store.identity();
|
||||||
const account = store.account();
|
const account = store.account();
|
||||||
$("account").textContent = me
|
$("account").textContent = me
|
||||||
? `${account ? account.user + "@" + account.host : "(not registered)"} · ${fingerprint(me.publicKey)}`
|
? (account ? `${account.user}@${account.host}` : "not registered")
|
||||||
: "";
|
: "";
|
||||||
|
$("avatar").textContent = account ? account.user[0].toUpperCase() : "·";
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- folders and list ---------------------------------------------------------
|
// --- folders and list ---------------------------------------------------------
|
||||||
|
|
@ -106,30 +121,47 @@ for (const button of $("folders").querySelectorAll("button"))
|
||||||
async function renderFolder() {
|
async function renderFolder() {
|
||||||
const list = $("list");
|
const list = $("list");
|
||||||
if (folder === "contacts") return renderContacts(list);
|
if (folder === "contacts") return renderContacts(list);
|
||||||
const rows = await store.listMessages(folder);
|
const rows = [...await store.listMessages(folder)].reverse(); // newest first
|
||||||
list.replaceChildren();
|
list.replaceChildren();
|
||||||
|
let unread = 0;
|
||||||
for (const row of rows) {
|
for (const row of rows) {
|
||||||
const opened = describe(row);
|
const opened = describe(row);
|
||||||
|
const isUnread = !store.isRead(row.id);
|
||||||
|
if (folder === "inbox" && isUnread) unread++;
|
||||||
const item = document.createElement("div");
|
const item = document.createElement("div");
|
||||||
item.className = "item" + (row.id === selectedId ? " selected" : "");
|
item.className = `item${row.id === selectedId ? " selected" : ""}${isUnread ? " unread" : ""}`;
|
||||||
const who = document.createElement("div");
|
const who = document.createElement("div");
|
||||||
who.className = "who" + (store.isRead(row.id) ? "" : " unread");
|
who.className = "who";
|
||||||
who.textContent = folder === "sent" ? row.recipient : (opened.from ?? "?");
|
who.textContent = folder === "sent" ? row.recipient : (opened.from ?? "?");
|
||||||
const subject = document.createElement("div");
|
const mid = document.createElement("div");
|
||||||
|
mid.className = "mid";
|
||||||
|
const subject = document.createElement("span");
|
||||||
subject.className = "subject";
|
subject.className = "subject";
|
||||||
subject.textContent = opened.error ? `<unreadable: ${opened.error}>`
|
subject.textContent = opened.error ? `<unreadable: ${opened.error}>`
|
||||||
: (opened.subject || "(no subject)");
|
: (opened.subject || "(no subject)");
|
||||||
const when = document.createElement("span");
|
const snippet = document.createElement("span");
|
||||||
|
snippet.className = "snippet";
|
||||||
|
snippet.textContent = opened.error ? "" : ` — ${opened.snippet}`;
|
||||||
|
mid.append(subject, snippet);
|
||||||
|
const when = document.createElement("div");
|
||||||
when.className = "when";
|
when.className = "when";
|
||||||
when.textContent = fmtTime(folder === "sent" ? row.sentAt : opened.time ?? row.receivedAt);
|
when.textContent = fmtRowTime(folder === "sent" ? row.sentAt : (opened.time ?? row.receivedAt));
|
||||||
item.append(who, subject, when);
|
item.append(who, mid, when);
|
||||||
item.onclick = () => openMessage(row.id);
|
item.onclick = () => openMessage(row.id);
|
||||||
list.append(item);
|
list.append(item);
|
||||||
}
|
}
|
||||||
|
$("count-inbox").textContent = folder === "inbox" && unread ? String(unread) : "";
|
||||||
if (!rows.length) list.append(Object.assign(document.createElement("p"),
|
if (!rows.length) list.append(Object.assign(document.createElement("p"),
|
||||||
{ className: "placeholder", textContent: folder === "inbox" ? "no mail — fetch" : "nothing sent" }));
|
{ className: "placeholder", textContent: folder === "inbox" ? "no mail — fetch" : "nothing sent" }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The header search filters the rendered list client-side; nothing leaves the page.
|
||||||
|
$("search").oninput = () => {
|
||||||
|
const query = $("search").value.trim().toLowerCase();
|
||||||
|
for (const item of $("list").querySelectorAll(".item"))
|
||||||
|
item.hidden = Boolean(query) && !item.textContent.toLowerCase().includes(query);
|
||||||
|
};
|
||||||
|
|
||||||
// Open an envelope and split its body; anything unreadable shows as such
|
// Open an envelope and split its body; anything unreadable shows as such
|
||||||
// rather than throwing, so one bad message cannot blank the list. The wire
|
// rather than throwing, so one bad message cannot blank the list. The wire
|
||||||
// carries no sender name, so an unknown key can only be shown as its
|
// carries no sender name, so an unknown key can only be shown as its
|
||||||
|
|
@ -154,6 +186,7 @@ function describe(row) {
|
||||||
...opened,
|
...opened,
|
||||||
fields, body,
|
fields, body,
|
||||||
subject: fields.Subject || "",
|
subject: fields.Subject || "",
|
||||||
|
snippet: body.replace(/\s+/g, " ").trim().slice(0, 140),
|
||||||
from: known ?? `unknown · ${fingerprint(opened.sender)}`,
|
from: known ?? `unknown · ${fingerprint(opened.sender)}`,
|
||||||
knownSender: Boolean(known),
|
knownSender: Boolean(known),
|
||||||
replyAddress,
|
replyAddress,
|
||||||
|
|
@ -174,21 +207,26 @@ async function openMessage(id) {
|
||||||
const opened = describe(row);
|
const opened = describe(row);
|
||||||
const view = $("view");
|
const view = $("view");
|
||||||
if (opened.error) {
|
if (opened.error) {
|
||||||
view.innerHTML = `<p class="placeholder warn">${opened.error}</p>`;
|
view.replaceChildren();
|
||||||
|
const note = document.createElement("p");
|
||||||
|
note.className = "placeholder warn";
|
||||||
|
note.textContent = opened.error;
|
||||||
|
view.append(note);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const fields = Object.entries(opened.fields).filter(([k]) => k !== "Subject");
|
const fields = Object.entries(opened.fields).filter(([k]) => k !== "Subject");
|
||||||
view.innerHTML = `<h2></h2><div class="meta"></div><div class="fields"></div>` +
|
view.innerHTML = `<h2></h2><div class="meta"></div><div class="fields"></div>` +
|
||||||
`<div class="verified">signature verified</div><pre></pre>`;
|
`<div class="verified">signature verified</div><pre></pre><div class="actions"></div>`;
|
||||||
view.querySelector("h2").textContent = opened.subject || "(no subject)";
|
view.querySelector("h2").textContent = opened.subject || "(no subject)";
|
||||||
view.querySelector(".meta").textContent = folder === "sent"
|
view.querySelector(".meta").textContent = folder === "sent"
|
||||||
? `to: ${row.recipient}\nid: ${row.id}\nsent: ${fmtTime(row.sentAt)}`
|
? `to: ${row.recipient}\nid: ${row.id}\nsent: ${fmtTime(row.sentAt)}`
|
||||||
: `from: ${opened.from}\nkey: ${b32encode(opened.sender)}\nid: ${row.id}\ndate: ${fmtTime(opened.time)}`;
|
: `from: ${opened.from}\nkey: ${b32encode(opened.sender)}\nid: ${row.id}\ndate: ${fmtTime(opened.time)}`;
|
||||||
view.querySelector(".fields").textContent = fields.map(([k, v]) => `${k}: ${v}`).join("\n");
|
view.querySelector(".fields").textContent = fields.map(([k, v]) => `${k}: ${v}`).join("\n");
|
||||||
view.querySelector("pre").textContent = opened.body;
|
view.querySelector("pre").textContent = opened.body;
|
||||||
|
const actions = view.querySelector(".actions");
|
||||||
if (folder === "inbox") {
|
if (folder === "inbox") {
|
||||||
if (opened.knownSender) {
|
if (opened.knownSender) {
|
||||||
view.append(replyButton(opened, row));
|
actions.append(replyButton(opened, row));
|
||||||
} else if (opened.replyAddress) {
|
} else if (opened.replyAddress) {
|
||||||
// The sender signed their own smol:// address into the payload, so
|
// The sender signed their own smol:// address into the payload, so
|
||||||
// binding it is one click. A pinned conflicting key is refused (§8).
|
// binding it is one click. A pinned conflicting key is refused (§8).
|
||||||
|
|
@ -196,6 +234,7 @@ async function openMessage(id) {
|
||||||
note.className = "placeholder";
|
note.className = "placeholder";
|
||||||
note.textContent =
|
note.textContent =
|
||||||
`this message carries the sender's signed address: ${opened.replyAddress.short}`;
|
`this message carries the sender's signed address: ${opened.replyAddress.short}`;
|
||||||
|
actions.before(note);
|
||||||
const save = document.createElement("button");
|
const save = document.createElement("button");
|
||||||
save.textContent = "save sender & reply";
|
save.textContent = "save sender & reply";
|
||||||
save.onclick = () => {
|
save.onclick = () => {
|
||||||
|
|
@ -211,7 +250,7 @@ async function openMessage(id) {
|
||||||
status(err.message, true);
|
status(err.message, true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
view.append(note, save);
|
actions.append(save);
|
||||||
} else {
|
} else {
|
||||||
// The wire gives only a signed key; a reply needs the sender's address,
|
// The wire gives only a signed key; a reply needs the sender's address,
|
||||||
// which the user supplies once and we bind to that exact key.
|
// which the user supplies once and we bind to that exact key.
|
||||||
|
|
@ -244,7 +283,7 @@ async function openMessage(id) {
|
||||||
name.disabled = false;
|
name.disabled = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
view.append(note, form);
|
actions.append(note, form);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -436,13 +475,13 @@ function renderContacts(list) {
|
||||||
const who = document.createElement("div");
|
const who = document.createElement("div");
|
||||||
who.className = "who";
|
who.className = "who";
|
||||||
who.textContent = address;
|
who.textContent = address;
|
||||||
const fp = document.createElement("div");
|
const mid = document.createElement("div");
|
||||||
fp.className = "subject";
|
mid.className = "mid";
|
||||||
fp.textContent = `${fingerprint(b32decode(key))} · ${verified ? "verified key" : "tofu"}`;
|
mid.textContent = `${fingerprint(b32decode(key))} · ${verified ? "verified key" : "tofu"}`;
|
||||||
const refresh = document.createElement("button");
|
const refresh = document.createElement("button");
|
||||||
refresh.textContent = "refresh";
|
refresh.textContent = "refresh";
|
||||||
refresh.onclick = () => refreshContact(address);
|
refresh.onclick = () => refreshContact(address);
|
||||||
item.append(who, fp, refresh);
|
item.append(who, mid, refresh);
|
||||||
list.append(item);
|
list.append(item);
|
||||||
}
|
}
|
||||||
if (!contacts.length) list.append(Object.assign(document.createElement("p"),
|
if (!contacts.length) list.append(Object.assign(document.createElement("p"),
|
||||||
|
|
@ -497,14 +536,28 @@ function renderSettings() {
|
||||||
const me = store.identity();
|
const me = store.identity();
|
||||||
const account = store.account();
|
const account = store.account();
|
||||||
const card = $("identity-card");
|
const card = $("identity-card");
|
||||||
if (!me) { card.textContent = ""; return; }
|
card.replaceChildren();
|
||||||
const share = account ? accountAddress().uri(me.publicKey) : "(register to get a shareable address)";
|
if (!me) return;
|
||||||
card.innerHTML = `<div>fingerprint: ${fingerprint(me.publicKey)}</div>` +
|
const lines = [
|
||||||
`<div>address: ${account ? account.user + "@" + account.host : "(not registered)"}</div>` +
|
`fingerprint: ${fingerprint(me.publicKey)}`,
|
||||||
`<div>share: ${share}</div>` +
|
`address: ${account ? account.user + "@" + account.host : "(not registered)"}`,
|
||||||
`<div class="seed">${hex(me.seed)}</div>` +
|
`share: ${account ? accountAddress().uri(me.publicKey) : "(register to get a shareable address)"}`,
|
||||||
`<div class="warn">back this seed up; it is the only secret</div>` +
|
"",
|
||||||
`<div>retired keys: ${store.identities().length - 1} (kept to read old mail)</div>`;
|
];
|
||||||
|
for (const text of lines) {
|
||||||
|
const div = document.createElement("div");
|
||||||
|
div.textContent = text;
|
||||||
|
card.append(div);
|
||||||
|
}
|
||||||
|
const seed = document.createElement("div");
|
||||||
|
seed.className = "seed";
|
||||||
|
seed.textContent = hex(me.seed);
|
||||||
|
const warning = document.createElement("div");
|
||||||
|
warning.className = "warn";
|
||||||
|
warning.textContent = "back this seed up; it is the only secret";
|
||||||
|
const retired = document.createElement("div");
|
||||||
|
retired.textContent = `retired keys: ${store.identities().length - 1} (kept to read old mail)`;
|
||||||
|
card.append(seed, warning, retired);
|
||||||
|
|
||||||
const pins = $("pins");
|
const pins = $("pins");
|
||||||
pins.replaceChildren();
|
pins.replaceChildren();
|
||||||
|
|
|
||||||
281
web/style.css
281
web/style.css
|
|
@ -1,151 +1,250 @@
|
||||||
:root {
|
:root {
|
||||||
--bg: #fafaf7;
|
--bg: #f6f8fc;
|
||||||
--fg: #26251f;
|
--surface: #ffffff;
|
||||||
--muted: #7a766b;
|
--fg: #202124;
|
||||||
--line: #dcd8cc;
|
--muted: #5f6368;
|
||||||
--accent: #3a5a40;
|
--border: #dadce0;
|
||||||
--warn: #9c3f2c;
|
--accent: #1a73e8;
|
||||||
|
--accent-soft: #e8f0fe;
|
||||||
|
--hover: #f1f3f4;
|
||||||
|
--warn: #d93025;
|
||||||
--mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
|
--mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
|
||||||
|
--radius: 8px;
|
||||||
|
--shadow: 0 1px 3px rgba(60, 64, 67, 0.2), 0 4px 8px 3px rgba(60, 64, 67, 0.08);
|
||||||
}
|
}
|
||||||
|
|
||||||
* { box-sizing: border-box; }
|
* { box-sizing: border-box; }
|
||||||
|
[hidden] { display: none !important; }
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
font: 15px/1.5 system-ui, sans-serif;
|
font: 14px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||||
color: var(--fg);
|
color: var(--fg);
|
||||||
background: var(--bg);
|
background: var(--surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
font: inherit;
|
font: inherit;
|
||||||
padding: 4px 14px;
|
border: 0;
|
||||||
border: 1px solid var(--line);
|
border-radius: var(--radius);
|
||||||
border-radius: 4px;
|
background: none;
|
||||||
background: #fff;
|
color: var(--accent);
|
||||||
|
padding: 6px 14px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
button:hover { border-color: var(--accent); color: var(--accent); }
|
button:hover { background: var(--hover); }
|
||||||
button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
|
button:disabled { color: var(--muted); cursor: default; }
|
||||||
|
|
||||||
header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 16px;
|
|
||||||
padding: 8px 16px;
|
|
||||||
border-bottom: 1px solid var(--line);
|
|
||||||
}
|
|
||||||
header h1 { font-size: 16px; margin: 0; font-weight: 600; }
|
|
||||||
.actions { margin-left: auto; display: flex; gap: 8px; }
|
|
||||||
.account { font-family: var(--mono); font-size: 13px; color: var(--muted); }
|
|
||||||
|
|
||||||
main { flex: 1; min-height: 0; display: flex; }
|
|
||||||
|
|
||||||
.setup { flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
|
|
||||||
.setup h2 { margin: 0; }
|
|
||||||
.setup .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
|
|
||||||
|
|
||||||
input, textarea {
|
input, textarea {
|
||||||
font: inherit;
|
font: inherit;
|
||||||
font-family: var(--mono);
|
padding: 6px 10px;
|
||||||
font-size: 13px;
|
border: 1px solid var(--border);
|
||||||
padding: 4px 8px;
|
border-radius: var(--radius);
|
||||||
border: 1px solid var(--line);
|
background: var(--surface);
|
||||||
border-radius: 4px;
|
color: var(--fg);
|
||||||
background: #fff;
|
}
|
||||||
|
input:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
|
||||||
|
|
||||||
|
/* --- top bar --------------------------------------------------------------- */
|
||||||
|
|
||||||
|
.topbar {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 16px;
|
||||||
|
padding: 10px 16px;
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
.brand { font-size: 18px; font-weight: 500; letter-spacing: -0.02em; }
|
||||||
|
.search {
|
||||||
|
flex: 1;
|
||||||
|
max-width: 640px;
|
||||||
|
margin: 0 auto;
|
||||||
|
background: var(--hover);
|
||||||
|
border: 0;
|
||||||
|
border-radius: var(--radius);
|
||||||
|
padding: 8px 16px;
|
||||||
|
}
|
||||||
|
.search:focus { background: var(--surface); outline: 1px solid var(--border); }
|
||||||
|
.top-actions { display: flex; align-items: center; gap: 4px; }
|
||||||
|
.account { font-size: 13px; color: var(--muted); margin-right: 4px; }
|
||||||
|
.avatar {
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: var(--accent);
|
||||||
|
color: #fff;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 500;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.folders {
|
/* --- layout ------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
main { flex: 1; min-height: 0; display: flex; background: var(--bg); }
|
||||||
|
|
||||||
|
.rail {
|
||||||
|
width: 200px;
|
||||||
|
padding: 12px 8px;
|
||||||
|
background: var(--surface);
|
||||||
|
border-right: 1px solid var(--border);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
border-right: 1px solid var(--line);
|
gap: 4px;
|
||||||
min-width: 110px;
|
|
||||||
}
|
}
|
||||||
.folders button {
|
.compose {
|
||||||
border: 0;
|
align-self: flex-start;
|
||||||
border-bottom: 1px solid var(--line);
|
margin: 0 8px 16px;
|
||||||
border-radius: 0;
|
padding: 12px 26px;
|
||||||
|
border-radius: 20px;
|
||||||
|
background: var(--accent-soft);
|
||||||
|
color: var(--accent);
|
||||||
|
font-weight: 500;
|
||||||
|
box-shadow: var(--shadow);
|
||||||
|
}
|
||||||
|
.compose:hover { background: var(--accent); color: #fff; }
|
||||||
|
|
||||||
|
#folders button {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding: 10px 14px;
|
padding: 8px 16px;
|
||||||
background: none;
|
color: var(--fg);
|
||||||
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
#folders button:hover { background: var(--hover); }
|
||||||
|
#folders button.active { background: var(--accent-soft); color: var(--accent); }
|
||||||
|
#folders .count { color: var(--accent); font-weight: 500; margin-left: 8px; }
|
||||||
|
|
||||||
.list {
|
.list {
|
||||||
min-width: 280px;
|
min-width: 360px;
|
||||||
max-width: 380px;
|
max-width: 460px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
border-right: 1px solid var(--line);
|
background: var(--surface);
|
||||||
|
border-right: 1px solid var(--border);
|
||||||
}
|
}
|
||||||
.item { padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
|
|
||||||
.item:hover { background: #f1efe6; }
|
|
||||||
.item.selected { background: #ece9dd; }
|
|
||||||
.item .who { font-weight: 600; }
|
|
||||||
.item .who.unread::before { content: "● "; color: var(--accent); }
|
|
||||||
.item .subject { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
||||||
.item .when { float: right; font-size: 12px; color: var(--muted); }
|
|
||||||
|
|
||||||
.view { flex: 1; overflow-y: auto; padding: 20px 24px; }
|
.item {
|
||||||
.placeholder { color: var(--muted); font-style: italic; }
|
display: flex;
|
||||||
.view h2 { margin: 0 0 2px; font-size: 17px; }
|
gap: 12px;
|
||||||
.view .meta { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 16px; }
|
align-items: baseline;
|
||||||
.view .fields { font-family: var(--mono); font-size: 12px; color: var(--muted); }
|
padding: 9px 16px;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
cursor: pointer;
|
||||||
|
color: var(--muted);
|
||||||
|
}
|
||||||
|
.item:hover { background: var(--hover); }
|
||||||
|
.item.selected { background: var(--accent-soft); }
|
||||||
|
.item.unread { color: var(--fg); }
|
||||||
|
.item .who { width: 150px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||||
|
.item .mid { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||||
|
.item .subject { font-weight: 400; }
|
||||||
|
.item.unread .who { font-weight: 700; }
|
||||||
|
.item.unread .subject { font-weight: 700; }
|
||||||
|
.item .snippet { color: var(--muted); }
|
||||||
|
.item.unread .snippet { color: var(--fg); }
|
||||||
|
.item .when { flex: none; font-size: 12px; color: var(--muted); }
|
||||||
|
.item button { padding: 2px 12px; font-size: 12px; }
|
||||||
|
|
||||||
|
.view { flex: 1; min-width: 0; overflow-y: auto; padding: 24px 28px; }
|
||||||
|
.view h2 { margin: 0 0 10px; font-size: 20px; font-weight: 400; }
|
||||||
|
.view .meta { font-size: 13px; color: var(--muted); margin-bottom: 14px; white-space: pre-line; }
|
||||||
|
.view .fields { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 10px; white-space: pre-line; }
|
||||||
.view pre {
|
.view pre {
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
margin: 12px 0 0;
|
margin: 14px 0 0;
|
||||||
border-top: 1px solid var(--line);
|
padding: 14px 0 0;
|
||||||
padding-top: 12px;
|
border-top: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
.view .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
|
||||||
|
.view .actions button { border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--fg); }
|
||||||
|
.view .actions button:hover { background: var(--hover); color: var(--fg); }
|
||||||
|
|
||||||
|
.verified {
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 12px;
|
||||||
|
padding: 2px 10px;
|
||||||
|
border-radius: 12px;
|
||||||
|
background: #e6f4ea;
|
||||||
|
color: #137333;
|
||||||
}
|
}
|
||||||
.verified { color: var(--accent); font-size: 12px; }
|
|
||||||
.warn { color: var(--warn); }
|
.warn { color: var(--warn); }
|
||||||
|
.placeholder { color: var(--muted); font-style: italic; padding: 12px 16px; }
|
||||||
|
|
||||||
.name-sender { display: flex; gap: 8px; margin: 12px 0 0; }
|
.name-sender { display: flex; gap: 8px; margin: 12px 0 0; }
|
||||||
.name-sender input { flex: 1; }
|
.name-sender input { flex: 1; }
|
||||||
|
|
||||||
|
/* --- setup -------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
.setup {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 12px;
|
||||||
|
text-align: center;
|
||||||
|
background: var(--bg);
|
||||||
|
}
|
||||||
|
.setup h2 { margin: 0; font-weight: 400; }
|
||||||
|
.setup p { color: var(--muted); max-width: 480px; }
|
||||||
|
.setup .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
|
||||||
|
|
||||||
|
/* --- dialogs --------------------------------------------------------------------- */
|
||||||
|
|
||||||
dialog {
|
dialog {
|
||||||
border: 1px solid var(--line);
|
border: 0;
|
||||||
border-radius: 8px;
|
border-radius: var(--radius);
|
||||||
padding: 20px;
|
box-shadow: var(--shadow);
|
||||||
|
padding: 20px 24px;
|
||||||
min-width: 460px;
|
min-width: 460px;
|
||||||
max-width: 640px;
|
max-width: 640px;
|
||||||
}
|
}
|
||||||
dialog::backdrop { background: rgba(0, 0, 0, 0.25); }
|
dialog::backdrop { background: rgba(32, 33, 36, 0.3); }
|
||||||
#compose form { display: flex; flex-direction: column; gap: 8px; }
|
#compose form { display: flex; flex-direction: column; gap: 10px; }
|
||||||
#compose label { display: flex; gap: 8px; align-items: center; }
|
#compose input, #compose textarea { width: 100%; }
|
||||||
#compose input { flex: 1; }
|
#compose textarea { font-family: inherit; resize: vertical; }
|
||||||
#compose textarea { font-family: inherit; }
|
#compose footer { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding-top: 4px; }
|
||||||
#compose footer { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
|
#compose .anon { font-size: 13px; color: var(--muted); margin-right: auto; display: flex; align-items: center; gap: 6px; }
|
||||||
#compose .anon { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
|
.error { color: var(--warn); font-size: 13px; }
|
||||||
.error { color: var(--warn); font-size: 13px; margin-right: auto; }
|
|
||||||
|
|
||||||
#settings section { margin-bottom: 20px; }
|
#settings section { margin-bottom: 22px; }
|
||||||
#settings form { display: flex; gap: 8px; margin: 8px 0; }
|
#settings h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
|
||||||
#settings form input { flex: 1; }
|
#settings form { display: flex; gap: 8px; margin: 6px 0; }
|
||||||
#settings h3 { margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
|
#settings form input { flex: 1; font-family: var(--mono); font-size: 13px; }
|
||||||
#settings footer { display: flex; justify-content: flex-end; }
|
#settings footer { display: flex; justify-content: flex-end; }
|
||||||
.hint { font-size: 12px; color: var(--muted); margin: 4px 0; }
|
.hint { font-size: 12px; color: var(--muted); margin: 4px 0; }
|
||||||
|
|
||||||
.kv { list-style: none; padding: 0; margin: 4px 0; font-family: var(--mono); font-size: 12px; }
|
.kv { list-style: none; padding: 0; margin: 6px 0; font-size: 13px; }
|
||||||
.kv li { display: flex; gap: 10px; padding: 3px 0; align-items: baseline; }
|
.kv li { display: flex; gap: 10px; padding: 3px 0; align-items: baseline; }
|
||||||
.kv li button { padding: 0 8px; font-size: 11px; }
|
.kv .key { font-family: var(--mono); word-break: break-all; color: var(--muted); flex: 1; }
|
||||||
.kv .key { word-break: break-all; color: var(--muted); flex: 1; }
|
|
||||||
|
|
||||||
#identity-card { font-family: var(--mono); font-size: 12px; }
|
#identity-card { font-family: var(--mono); font-size: 12px; }
|
||||||
#identity-card div { margin: 4px 0; word-break: break-all; }
|
#identity-card div { margin: 4px 0; word-break: break-all; }
|
||||||
#identity-card .seed { border: 1px dashed var(--warn); padding: 6px; }
|
#identity-card .seed { border: 1px dashed var(--warn); padding: 6px; }
|
||||||
|
|
||||||
.status {
|
/* --- toast ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
.toast {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
left: 24px;
|
||||||
left: 0;
|
bottom: 24px;
|
||||||
right: 0;
|
max-width: 520px;
|
||||||
padding: 6px 16px;
|
margin: 0;
|
||||||
|
padding: 12px 18px;
|
||||||
|
border-radius: var(--radius);
|
||||||
|
background: #202124;
|
||||||
|
color: #e8eaed;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
border-top: 1px solid var(--line);
|
|
||||||
background: #fff;
|
|
||||||
min-height: 30px;
|
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
|
box-shadow: var(--shadow);
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
.toast.warn { background: var(--warn); color: #fff; }
|
||||||
|
.toast[hidden] { display: none; }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue