From 3b45270c6bc21ce0d8817b4070531cfe32827539 Mon Sep 17 00:00:00 2001 From: i-execute Date: Fri, 13 Nov 2026 11:37:54 +0000 Subject: [PATCH] clean source: pass twelve --- src/App.jsx | 3 --- src/components/QuasarScene.jsx | 39 ---------------------------- src/index.css | 47 +++++++--------------------------- src/tokens.css | 8 ++---- 4 files changed, 11 insertions(+), 86 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 63068de..9af35c2 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -67,9 +67,6 @@ export function App() { }, []); useEffect(() => { - // Older builds used a #docs fragment even though the guide is an - // in-app view. Remove it from old links so navigation never leaves a - // decorative hash in the address bar. if (window.location.hash.startsWith('#docs')) { window.history.replaceState(null, '', window.location.pathname + window.location.search); } diff --git a/src/components/QuasarScene.jsx b/src/components/QuasarScene.jsx index d1b3db0..a67a109 100644 --- a/src/components/QuasarScene.jsx +++ b/src/components/QuasarScene.jsx @@ -148,10 +148,6 @@ vec3 traceScene(vec2 uv) { bool captured = false; float minR = 1000.0; int diskCrossings = 0; - - // the walk through the curved space is the expensive part of the frame. - // the step budget is set from the outside, so a slow device spends less - // of it and a quick one keeps every detail for (int i = 0; i < 300; i++) { if (float(i) >= uSteps) break; vec3 prevPos = pos; @@ -294,16 +290,10 @@ function rotate(v, k, ang) { const d = dot(k, v) * (1 - c); return [v[0] * c + kv[0] * s + k[0] * d, v[1] * c + kv[1] * s + k[1] * d, v[2] * c + kv[2] * s + k[2] * d]; } - -// the disk opens far enough that the hole reads as a big body of light -// reaching across the frame, rather than a thin band that leaves half -// the page bare const DEFAULT_PITCH = 0.34; const DEFAULT_DIST = 26.0; const DIST_MIN = 15.0; const DIST_MAX = 33.0; -// how far the eye sits below the middle of the band, to compensate for the -// bright limb of the disk glowing above the eye point const BRIGHT_LIFT = 16; const isWideScreen = () => @@ -318,10 +308,8 @@ function defaultFrame() { } const QUALITY = [0.8, 0.9, 1.0]; -// how many steps of the ray walk each quality level is allowed to take const STEPS = [110, 190, 300]; const COMPACT_HEIGHT = 560; -// the apparent width of the hole in css pixels, for a given camera scale const FIT_SPAN = 0.674; const TILT_BASE = 0.3986; const TILT_GROW = 0.4111; @@ -333,7 +321,6 @@ const VEL_TAU = 0.09; const GLIDE = 2.0; const MAX_RATE = 3.0; const DRIFT = 0.055; -// how far the camera pulls back while the hole is being spun const DOLLY_MAX = 0.46; const LABELS = { @@ -375,9 +362,6 @@ export function QuasarScene({ lang = 'en', copyRef = null }) { top: canvasRect.top, left: canvasRect.left, }; - // a phone gets its own framing: the hole has to fit the width of the - // screen with a margin on both sides, however the disk happens to - // lean while it turns const phone = canvasW < 768; const compact = window.innerHeight < COMPACT_HEIGHT; if (!phone && !compact) { @@ -402,33 +386,22 @@ export function QuasarScene({ lang = 'en', copyRef = null }) { const gap = phone || compact ? 14 : 26; const room = Math.max(46, band - gap * 2); const minCss = Math.min(canvasW, canvasH); - // the hole is the centerpiece: it sits dead centre, so the disk is - // sized to leave the same margin on both sides of the frame const wanted = canvasW * (phone ? 0.82 : 0.80); const byHeight = room / 0.76; const apparent = Math.max(120, Math.min(wanted, byHeight)); let scale = (FIT_SPAN * minCss) / apparent; if (scale > 3.4) scale = 3.4; - // the bright limb of the disk reads a touch above the eye point, so the - // eye is placed a little below the middle of the band to leave the - // same air above and below the ring on any screen height const eyeMid = plateBottom + band / 2 + BRIGHT_LIFT; layoutRef.current = { ready: true, scale, room, - // the hole sits on the centre line, so the ring reads as the - // subject of the frame rather than something leaning to one side shiftX: 0, - // the ring is centred in the band, so it is neither pinned under the - // plate nor left adrift above the copy eyeY: eyeMid - canvasDocTop, compact, }; }; measure(); - // the two layouts frame the hole differently, so a change of size - // across the line between them starts the camera afresh let wasWide = isWideScreen(); const onResize = () => { const wide = isWideScreen(); @@ -514,8 +487,6 @@ export function QuasarScene({ lang = 'en', copyRef = null }) { let lastDraw = 0; let windowStart = performance.now(); canvas.dataset.quality = String(QUALITY.length - 1); - // the number of frames actually put on the screen, so a caller can - // wait for the scene to be on the glass instead of guessing at a delay let frames = 0; canvas.dataset.frames = '0'; const FRAME_MIN = 1000 / 61; @@ -551,13 +522,9 @@ export function QuasarScene({ lang = 'en', copyRef = null }) { if (lastDraw) { frameSum += now - lastDraw; frameCount++; - // the window is a slice of time rather than a number of frames, so - // a weak device settles in a second or so instead of waiting for - // twenty slow frames to pile up if (frameCount >= 3 && now - windowStart > 600) { const avg = frameSum / frameCount; if (avg > 45 && quality > 0) { - // a device far off the pace drops more than one level at once quality = avg > 200 ? Math.max(0, quality - 2) : avg > 90 ? Math.max(0, quality - 1) : quality - 1; @@ -605,10 +572,6 @@ export function QuasarScene({ lang = 'en', copyRef = null }) { const yawRate = st.velX + (reduceMotion.matches ? 0 : DRIFT); turn(takeX + yawRate * dt, takeY + st.velY * dt); } - - // spinning the hole pulls the camera back, and it drifts in again - // once the hand lets go. the return follows the clock, not the frame - // rate, so a slow device recovers in the same time as a fast one const spinDt = Math.min(rawDt, 0.5); st.spin = st.isDragging ? Math.min(1, st.spin + spinDt * 1.15) @@ -625,8 +588,6 @@ export function QuasarScene({ lang = 'en', copyRef = null }) { if (isMobile || layout.compact) { if (layout.ready) { scale = layout.scale; - // the bright limb of the disk leans to one side, so the whole - // ring is nudged back the other way to stay inside the frame center = [0.5 - (layout.shiftX || 0), 1 - layout.eyeY / rect.height]; } else { center = [0.5, 0.7]; diff --git a/src/index.css b/src/index.css index a1523ed..fea0401 100644 --- a/src/index.css +++ b/src/index.css @@ -1,8 +1,3 @@ -/* Hallmark · shape: Observatory · genre: atmospheric · theme: brand · redesign: docs shell - * paper: oklch(6% 0 0) · accent: oklch(98% 0 0), the ink itself · display: Tektur · body: Onest · mono: JetBrains Mono - * hero: the raymarched black hole from the logo, live and draggable, in white light on black - * docs: a floating search row over a sticky chapter rail, method names as luminous static headings - * axes: dark/display-condensed/neutral · posture: restrained · contrast: pass · fold: pass · v3.0.0 */ @import "./tokens.css"; @import "./base.css" layer(base); @@ -11,7 +6,7 @@ @tailwind utilities; @layer components { - /* ── buttons: one radius for every control ───────────────────────────── */ + .btn { position: relative; isolation: isolate; @@ -108,24 +103,17 @@ } .lang-switch .tab[aria-pressed="true"]:hover { background: oklch(100% 0 0 / 0.14); } - /* ── hero ────────────────────────────────────────────────────────────── */ .hero__body { position: relative; z-index: var(--z-raised); } - /* on a wide screen the copy sits beside the hole rather than under it, - so the two halves of the frame are both occupied */ + @media (min-width: 48rem) { .hero { justify-content: flex-end; } .hero__body { padding-top: 0; } } - /* on a narrow screen the hero takes the whole frame above the footer, so - the landing reads as one page instead of a scene and a gap */ + @media (max-width: 47.99rem) { .hero { flex: 1 1 auto; } } - /* the wordmark carries the glow on its own: a soft halo plus a slow - highlight that travels across the glyphs. the light also spills out - of the flanks of the letters, so the title has a side aura rather - than only being bright */ .wordmark { position: relative; display: inline-block; @@ -210,7 +198,6 @@ .hero__body.hero__body { padding-top: 62svh; } } - /* ── floating navigation ─────────────────────────────────────────────── */ .nav-head { transition: transform 320ms var(--ease-out), opacity 240ms var(--ease-out); } @@ -250,7 +237,7 @@ 0 22px 44px -18px oklch(0% 0 0 / 0.92), 0 0 26px oklch(100% 0 0 / 0.06), inset 0 1px 0 oklch(100% 0 0 / 0.12); - /* the sheet grows out of the button that summoned it */ + transform-origin: top right; animation: sheet-in 380ms var(--ease-out) backwards; will-change: transform, opacity; @@ -266,7 +253,7 @@ 0% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-8px) scale(0.9); } } - /* the rows settle in one after the other */ + .nav-sheet > * { animation: sheet-row-in 320ms var(--ease-out) backwards; } @@ -317,14 +304,14 @@ } @layer components { - /* ── documentation shell ───────────────────────────────────────────────── */ + .doc-shell { min-height: 100dvh; background: radial-gradient(1200px 620px at 78% -8%, oklch(100% 0 0 / 0.045), transparent 62%), radial-gradient(900px 520px at 8% 104%, oklch(100% 0 0 / 0.03), transparent 60%), var(--color-paper); - /* inside the guide the halo is barely there, so the reading stays quiet */ + text-shadow: var(--halo-whisper); } @@ -434,7 +421,6 @@ .doc-btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; } .doc-btn--sm { min-height: 36px; padding: 0 var(--space-sm); font-size: var(--text-xs); } - /* segmented guide / methods switch */ .doc-seg { display: inline-flex; align-items: center; @@ -477,7 +463,6 @@ } .doc-seg__btn[aria-pressed="true"] .doc-seg__num { color: oklch(78% 0 0); } - /* floating search row */ @media (max-width: 61.99rem) { :root { --doc-head-h: 58px; } } @@ -595,7 +580,6 @@ .doc-search__clear:active { transform: scale(0.94); } .doc-search__clear:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; } - /* command palette */ .doc-overlay { position: fixed; inset: 0; @@ -697,7 +681,6 @@ .doc-palette__item:hover .doc-palette__go { opacity: 1; } .doc-palette__empty { padding: var(--space-lg); text-align: center; color: var(--color-muted); font-size: var(--text-sm); } - /* layout */ .doc-layout { display: grid; grid-template-columns: minmax(0, 1fr); @@ -774,7 +757,6 @@ .doc-main { min-width: 0; } - /* mobile chapter controls */ .doc-mobile { display: flex; flex-direction: column; gap: var(--space-sm); margin-bottom: var(--space-lg); } @media (min-width: 62rem) { .doc-mobile { display: none; } } .doc-mobile__seg { display: flex; } @@ -836,7 +818,6 @@ overflow-y: auto; } - /* article */ .doc-article { max-width: 54rem; } .doc-eyebrow { display: flex; @@ -951,7 +932,6 @@ } .doc-table td:first-child, .doc-method__table td:first-child { color: var(--color-ink); } - /* code blocks */ .doc-code-block { margin: 0; border: 1px solid oklch(100% 0 0 / 0.09); @@ -1001,7 +981,6 @@ } .doc-state--on { color: var(--color-ink); text-shadow: 0 0 14px var(--color-glow); } - /* method catalog */ .doc-catalog { display: flex; flex-direction: column; gap: var(--space-lg); } .doc-catalog__bar { display: flex; @@ -1042,7 +1021,6 @@ .doc-catalog__list { display: flex; flex-direction: column; gap: var(--space-md); } .doc-empty { padding: var(--space-xl) 0; color: var(--color-muted); } - /* method card: a static, luminous heading with no copy control */ .doc-method { padding: var(--space-md); border: 1px solid oklch(100% 0 0 / 0.07); @@ -1067,9 +1045,7 @@ overflow-wrap: anywhere; } .doc-method__prefix { color: var(--color-muted); opacity: 0.75; } - /* the name itself carries the light: the fill runs bright down the - middle of the strokes and dims at the edges, so the glow reads from - inside the lettering and not only around it */ + .doc-method__name { color: transparent; background-image: linear-gradient( @@ -1104,7 +1080,6 @@ .doc-method__opt { color: var(--color-muted); } .doc-method__default { font-family: var(--font-outlier); color: var(--color-muted); } - /* pager */ .doc-pager { display: grid; grid-template-columns: 1fr 1fr; @@ -1145,7 +1120,6 @@ text-shadow: 0 0 16px oklch(100% 0 0 / 0.18); } - /* docs footer */ .doc-footer { border-top: 1px solid var(--color-rule); background: oklch(0% 0 0 / 0.4); @@ -1172,7 +1146,6 @@ .doc-footer__link:hover { color: var(--color-ink); text-shadow: 0 0 16px oklch(100% 0 0 / 0.22); } .doc-footer__link:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; } - /* ── press illumination ───────────────────────────────────────────────── */ @property --press { syntax: ''; inherits: true; @@ -1269,8 +1242,7 @@ inset 0 0 12px 1px oklch(100% 0 0 / calc(var(--press) * 0.28)), inset 0 0 22px 2px oklch(100% 0 0 / calc(var(--press) * 0.18)); } - /* the halo that sits outside the edge of the control, so the lit button - is not a hard shape with a soft inside */ + :is( .btn, .link, @@ -1374,7 +1346,6 @@ } } - /* ── shared focus ─────────────────────────────────────────────────────── */ .btn:focus-visible, .tab:focus-visible, .link:focus-visible, diff --git a/src/tokens.css b/src/tokens.css index 1376f07..43afcb1 100644 --- a/src/tokens.css +++ b/src/tokens.css @@ -20,15 +20,11 @@ --glow-md: 0 0 26px oklch(100% 0 0 / 0.20), 0 0 6px oklch(100% 0 0 / 0.12); --glow-lg: 0 0 44px oklch(100% 0 0 / 0.26), 0 0 10px oklch(100% 0 0 / 0.16); --glow-edge: inset 0 1px 0 oklch(100% 0 0 / 0.12); - /* the small aura that sits just outside a control's boundary: a crisp - one pixel ring right at the edge and a tight bloom outside it, so the - border itself stays sharp and readable */ + --aura-control: 0 0 0 1px oklch(100% 0 0 / 0.11), 0 0 9px 0 oklch(100% 0 0 / 0.15); --aura-control-lit: 0 0 0 1px oklch(100% 0 0 / 0.22), 0 0 14px 1px oklch(100% 0 0 / 0.24); --glow-text: 0 0 18px oklch(100% 0 0 / 0.32); - /* the text halos, in four weights. the headings carry a side aura: the - light spills out of the flanks of the glyphs and leaves the strokes - themselves crisp, the way the buttons carry a rim of light */ + --halo-faint: 0 0 10px oklch(100% 0 0 / 0.05); --halo-whisper: 0 0 8px oklch(100% 0 0 / 0.028); --halo-title: