mirror of
https://github.com/hanzoai/site.git
synced 2026-11-20 21:21:13 +00:00
- Theme before paint: app/layout.jsx runs live hanzo.ai's own pre-paint script (localStorage "hanzo.appearance.painted", else prefers-color-scheme) and sets light/dark + t_light/t_dark, color-scheme and data-scheme; it re-applies when the device setting changes. Measured: "dark t_dark" at first paint, after hydration and after client navigation; no flash; JS off stays bright. theme-color follows the scheme (#0A0A0A dark, as live). No appearance switch: no captured live menu shows one, so no new words. - Tokens: html.dark gives --ink/--soft/--faint/--line/--card/--bg and Hanzo's --foreground/ --background/--primary/--border/--hover/--muted Hanzo's own dark values (public/hanzo.css: page #0d0d0d, text #e5e5e5, muted #a3a3a3, borders white 10%, #171717 / #0f0f0f / #262626 surfaces); rooms (system.css) too. New --x-raised/--x-on-ink/--x-fill/--x-sunk/--x-knob/--x-e10..15 replace hard-coded whites in shared rules (Hanzo already defines --card/--raised on inner elements, so the new names are prefixed). One-off greys keep their exact light value via light-dark(); html.light/html.dark pin color-scheme. - Dark-correct: cookie banner and preferences, announcement strip, sign-in buttons, buttons, search palette and scrims, menus and the menu feature card, sheets, drawers, pause buttons, related cards, every components/v2/*.css; the hero dot field draws in the page ink at 17% and redraws on a theme change. Hanzo's header and footer go dark through hanzo.css. - docs/DARK-MODE.md: how a page chat converts its pages; scripts/darkcheck.mjs (what is still bright in dark) and scripts/lightcheck.mjs (bright mode unchanged vs an older server). Checks: bright mode 0 computed-colour diffs vs the base commit on / /pricing /chat (1470, 375) and /enso /kai /api /affiliate /beta /about /dev /security /payments /models (1470); page text identical (only the live tokens/s counters move); 0 console/page errors in both modes on / /pricing /chat at 1470x801 and 375x812 (home's media requests to hanzo.ai are blocked in this sandbox, same in light); taste, unique OK; build exits 0 with HZ_LIVE_OFFLINE=1 (live figure hosts are blocked here). Page-owned CSS left for the page chats: /pricing .xpr-*, /chat .cht-*, home .xs-*/.xh-pause. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01P5YBdxPteCvBL7f74SauJt
43 lines
3.7 KiB
CSS
43 lines
3.7 KiB
CSS
/* Chapters (components/v2/Chapters.jsx). Pinned on desktop; one chapter after another on phones and for reduced motion. */
|
|
.v2-ch { position: relative; }
|
|
.v2-ch-title { display: inline-block; color: var(--ink); text-decoration: none; }
|
|
@media (hover: hover) { .v2-ch-title:hover { text-decoration: underline; text-decoration-thickness: .04em; text-underline-offset: .1em; } }
|
|
.v2-ch-title:active { transform: translateY(1px); }
|
|
.v2-ch-count span { color: var(--ink); }
|
|
.v2-ch-body { margin-top: 24px; }
|
|
.v2-ch-count { margin-top: 14px; }
|
|
.v2-ch-vis { position: relative; border-radius: 28px; overflow: hidden; background: var(--x-raised); cursor: pointer; transform-origin: 50% 100%; }
|
|
.v2-ch-index { display: none; }
|
|
|
|
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) and (scripting: enabled) {
|
|
.v2-ch { height: calc(100svh + var(--v2-n) * var(--v2-step) * 100svh); }
|
|
.v2-ch-in { position: sticky; top: 0; height: 100svh; display: flex; align-items: flex-start; padding-top: calc(60px + clamp(16px, 3vh, 32px)); box-sizing: border-box; }
|
|
.v2-ch-grid { width: 100%; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: 1fr auto; column-gap: var(--v2-gut); height: min(76svh, 700px); position: relative; }
|
|
/* the frame the pictures live in: one hairline and one long shadow, under every chapter */
|
|
.v2-ch-grid::before { content: ''; grid-column: 5 / 13; grid-row: 1 / 3; border-radius: 28px; border: 1px solid rgba(0, 0, 0, .08); box-shadow: var(--v2-shadow); background: var(--x-raised); }
|
|
.v2-ch-item { display: contents; }
|
|
.v2-ch-text { grid-column: 1 / 5; grid-row: 1; align-self: start; padding-right: 16px; opacity: 0; transform: translateY(28px); pointer-events: none;
|
|
transition: opacity .25s var(--v2-ease), transform .3s var(--v2-ease); }
|
|
.v2-ch-item[data-on='true'] .v2-ch-text { opacity: 1; transform: none; pointer-events: auto; transition: opacity .55s var(--v2-ease) .12s, transform .7s var(--v2-ease) .12s; }
|
|
.v2-ch-vis { grid-column: 5 / 13; grid-row: 1 / 3; min-height: 0; }
|
|
.v2-ch-index { display: grid; grid-template-columns: 2px 1fr; gap: 20px; grid-column: 1 / 5; grid-row: 2; align-self: end; }
|
|
.v2-ch-track { position: relative; background: rgba(0, 0, 0, .08); border-radius: 2px; overflow: hidden; }
|
|
.v2-ch-track b { position: absolute; inset: 0; background: var(--v2-accent); transform-origin: 50% 0; }
|
|
.v2-ch-index ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 2px 20px; }
|
|
.v2-ch-index button { border: 0; background: none; padding: 6px 0; font: 500 15px/1.2 var(--sans); color: #6e6e73; cursor: pointer; text-align: left; transition: color .22s, transform .12s; }
|
|
.v2-ch-index button:active { transform: translateY(1px); }
|
|
.v2-ch-index button[aria-current] { color: var(--ink); }
|
|
@media (hover: hover) { .v2-ch-index button:hover { color: var(--ink); } }
|
|
.v2-ch-index button[aria-current]::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--v2-accent); vertical-align: 2px; }
|
|
}
|
|
|
|
@media (max-width: 899px), (prefers-reduced-motion: reduce), (scripting: none) {
|
|
.v2-ch-item { display: flex; flex-direction: column; gap: 28px; padding-bottom: 96px; }
|
|
.v2-ch-item:last-child { padding-bottom: 0; }
|
|
.v2-ch-vis { order: -1; border: 1px solid rgba(0, 0, 0, .08); box-shadow: var(--v2-shadow); }
|
|
.v2-ch-body { margin-top: 18px; }
|
|
}
|
|
|
|
/* JS off: every chapter shown, no wipe left half-done */
|
|
@media (scripting: none) { .v2-ch-vis { clip-path: none !important; transform: none !important; } .v2-ch-text { opacity: 1 !important; transform: none !important; } }
|