earshelf / source /src /style.css
WilburDev's picture
Deploy 2026-11-20T20:26Z
b1876f7 verified
Raw History Blame Contribute Delete
22.5 kB
:root { --bg: #f6f1e7; --surface: #fffaf0; --ink: #2a241c; --muted: #6e6253; --line: #e3d8c4; --line-strong: #948468; /* borders that ARE the control (fields): 3.5:1 on surface */ --accent: #c2410c; /* the one action colour: play / add */ --accent-ink: #ffffff; --hl: #fde7c4; --hl-ink: #2a241c; --danger: #b42318; --danger-line: #b42318; /* error borders: 6.3:1 on surface */ --radius: 16px; --shadow: 0 6px 24px rgba(60, 40, 10, 0.1); color-scheme: light; } @media (prefers-color-scheme: dark) { :root { --bg: #1b1814; --surface: #24201b; --ink: #efe6d6; --muted: #b3a690; --line: #3a332a; --line-strong: #7a6d5b; /* 3.2:1 on surface */ --accent: #f97316; --accent-ink: #1b1814; --hl: #4a3519; --hl-ink: #fff4e2; --danger: #c0281b; /* white text on it: 5.9:1 */ --danger-line: #e5533f; /* #c0281b is only 2.7:1 on the dark surface; this is 4.35:1 */ --shadow: 0 6px 24px rgba(0, 0, 0, 0.4); color-scheme: dark; } } * { box-sizing: border-box; } html, body { margin: 0; height: 100%; } body { background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-tap-highlight-color: transparent; } button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; } button:active { transform: scale(0.94); } button:focus-visible, .drop:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; } [hidden] { display: none !important; } .view { max-width: 760px; margin: 0 auto; } /* ---------- library ---------- */ #library { padding: max(16px, env(safe-area-inset-top)) 16px 32px; } .lib-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; } .brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 20px; letter-spacing: -0.01em; } .logo { width: 30px; height: 30px; border-radius: 9px; background: url('../public/icon.svg') center/cover; } .private-pill { font-size: 13px; color: var(--muted); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; } .hero h1 { font-size: clamp(28px, 7vw, 40px); line-height: 1.1; margin: 8px 0 8px; letter-spacing: -0.02em; } .hero > p { color: var(--muted); margin: 0 0 20px; max-width: 34em; } .drop { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center; padding: 18px 20px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; transition: border-color 0.15s, transform 0.1s; min-height: 84px; } .drop:hover, .drop.over { border-color: var(--accent); } .drop:active { transform: scale(0.99); } .drop input { position: absolute; width: 1px; height: 1px; opacity: 0; } .drop-icon { grid-row: span 2; width: 48px; height: 48px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 28px; font-weight: 700; } .drop-main { font-weight: 700; font-size: 18px; } .drop-sub { color: var(--muted); font-size: 14px; } .link-btn { margin-top: 10px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 10px 0; min-height: 44px; } #shelf h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 28px 0 10px; } .books { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; } .book { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); } .book-open { /* a real box (not display:contents), so keyboard users can focus it */ display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; text-align: left; min-width: 0; padding: 0; border-radius: 8px; } .cover { width: 56px; height: 78px; border-radius: 6px; object-fit: cover; background: linear-gradient(160deg, #8a5a2b, #3b2a1a); color: #fff4e2; display: grid; place-items: center; font-weight: 800; font-size: 22px; overflow: hidden; } .book-meta { min-width: 0; } .book-title { font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } .book-sub { color: var(--muted); font-size: 13px; margin-top: 2px; } .mini-bar { height: 5px; background: var(--line); border-radius: 3px; margin-top: 8px; overflow: hidden; } .mini-bar > div { height: 100%; background: var(--accent); } .del { width: 44px; height: 44px; border-radius: 12px; color: var(--muted); font-size: 18px; } .del.armed { color: #fff; background: var(--danger); width: auto; padding: 0 12px; font-size: 14px; font-weight: 700; } .lib-foot { margin-top: 32px; color: var(--muted); font-size: 13px; } .lib-foot .fine { max-width: 36em; } .lib-foot .fine a { color: inherit; text-decoration: underline; text-underline-offset: 2px; } /* ---------- player ---------- */ #player { height: 100dvh; display: flex; flex-direction: column; } .p-head { display: flex; align-items: center; gap: 6px; padding: max(8px, env(safe-area-inset-top)) 12px 8px 4px; border-bottom: 1px solid var(--line); } .icon-btn { min-width: 44px; min-height: 44px; border-radius: 12px; font-size: 26px; display: grid; place-items: center; } .icon-btn.big { font-size: 24px; width: 52px; height: 52px; } .p-titles { min-width: 0; flex: 1; } .p-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .chapter-btn { color: var(--muted); font-size: 14px; padding: 2px 0; min-height: 44px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; } .banner { margin: 10px 12px 0; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; color: var(--muted); } .banner .bar { margin-top: 6px; } /* the dock's pill buttons are capped at 110px; a banner action must show its whole label */ .banner .pill-btn { max-width: 100%; margin-top: 8px; padding: 0 16px; } .reader { flex: 1; overflow-y: auto; padding: 18px 20px 40px; font-size: 19px; line-height: 1.7; font-family: Georgia, 'Iowan Old Style', 'Times New Roman', serif; -webkit-overflow-scrolling: touch; } .reader h2 { font-family: system-ui, sans-serif; font-size: 22px; margin: 0 0 14px; } .reader p { margin: 0 0 0.9em; } .s { cursor: pointer; border-radius: 4px; transition: background-color 0.18s; } .s:hover { background: color-mix(in srgb, var(--hl) 45%, transparent); } .s.on { background: var(--hl); color: var(--hl-ink); box-shadow: 0 0 0 3px var(--hl); text-decoration: underline 2px var(--accent); text-underline-offset: 4px; } .dock { border-top: 1px solid var(--line); background: var(--surface); padding: 8px 12px max(12px, env(safe-area-inset-bottom)); } .progress-row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); } .seek-wrap { flex: 1; position: relative; display: flex; align-items: center; min-height: 44px; } .seek-wrap .bar { pointer-events: none; } #seek { position: absolute; inset: 0; width: 100%; margin: 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; } #seek::-webkit-slider-runnable-track { height: 44px; background: transparent; } #seek::-moz-range-track { height: 44px; background: transparent; } #seek::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: 13px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); } #seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); } #seek:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; } .bar { flex: 1; height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; } .bar > div { height: 100%; width: 0; background: var(--accent); transition: width 0.3s; } .progress-label { white-space: nowrap; min-width: 7em; text-align: right; } .controls { display: flex; align-items: center; justify-content: space-between; max-width: 460px; margin: 6px auto 0; } .play-btn { width: 68px; height: 68px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 28px; display: grid; place-items: center; box-shadow: var(--shadow); position: relative; } .play-btn.buffering::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--accent); animation: spin 0.9s linear infinite; } .pill-btn { min-width: 64px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 600; max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* ---------- sheets ---------- */ .sheet { border: 0; padding: 0; margin: auto auto 0; width: min(560px, 100%); max-width: 100%; /* the browser's dialog default leaves gaps at the sides on phones */ max-height: 80dvh; border-radius: 20px 20px 0 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); } .sheet::backdrop { background: rgba(20, 14, 6, 0.45); } .sheet[open] { animation: up 0.18s ease-out; } .sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 4px 20px; position: sticky; top: 0; background: var(--surface); } .sheet-head h3 { margin: 0; } .chapter-list { margin: 0; padding: 0 8px 20px; list-style: none; } .chapter-list button { width: 100%; text-align: left; padding: 12px; min-height: 48px; border-radius: 10px; display: flex; gap: 10px; } .chapter-list button.cur { background: var(--hl); color: var(--hl-ink); font-weight: 700; } .chapter-list button::after { content: attr(data-meta); margin-left: auto; padding-left: 12px; color: var(--muted); font-weight: 400; font-size: 14px; white-space: nowrap; } .chapter-list button.cur::after { color: var(--hl-ink); font-weight: 700; } .chapter-list button.done { color: var(--muted); } .chapter-list .num { color: var(--muted); min-width: 2em; } #voice-body { padding: 0 20px 24px; } .voice-group h4 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); } .voice-group p { margin: 0 0 8px; font-size: 13px; color: var(--muted); } .voice-opt { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; padding: 10px 12px; min-height: 48px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 6px; } .voice-opt.cur { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 700; } .voice-opt small { color: var(--muted); font-weight: 400; } select.device-voices { width: 100%; min-height: 48px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); padding: 0 10px; font: inherit; } /* ---------- misc ---------- */ .toast { position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translate(-50%, -12px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; max-width: min(360px, calc(100% - 32px)); text-align: center; z-index: 20; border-radius: 14px; } body:has(#library:not([hidden])) .toast { top: auto; bottom: max(24px, env(safe-area-inset-bottom)); transform: translate(-50%, 12px); } .toast.show { opacity: 1; transform: translate(-50%, 0); } .toast.err { background: var(--danger); color: #fff; } .busy { position: fixed; inset: 0; background: rgba(20, 14, 6, 0.45); display: grid; place-content: center; justify-items: center; z-index: 30; text-align: center; padding: 16px; } .busy-card { display: grid; justify-items: center; gap: 10px; width: min(340px, calc(100vw - 32px)); padding: 24px 20px 20px; border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); } .busy-card p { margin: 0; overflow-wrap: anywhere; } .busy-card .bar { width: 100%; flex: none; } .busy-sub { font-size: 13px; color: var(--muted); } .spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } @keyframes up { from { transform: translateY(30px); opacity: 0; } } @media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } } /* short landscape phones */ @media (max-height: 420px) { .play-btn { width: 52px; height: 52px; font-size: 22px; } .reader { padding-top: 8px; font-size: 17px; } .dock { padding-top: 4px; padding-bottom: max(4px, env(safe-area-inset-bottom)); } .controls { margin-top: 2px; } .toast { top: 52px; /* below the short header */ } .p-head { padding-top: 2px; padding-bottom: 2px; } } /* ---------- icons ---------- */ .ic { width: 26px; height: 26px; fill: currentColor; flex: none; } .ic.sm { width: 15px; height: 15px; } .play-btn .ic { width: 32px; height: 32px; } .skip { position: relative; } .skip-n { position: absolute; font-size: 9px; font-weight: 800; top: 50%; left: 50%; transform: translate(-50%, -32%); pointer-events: none; } .private-pill { display: inline-flex; align-items: center; gap: 5px; } /* ---------- sample + continue (library home) ---------- */ .sample-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 12px; min-height: 52px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); font-weight: 600; } .sample-btn .ic { width: 20px; height: 20px; color: var(--accent); } .continue { display: flex; align-items: center; gap: 14px; margin: 18px 0 4px; padding: 14px 14px 14px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); } .continue-info { flex: 1; min-width: 0; } .continue-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); } .continue-title { font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .continue-sub { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .continue-play { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; } /* once there are books, the library is a home: a smaller hero, the book first */ #library.has-books .hero h1, #library.has-books .hero > p { display: none; } #library.has-books .drop { min-height: 64px; padding: 10px 16px; } #library.has-books .drop-icon { width: 40px; height: 40px; font-size: 24px; } /* ---------- download chip + sleep ---------- */ .banner.chip { margin: 6px auto 0; padding: 4px 12px; border-radius: 999px; font-size: 13px; width: fit-content; max-width: calc(100% - 24px); display: flex; align-items: center; gap: 10px; } .banner.chip .chip-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; } .banner.chip .bar { margin: 0; width: 60px; flex: none; } .chip-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: var(--muted); white-space: nowrap; } .chip-btn.on { color: var(--ink); border-color: var(--accent); } /* short landscape phones: one-line header, one-row dock, so the text keeps most of the height */ @media (max-height: 420px) and (min-width: 560px) { .p-titles { display: flex; align-items: center; gap: 12px; } .p-title { flex: 0 1 auto; max-width: 45%; } .chapter-btn { flex: 1; min-width: 0; } .dock { display: flex; align-items: center; gap: 12px; } .progress-row { flex: 1; min-width: 0; order: 2; } .progress-label { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; } .seek-wrap { min-width: 120px; } } /* the narrowest landscape phones: no room for the time label (it stays in the slider's spoken value) */ @media (max-height: 420px) and (min-width: 560px) and (max-width: 619px) { .progress-label { display: none; } .dock { gap: 8px; } .progress-row { gap: 6px; } #sleep { padding: 0 8px; } .controls { margin: 0; gap: 6px; max-width: none; } .pill-btn { min-width: 52px; } .banner.chip { margin-top: 2px; } } .ic.sm2 { width: 20px; height: 20px; } .del { color: var(--muted); } /* the toast sits under the download chip, not on top of it */ body:has(#player:not([hidden]) #model-banner:not([hidden])) .toast { top: calc(112px + env(safe-area-inset-top)); } @media (max-height: 420px) { body:has(#player:not([hidden]) #model-banner:not([hidden])) .toast { top: 92px; } } /* ---------- paywall ---------- */ .pw-body { /* same left edge as the sheet title (.sheet-head padding-left) */ padding: 4px 20px 20px; } .pw-lead { margin: 0 0 10px; } .pw-list { margin: 0 0 16px; padding-left: 1.2em; color: var(--muted); } .pw-list li { margin: 4px 0; } .primary-btn { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; font-size: 17px; /* flex drops the spaces between text and the price span: put them back as a gap */ gap: 0.3em; } .primary-btn:active { transform: scale(0.97); } .pw-fine { font-size: 13px; color: var(--muted); text-align: center; margin: 8px 0 12px; } #pw-restore summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--muted); } #pw-form { display: flex; gap: 8px; } #pw-key { flex: 1; min-width: 0; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); padding: 0 12px; font: inherit; } #pw-msg { font-size: 14px; min-height: 1.4em; margin: 6px 0 0; } #pw-later { display: block; margin: 4px auto 0; } #pw-restore summary::before { content: '▸'; margin-right: 8px; } #pw-restore[open] summary::before { content: '▾'; } #pw-restore summary::-webkit-details-marker { display: none; } /* ---------- UX upgrade 2026-11-19 ---------- */ @media (min-width: 700px) { .sheet { margin: auto; border-radius: 20px; max-height: min(80dvh, 720px); } } #pw-key, select.device-voices { border-color: var(--line-strong); } .pw-steps { display: flex; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; counter-reset: step; font-size: 13px; color: var(--muted); } .pw-steps li { flex: 1; counter-increment: step; padding: 8px; border-radius: 10px; background: var(--bg); line-height: 1.3; } .pw-steps li::before { content: counter(step); display: block; font-weight: 700; color: var(--ink); } .lib-error { margin: 12px 0 0; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--danger-line); border-left-width: 5px; background: var(--surface); } .lib-error p { margin: 0 0 10px; } .lib-error-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .lib-error-actions .link-btn { margin-top: 0; } .lib-error-actions .pill-btn { max-width: none; display: inline-flex; align-items: center; padding: 0 16px; cursor: pointer; } /* keyboard focus on a book: one ring, around the whole card (not a second one on the inner button) */ .book:has(.book-open:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; } .book-open:focus-visible { outline: none; } .book-open:active { transform: none; /* the global button press-scale would shrink the whole row */ } a:focus-visible, summary:focus-visible, #pw-key:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; } /* one filled accent on the home screen once books exist: the Continue play button */ #library.has-books .drop-icon { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); } /* voice previews: a play button beside each voice */ .voice-row { display: flex; gap: 8px; align-items: stretch; margin-bottom: 6px; } .voice-row .voice-opt { margin-bottom: 0; flex: 1; } .voice-row select.device-voices { flex: 1; min-width: 0; } .voice-hear { flex: none; width: 48px; min-height: 48px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink); } .voice-hear.on { border-color: var(--accent); color: var(--accent); } .voice-hear:disabled { opacity: 0.4; } /* the receipt link (#unlock): only the code box, no sales pitch */ #paywall.code-mode .pw-list, #paywall.code-mode #pw-buy, #paywall.code-mode .pw-fine, #paywall.code-mode .pw-steps, #paywall.code-mode #pw-restore summary { display: none; } #pw-paste { margin-top: 6px; }
:root {
--bg: #f6f1e7;
--surface: #fffaf0;
--ink: #2a241c;
--muted: #6e6253;
--line: #e3d8c4;
--line-strong: #948468; /* borders that ARE the control (fields): 3.5:1 on surface */
--accent: #c2410c; /* the one action colour: play / add */
--accent-ink: #ffffff;
--hl: #fde7c4;
--hl-ink: #2a241c;
--danger: #b42318;
--danger-line: #b42318; /* error borders: 6.3:1 on surface */
--radius: 16px;
--shadow: 0 6px 24px rgba(60, 40, 10, 0.1);
color-scheme: light;
}
@media (prefers-color-scheme: dark) {
:root {
--bg: #1b1814;
--surface: #24201b;
--ink: #efe6d6;
--muted: #b3a690;
--line: #3a332a;
--line-strong: #7a6d5b; /* 3.2:1 on surface */
--accent: #f97316;
--accent-ink: #1b1814;
--hl: #4a3519;
--hl-ink: #fff4e2;
--danger: #c0281b; /* white text on it: 5.9:1 */
--danger-line: #e5533f; /* #c0281b is only 2.7:1 on the dark surface; this is 4.35:1 */
--shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
color-scheme: dark;
}
}
* {
box-sizing: border-box;
}
html,
body {
margin: 0;
height: 100%;
}
body {
background: var(--bg);
color: var(--ink);
font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
-webkit-tap-highlight-color: transparent;
}
button {
font: inherit;
color: inherit;
cursor: pointer;
border: 0;
background: none;
touch-action: manipulation;
}
button:active {
transform: scale(0.94);
}
button:focus-visible,
.drop:focus-within {
outline: 3px solid var(--accent);
outline-offset: 2px;
}
[hidden] {
display: none !important;
}
.view {
max-width: 760px;
margin: 0 auto;
}
/* ---------- library ---------- */
#library {
padding: max(16px, env(safe-area-inset-top)) 16px 32px;
}
.lib-head {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
}
.brand {
display: flex;
align-items: center;
gap: 10px;
font-weight: 750;
font-size: 20px;
letter-spacing: -0.01em;
}
.logo {
width: 30px;
height: 30px;
border-radius: 9px;
background: url('../public/icon.svg') center/cover;
}
.private-pill {
font-size: 13px;
color: var(--muted);