Match shopping-list client styling to the other UI demos

Restyle from a bespoke dark theme to the light theme the other UI demos
share: the canonical :root tokens (--border, --muted, --highlight), the
#fafafa/#18181b body, the sticky white header with the light/red Connect
button, the fixed bottom-right #status toast, and the amber
ui-highlight-pulse keyframe. index.html drops the custom topbar wrapper for
the standard <header> plus a standalone #status element.
This commit is contained in:
Mark Backman
2026-05-21 22:59:26 -04:00
parent 10b8feb9ea
commit 0b9500aae4
2 changed files with 108 additions and 101 deletions

View File

@@ -7,12 +7,9 @@
<link rel="stylesheet" href="styles.css" /> <link rel="stylesheet" href="styles.css" />
</head> </head>
<body> <body>
<header class="topbar"> <header>
<h1>🛒 Shopping list</h1> <h1>🛒 Shopping list</h1>
<div class="topbar-right"> <button id="connect">Connect</button>
<span id="status" data-show="0"></span>
<button id="connect">Connect</button>
</div>
</header> </header>
<main> <main>
@@ -38,6 +35,7 @@
</p> </p>
</main> </main>
<div id="status" data-show="0"></div>
<audio id="bot-audio" autoplay></audio> <audio id="bot-audio" autoplay></audio>
<script type="module" src="main.js"></script> <script type="module" src="main.js"></script>
</body> </body>

View File

@@ -1,13 +1,13 @@
:root { :root {
--bg: #0f1115; color-scheme: light;
--panel: #181b22; font-family:
--panel-2: #1f242d; system-ui,
--text: #e8ebf0; -apple-system,
--muted: #97a0ad; sans-serif;
--accent: #5b8cff; --border: #d4d4d8;
--accent-soft: rgba(91, 140, 255, 0.18); --muted: #71717a;
--done: #5fd08a; --highlight: #fbbf24;
--border: #2a2f3a; --done: #16a34a;
} }
* { * {
@@ -16,149 +16,132 @@
body { body {
margin: 0; margin: 0;
font-family: background: #fafafa;
system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: #18181b;
background: var(--bg);
color: var(--text);
line-height: 1.5;
} }
.topbar { header {
position: sticky;
top: 0;
z-index: 10;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 16px 24px; padding: 1rem 1.5rem;
border-bottom: 1px solid var(--border); border-bottom: 1px solid var(--border);
position: sticky; background: #fff;
top: 0;
background: rgba(15, 17, 21, 0.92);
backdrop-filter: blur(6px);
} }
.topbar h1 { header h1 {
font-size: 20px; font-size: 1.25rem;
margin: 0; margin: 0;
} }
.topbar-right {
display: flex;
align-items: center;
gap: 12px;
}
#status {
font-size: 13px;
color: var(--muted);
transition: opacity 0.3s;
}
#status[data-show="0"] {
opacity: 0;
}
#connect { #connect {
font-size: 14px; padding: 0.5rem 1rem;
padding: 8px 18px; border: 1px solid var(--border);
border-radius: 8px; background: #fff;
border: 1px solid var(--accent); border-radius: 6px;
background: var(--accent-soft);
color: var(--text);
cursor: pointer; cursor: pointer;
font-size: 0.875rem;
}
#connect:hover {
background: #f4f4f5;
} }
#connect[data-state="connected"] { #connect[data-state="connected"] {
border-color: var(--border); background: #ef4444;
background: transparent; color: white;
color: var(--muted); border-color: #ef4444;
}
#connect:disabled {
opacity: 0.5;
cursor: default;
} }
main { main {
max-width: 560px; max-width: 640px;
margin: 0 auto; margin: 0 auto;
padding: 28px 24px 80px; padding: 1.5rem;
} }
.hint { .hint {
font-size: 0.875rem;
color: var(--muted); color: var(--muted);
font-size: 14px; line-height: 1.5;
margin: 0 0 18px; margin: 0 0 1.25rem;
} }
.add-form { .add-form {
display: flex; display: flex;
gap: 8px; gap: 0.5rem;
margin-bottom: 18px; margin-bottom: 1.25rem;
} }
.add-form input { .add-form input {
flex: 1; flex: 1;
font-size: 15px; font-size: 0.9375rem;
padding: 10px 12px; padding: 0.5rem 0.75rem;
border-radius: 8px;
border: 1px solid var(--border); border: 1px solid var(--border);
background: var(--panel); border-radius: 6px;
color: var(--text); background: #fff;
color: inherit;
} }
.add-form input:focus { .add-form input:focus {
outline: none; outline: none;
border-color: var(--accent); border-color: #a1a1aa;
} }
.add-form button { .add-form button {
font-size: 14px; padding: 0.5rem 1rem;
padding: 0 16px; font-size: 0.875rem;
border-radius: 8px;
border: 1px solid var(--border); border: 1px solid var(--border);
background: var(--panel-2); border-radius: 6px;
color: var(--text); background: #fff;
cursor: pointer; cursor: pointer;
} }
.add-form button:hover {
background: #f4f4f5;
}
.list { .list {
list-style: none; list-style: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 8px; gap: 0.5rem;
} }
.item { .item {
background: var(--panel); background: #fff;
border: 1px solid var(--border); border: 1px solid var(--border);
border-radius: 10px; border-radius: 8px;
transition: transition:
background 0.2s, opacity 0.2s,
opacity 0.2s; border-color 0.2s;
} }
.item label { .item label {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 12px; gap: 0.75rem;
padding: 12px 14px; padding: 0.75rem 0.875rem;
cursor: pointer; cursor: pointer;
} }
.item input[type="checkbox"] { .item input[type="checkbox"] {
width: 20px; width: 1.15rem;
height: 20px; height: 1.15rem;
accent-color: var(--done); accent-color: var(--done);
cursor: pointer; cursor: pointer;
} }
.item-text { .item-text {
font-size: 16px; font-size: 1rem;
} }
.item.checked { .item.checked {
opacity: 0.55; opacity: 0.6;
} }
.item.checked .item-text { .item.checked .item-text {
@@ -167,10 +150,10 @@ main {
} }
.list-empty { .list-empty {
font-size: 0.875rem;
color: var(--muted); color: var(--muted);
font-size: 14px;
text-align: center; text-align: center;
padding: 32px 0; padding: 2rem 0;
} }
.list-empty[hidden] { .list-empty[hidden] {
@@ -179,38 +162,64 @@ main {
/* New-item flash so a voice-added item is easy to spot. */ /* New-item flash so a voice-added item is easy to spot. */
.item-flash { .item-flash {
animation: item-flash 1s ease-out; animation: item-flash 1.2s ease-out;
} }
@keyframes item-flash { @keyframes item-flash {
0% { 0% {
background: var(--accent-soft); background: #fffbeb;
border-color: var(--accent); border-color: var(--highlight);
} }
100% { 100% {
background: var(--panel); background: #fff;
border-color: var(--border); border-color: var(--border);
} }
} }
/* Standard ``highlight`` command: a brief pulse. Duration is driven by /* Standard ``highlight`` command: a brief amber pulse, matching the
the server-supplied duration_ms via the --highlight-duration var. */ other UI demos. Duration is driven by the server-supplied duration_ms
via the --highlight-duration variable. */
.ui-highlight { .ui-highlight {
animation: ui-highlight var(--highlight-duration, 1500ms) ease-out; animation: ui-highlight-pulse var(--highlight-duration, 2500ms)
cubic-bezier(0.2, 0.8, 0.2, 1);
z-index: 2;
} }
@keyframes ui-highlight { @keyframes ui-highlight-pulse {
0% { 0% {
transform: scale(1); transform: scale(1);
box-shadow: 0 0 0 0 var(--accent-soft); box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
background: #fff;
border-color: var(--border);
} }
30% { 35% {
transform: scale(1.02); transform: scale(1.04);
box-shadow: 0 0 0 6px var(--accent-soft); box-shadow: 0 0 36px 8px rgba(251, 191, 36, 0.55);
border-color: var(--accent); background: #fffbeb;
border-color: var(--highlight);
} }
100% { 100% {
transform: scale(1); transform: scale(1);
box-shadow: 0 0 0 0 rgba(91, 140, 255, 0); box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
background: #fff;
border-color: var(--border);
} }
} }
#status {
position: fixed;
bottom: 1rem;
right: 1rem;
padding: 0.5rem 0.75rem;
border-radius: 6px;
font-size: 0.8125rem;
background: #18181b;
color: white;
opacity: 0;
transition: opacity 0.2s;
pointer-events: none;
}
#status[data-show="1"] {
opacity: 1;
}