feat(webui): refine day-night themes and interaction continuity
This commit is contained in:
1 parent
12c7d116a0
commit
e8544a79a6
32 files changed
+613
-29
No files matched your search
@@ -10,7 +10,7 @@ export function AboutSettingsLayout({ versionCheck, links, starLink }: {
|
||||
starLink: ReactNode;
|
||||
}) {
|
||||
return <div className="flex flex-1 flex-col gap-5">
|
||||
<div className="flex flex-col items-center gap-3 py-6 text-center">
|
||||
<div className="brand-atmosphere flex flex-col items-center gap-3 py-6 text-center">
|
||||
<img src="/brand/nanobot_mark.svg" alt="" className="h-16 w-16 select-none" draggable={false} />
|
||||
<h1><img src="/brand/nanobot_wordmark.svg" alt="nanobot" width={800} height={164} className="h-auto w-40 select-none dark:brightness-150" draggable={false} /></h1>
|
||||
</div>
|
||||
|
||||
@@ -40,6 +40,7 @@ export function AppearanceSettingsView({ themePreference, onChangeTheme, localPr
|
||||
<span className="appearance-theme-miniature" data-mode={value} aria-hidden>
|
||||
<span className="appearance-mini-sidebar"><span /><span /><span /></span>
|
||||
<span className="appearance-mini-main"><span /><span /><span /><span /></span>
|
||||
<span className="appearance-mini-sky"><Sun /><Moon /></span>
|
||||
</span>
|
||||
<span className="appearance-theme-label text-ui-label">
|
||||
<span className="flex min-w-0 items-center gap-1.5"><Icon className="h-3.5 w-3.5 shrink-0" aria-hidden /><span>{label}</span></span>
|
||||
|
||||
@@ -104,7 +104,11 @@ export function ReadingSettings({ preferences, onChange }: {
|
||||
if (!commitDraft()) event.preventDefault();
|
||||
}}
|
||||
onKeyDown={(event) => {
|
||||
if (event.key === "Enter") event.currentTarget.blur();
|
||||
if (event.key === "Enter") {
|
||||
event.preventDefault();
|
||||
// Keep an invalid edit focused so hover/blur dismissal cannot hide its feedback.
|
||||
if (commitDraft()) event.currentTarget.blur();
|
||||
}
|
||||
if (event.key === "Escape") {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
@@ -7,17 +7,27 @@
|
||||
.appearance-theme-option input:focus-visible + .appearance-theme-card { outline: 2px solid hsl(var(--ring) / 0.65); outline-offset: 3px; }
|
||||
.appearance-theme-check { opacity: 0; }
|
||||
.appearance-theme-option input:checked + .appearance-theme-card .appearance-theme-check { opacity: 1; }
|
||||
.appearance-theme-option input:checked + .appearance-theme-card { border-color: hsl(var(--foreground) / 0.5); }
|
||||
.appearance-theme-label { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 8px 4px 2px; min-height: 36px; }
|
||||
.appearance-theme-miniature { --mini-paper: #fff; --mini-sidebar: #f1f0ec; --mini-line: #dad9d5; display: flex; height: 84px; overflow: hidden; border-radius: calc(var(--radius-panel) - var(--appearance-theme-inset) - 1px); background: var(--mini-paper); box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.04); }
|
||||
.appearance-theme-miniature { --mini-paper: #fff; --mini-sidebar: #f1f0ec; --mini-line: #dad9d5; position: relative; display: flex; height: 84px; overflow: hidden; border-radius: calc(var(--radius-panel) - var(--appearance-theme-inset) - 1px); background: var(--mini-paper); box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.04); }
|
||||
.appearance-theme-miniature[data-mode="dark"] { --mini-paper: #303030; --mini-sidebar: #383838; --mini-line: #656565; }
|
||||
.appearance-theme-miniature[data-mode="system"] { --mini-paper: linear-gradient(110deg, #fff calc(50% - 0.5px), #303030 calc(50% + 0.5px)); --mini-sidebar: #f1f0ec; --mini-line: #969590; }
|
||||
.appearance-mini-sidebar { width: 24%; display: flex; flex-direction: column; gap: 6px; padding: 11px 7px; background: var(--mini-sidebar); }
|
||||
.appearance-mini-sidebar::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: #d7834c; margin-bottom: 6px; }
|
||||
.appearance-mini-sidebar::before { content: ""; width: 11px; height: 11px; background: url('/brand/nanobot_mark.svg') center / contain no-repeat; margin-bottom: 3px; }
|
||||
.appearance-mini-sidebar span { height: 3px; border-radius: 3px; background: var(--mini-line); }
|
||||
.appearance-mini-main { display: flex; min-width: 0; flex: 1; flex-direction: column; align-items: flex-start; gap: 5px; padding: 16px 12px 10px; }
|
||||
.appearance-mini-main span { height: 3px; width: 80%; border-radius: 3px; background: var(--mini-line); }
|
||||
.appearance-mini-main span:first-child { width: 46%; height: 5px; margin-bottom: 4px; }
|
||||
.appearance-mini-main span:last-child { width: 100%; height: 13px; margin-top: auto; border: 1px solid var(--mini-line); background: transparent; border-radius: 5px; }
|
||||
.appearance-mini-sky { position: absolute; inset: 0 0 0 24%; pointer-events: none; background: radial-gradient(ellipse at 80% 15%, rgb(252 204 110 / 0.2), transparent 65%); }
|
||||
.appearance-mini-sky svg { position: absolute; top: 10px; right: 10px; width: 12px; height: 12px; color: #b87522; stroke-width: 1.5; }
|
||||
.appearance-mini-sky svg + svg { display: none; color: #b4c6e8; }
|
||||
.appearance-theme-miniature[data-mode="dark"] .appearance-mini-sky { background: radial-gradient(ellipse at 80% 15%, rgb(103 147 220 / 0.2), transparent 65%); }
|
||||
.appearance-theme-miniature[data-mode="dark"] .appearance-mini-sky svg:first-child { display: none; }
|
||||
.appearance-theme-miniature[data-mode="dark"] .appearance-mini-sky svg + svg { display: block; }
|
||||
.appearance-theme-miniature[data-mode="system"] .appearance-mini-sky { background: linear-gradient(110deg, rgb(252 204 110 / 0.12) 40%, rgb(103 147 220 / 0.12) 60%); }
|
||||
.appearance-theme-miniature[data-mode="system"] .appearance-mini-sky svg:first-child { right: 56%; }
|
||||
.appearance-theme-miniature[data-mode="system"] .appearance-mini-sky svg + svg { display: block; }
|
||||
.appearance-reading-card { overflow: hidden; border-radius: var(--radius-panel); background: hsl(var(--settings-surface)); }
|
||||
.appearance-reading-controls { padding: 20px var(--settings-inset, 16px); }
|
||||
.appearance-size-options { display: flex; align-items: center; gap: 12px; max-width: 100%; }
|
||||
|
||||
Reference in new issue
Block a user