Skip to content

176 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step.

docs: fix the Scroll-Based sheet part 1 after review

matin0e50b789b6f9
diff --git a/docs/superpowers/plans/2026-09-29-scroll-content-part1.md b/docs/superpowers/plans/2026-09-29-scroll-content-part1.md
index b4e984da..b4251334 100644
--- a/docs/superpowers/plans/2026-09-29-scroll-content-part1.md
+++ b/docs/superpowers/plans/2026-09-29-scroll-content-part1.md
@@ -2,8 +2,48 @@
This half of the Scroll-Based sheet decides, page by page, how the first thirteen Scroll-Based pages (home-page order, 01.01 Parallax Depth-of-Field to 01.13 Stagger Reveal) present their kind, step 1, settings, words and prompt on the guided-steps page. Part 2 (`2026-09-29-scroll-content-part2.md`) covers Horizontal Scroll to Scroll-Driven Background Color; this half follows its category rules wherever the two meet, so the 26 pages come out alike. The conversion tasks of `2026-09-29-demo-page-rollout-parallel.md` follow each section exactly, together with "How to convert a page" in `2026-09-28-demo-page-rollout-text-typography.md`, the rollout's Global Constraints, and the markup for pages without settings and scroll pages in `2026-09-29-demo-page-kinds-do-and-scroll.md`. Rotate In (`animations/02-entrance-and-exit/rotate-in/`) is the reference for everything a section does not mention; the do-it/scroll plan's scratch scroll page is the reference for a scroll page's step 1 and its scroller attributes.
+Fix round 1 (2026-09-29) is applied: the owner's decisions and the category rules shared with part 2 follow, word for word as in part 2, and every section below follows them. Where a section and a shared rule seem to differ, the shared rule wins.
+
All thirteen are scroll pages. Parallax Depth-of-Field, ScrollTrigger Animation, Pin Animation and Scrollytelling have no settings, so they have no Try it step.
+## Owner decisions (all accepted, 2026-09-29)
+
+These decisions and the category rules below read the same in part 1 and part 2.
+
+1. Parallax Depth-of-Field, Scrollytelling (part 1) and Horizontal Scroll (part 2) have no Try it step.
+2. Snap Scrolling: Play glides through without snapping; snapping shows when the visitor scrolls, and the help line says so.
+3. Both parallax pages: the drawing stretches to fill the wide box (`preserveAspectRatio="none"`) instead of cropping the front layer.
+4. Cover Card: a short closing line fills the empty space at the end (steady scroll length kept).
+5. Stacking Cards: the big faded number becomes an absolutely placed background watermark (`aria-hidden`), so 7 cards fit.
+6. Stacking Cards: the decorative card button reads "View project →".
+7. The player's "Back to top" and the footer's "Back to top ↑" both stay as they are.
+8. Smooth (Inertia) Scroll is a do-it page: step 1 "Scroll it", with Show me and Reset (no Play / Back to top). Its step-1 help line ends ", or press Show me." (every do-it page does).
+9. Smooth Scroll's glide mode answers keys: arrows ±40px, PageUp/PageDown/Space 90% of the box, Home/End 0/maxScroll (a `keydown` handler on the viewport in glide mode that moves the glide target).
+10. Smooth Scroll's "Normal scrolling" switch stays out of the copied prompt (`data-hb-skip`).
+11. Scroll Velocity Skew shows 28 rows.
+12. Text Fill's paragraph is cut from 80 to 48 words.
+13. Text Fill's unread words are a readable grey (about 4.8:1).
+14. Background Color's text is pure white or black, flipping where both read equally (Forest flips too — say so wherever the sheet mentions only Daylight).
+15. Scrollspy's menu links may be 36px tall on short laptop screens so the whole menu fits; touch screens keep 44px. Implement as: `@media (min-width:601px) and (max-height:640px) and (pointer:fine)` → 36px links (6×36 + 22 + 16 = 254px fits the 258px stage); with a coarse pointer in that range (a phone turned sideways) the links stay 44px and the rail scrolls (`max-height:calc(100% - 32px);overflow-y:auto`), keeping the active link in view by setting the rail's own `scrollTop` — never `scrollIntoView()`, which also scrolls the page.
+
+## Category rules shared with part 2 (same wording in both halves)
+
+1. **Phone rules:** the old mobile block goes, but each page section keeps and names the phone rules its stage still needs (part 1's wording). Part 2 must list them for Sticky Section (`#sticky-inner{grid-template-columns:1fr}#vis-col{display:none}`) and Scrollspy (its strip rules and `.sec{padding:80px 20px 36px}`).
+2. **Focus ring on inner scrollers:** nothing on the page. The coordinator is adding `.hb-page .stage :focus-visible{outline-offset:-3px}` to the shared stylesheet, so everything focusable inside the stage (inner scrollers such as `[data-hb-scroller]`, `.viewport`, `.doc`, flush controls, Snap Scrolling's dots) gets the site ring drawn inset and never clipped. State this as a fact; drop any page-level scroller focus rule and the dots' `right:6px` idea. A stage that is its own scroller keeps the normal ring. A stage control with its own focus look still must beat `body.hb :focus-visible` (0,2,1).
+3. **Smallest stage:** measure fits at the smallest shared stage too — 258px inside at 1280×590 (the shared stage drops to 260px on short screens) — as well as 327px (laptop) and the phone sizes. Overlays such as rails and dots must fit it.
+4. **Trigger lines:** every trigger-line choice must be reachable within the box's scroll distance at every size, from the tallest box to a narrow window just over 600px (part 1: Reveal on Scroll, Stagger Reveal, ScrollTrigger Animation — check and state it).
+5. **`container-type:size`:** only on a scroller whose height comes from outside (the stage, or `height:100%` of it); never together with `hb-grow`; never padding on that scroller (cqh measures its content box); any `cqh` use needs that container (without one it falls back to the viewport). No `--box-h` script fallback.
+6. **Play stops on input:** the shared script stops Play on any trusted input anywhere inside the stage (pointer, wheel, touch, key). Sections state it as a fact; no page works around it (part 2's Scrollspy "blocker" line becomes a plain statement).
+7. **Snapping during Play:** the shared script turns CSS scroll snapping off on the scroller while Play runs — it saves the scroller's inline `scroll-snap-type`, sets it to `none`, and restores the saved inline value when the run ends, is stopped, or Back to top is pressed (it does nothing when snapping is already off). So no page sets `scroll-snap-type` inline: Snap Scrolling's Snapping setting sets an attribute (e.g. `data-snap="mandatory|proximity|off"` with three CSS rules). When a wheel turn stops Play, snapping returns and the box settles on the nearest point by itself.
+8. **Instant jumps:** Back to top, and Play restarting from the top, are instant jumps. Say so wherever an effect reads scroll speed or eases toward the scroll position; Velocity Skew ignores the frame after a jump (listen for clicks on `#btn-top` / `#btn-scroll`, by id) and measures speed per 1/60 s, so 120 Hz screens lean the same.
+9. **Small stage text:** paragraph text in the stage is at least 14px; small labels (chips, ticks, captions, buttons) at least 11px. Part 1: `.chip-name`, `.card-sub`, `.card-btn`, `.dir` grow to 11px. Part 2: Smooth Scroll's `.card-body` and Background Color's `p` go to 14px.
+10. **Text that changes every frame** (counters, depth numbers, frame counts): `role="img"` plus an `aria-label` with the real value, or `aria-hidden="true"` when it only repeats something else on the stage; never a live region (part 1: Scrollytelling's `#depth-num`, Scrub Animation's frame count and `.dir`).
+11. **Small SVG labels:** counter-scale them to screen size (part 2's SVG Line Draw approach), or hide them on phones only where something visible repeats them (part 1's Scrub Animation `.mark-label`: the ticks repeat 0–100%).
+12. **Decorative duplicates** (big numbers, repeated titles, picture SVGs) are `aria-hidden="true"` (part 1: Pin Animation's phone drawing, Stacking Cards' watermark).
+13. **No `h1`/`h2` inside the stage:** the page outline belongs to the step titles. Use `p` (or `h3` for a real sub-heading). Part 1: Cover Card's `<h1 class="cover-title">` becomes `<p class="cover-title">` keeping `.cover-title`'s own sizing (the shared `.hb-page h1` rule restyles any stage h1 — Critical); Pin Animation's intro/outro `h2` and Cover Card's article `h2`s.
+14. **Cue lines:** sentence case, centred, with side padding (`text-align:center;padding:0 24px`) — part 1's ScrollTrigger run-out cue included.
+15. **Unchanged shared rules** stay identical in both halves: accent, category line, "Scroll it" and its help lines, Play · Back to top, scroller attributes, `--ui-muted:#8a8a92`, no `hb-dots`, Feel names from Entrance & Exit, the no-settings format, and the Try it help line "Change a setting, then scroll again or press Play." (do-it pages: "Change a setting, then try it again or press Show me.").
+
## Owner decisions and lessons that apply here
- **Stage text uses the site font.** None of these effects is about typing, so every `font-family` on stage text goes (`var(--disp)`, `var(--mono)`, `serif`, `monospace`, and the `font-family` attribute on SVG text), and so do the `@font-face` lines. The site font is loaded upright only, so italics on the stage go too, as on the Text & Typography stages.
@@ -12,8 +52,8 @@ All thirteen are scroll pages. Parallax Depth-of-Field, ScrollTrigger Animation,
- **Long names in the top bar** (ScrollTrigger Animation, Fly-in Fly-out Contact List, Cover Card to Fixed Header, Reverse-Scrolling Columns) are cut with "…" by the shared stylesheet; the pages do nothing.
- **Lessons from the Text & Typography reviews** that apply here:
- The page reaches the player controls by their ids (`btn-scroll`, `btn-top`), never by their `data-hb-*` attributes. Only Reveal on Scroll and Stagger Reveal listen to them. No page here needs `hb:pause` or `hb:input`.
- - Text whose layout the script measures is measured again after `document.fonts.ready` (Reverse-Scrolling Columns, as today; Cover Card to Fixed Header; ScrollTrigger Animation).
- - Nothing here is typed text, and no text is split into letters.
+ - Text whose layout the script measures is measured again after `document.fonts.ready` (Reverse-Scrolling Columns, as today; Cover Card to Fixed Header; ScrollTrigger Animation; Scrub Animation, whose drawing size depends on the panel's text).
+ - Nothing here is typed text, and no text is split into letters. Text that changes every frame follows shared rule 10: Scrollytelling's depth and Scrub Animation's frame count.
## Rules for the whole category (as in part 2)
@@ -21,22 +61,23 @@ All thirteen are scroll pages. Parallax Depth-of-Field, ScrollTrigger Animation,
- **Step 1** is titled "Scroll it". Its default help line is "Scroll inside the box, or press Play and it scrolls for you." A section gives a page-specific line where it helps.
- **Player bar of a scroll page:** the Play button and then the Back to top button, exactly as in the do-it/scroll plan, and nothing else (no Slow motion, Replay, Loop or Pause).
- **Try it help line of a scroll page:** "Change a setting, then scroll again or press Play.", the fixed line for the kind; no page has its own. Most settings here redraw the box at once, where it is; the section says when a change waits for the next scroll.
-- **The scroller** is the `.stage` itself on eleven pages. On Snap Scrolling and Reveal on Scroll an overlay (the dots, the trigger line) sits beside the scroller so it does not scroll away: there the `.stage` does the job of today's `.stage-wrap` and holds an inner scroller marked `data-hb-scroller` plus the overlay, as on part 2's Progress Bar and Scrollspy Navigation. Every scroller gets:
+- **The scroller** is the `.stage` itself on eleven pages. On Snap Scrolling and Reveal on Scroll an overlay (the dots, the trigger line) sits beside the scroller so it does not scroll away: there the `.stage` does the job of today's `.stage-wrap` and holds an inner scroller marked `data-hb-scroller` plus the overlay, as on part 2's Progress Bar and Scrollspy Navigation. Its focus ring comes from the shared stylesheet (shared rule 2); the page adds nothing. Every scroller gets:
- `tabindex="0" role="region"` and an `aria-label` (each section gives it), so keyboard users can focus it and scroll it with the arrow keys;
- `overflow-y:auto` (was `scroll`), keeping today's hidden scrollbar (`scrollbar-width:none` and the `::-webkit-scrollbar{display:none}` rule);
- `position:relative`, so the `offsetTop` of anything inside it is measured from its own top (Fly-in Fly-out Contact List and Pin Animation read `offsetTop` and have it today).
- The old stage's `flex`, `min-width`, `width`, `height`, `border` and `border-radius` go; the page owns them.
-- **Stage height:** every page takes the shared stage height (300–440px on computers and tablets, 260–327px on short laptops, 300px on phones; 378px inside the border at 1280×800, 325px at 1366×657 and 298px on phones). No page sets `--hb-stage-h` or `--hb-stage-h-phone`, and none uses `hb-grow` (no page takes typed text). The old `--stage-h` (600–640px, and 480–560px on phones), its phone overrides and the old fixed stage heights go.
-- **What was sized in stage heights inside the box** is sized in the scroller's own height, as in part 2: the scroller gets `container-type:size`, and `var(--stage-h)` (or the old stage height written in pixels) becomes `100cqh`, so `calc(var(--stage-h) * 4)` becomes `400cqh`. A pinned part stays exactly one box tall at every stage height, and the scene keeps today's proportions to its box. Measured in headless Chrome on Parallax Depth-of-Field, Stacking Cards (including its CSS scroll timeline) and ScrollTrigger Animation: the same pictures and scroll lengths as sizing with a pixel value. Pages that size nothing from the stage (Fly-in Fly-out Contact List, Reveal on Scroll, Stagger Reveal) leave `container-type` off.
-- **Every effect follows the scroller's `scroll` event**, an IntersectionObserver rooted on it, or a CSS scroll timeline, so it answers Play, Back to top, the wheel, touch and keys alike. No page reads the wheel itself. Snap Scrolling is the one page where Play looks different from a hand scroll; its section says why.
+- **Stage height:** every page takes the shared stage height (300–440px on computers and tablets, 260–327px on short laptops, 300px on phones; 378px inside the border at 1280×800, 325px at 1366×657, 258px at 1280×590 and 298px on phones). No page sets `--hb-stage-h` or `--hb-stage-h-phone`, and none uses `hb-grow` (no page takes typed text). The old `--stage-h` (600–640px, and 480–560px on phones), its phone overrides and the old fixed stage heights go. Each section's fits were measured from the 258px box to the 438px box of a tablet and a 610px-wide window, and on 375px and 320px phones (shared rule 3).
+- **What was sized in stage heights inside the box** is sized in the scroller's own height, as in part 2 and under shared rule 5: the scroller gets `container-type:size`, and `var(--stage-h)` (or the old stage height written in pixels) becomes `100cqh`, so `calc(var(--stage-h) * 4)` becomes `400cqh`. A pinned part stays exactly one box tall at every stage height, and the scene keeps today's proportions to its box. Measured in headless Chrome on Parallax Depth-of-Field, Stacking Cards (including its CSS scroll timeline) and ScrollTrigger Animation: the same pictures and scroll lengths as sizing with a pixel value. No scroller that has `container-type` has padding. Pages that size nothing from the stage (Fly-in Fly-out Contact List, Reveal on Scroll, Stagger Reveal) leave `container-type` off.
+- **Every effect follows the scroller's `scroll` event**, an IntersectionObserver rooted on it, or a CSS scroll timeline, so it answers Play, Back to top, the wheel, touch and keys alike. No page reads the wheel itself or scroll speed. Any trusted input inside the stage stops Play (shared rule 6). While Play runs, the shared script turns snapping off (shared rule 7), so Snap Scrolling's Play glides through its sections. Back to top, and Play restarting from the top, jump at once (shared rule 8); the two pages that ease toward the scroll position (Parallax Depth-of-Field and Cover Card to Fixed Header) say so.
- **`:root`** keeps `--ui-accent:#6ea8ff` and the variables the stage rules still use. `--stage-h`, `--disp` and `--mono` go, and `--ui-muted` becomes `#8a8a92` wherever stage text uses it (the old `#77777e` is 4.4:1 on `#0b0b0d` and 4.2:1 on the cards' `#111114`; the new grey is 5.5:1 or more). Stage text faded with `opacity` below 4.5:1 is fixed in its section.
-- **Small stage text** under 11px (8–10px labels in the old monospace font) grows to the size each section gives, so it stays readable in the site font.
+- **Small stage text** follows shared rule 9: paragraph text at least 14px, labels at least 11px (the old 8–10px labels were drawn in the monospace font). Each section gives the new sizes.
- **`hb-dots`** is left off on every page: the dots would stay still while the content scrolls over them.
- **Stage text shows no code.** Where a stage shows code or code names today (the cover card's code block, card texts such as "opacity 0 → 1", chips such as "IntersectionObserver"), the section gives plain replacement text.
-- **Removed on every page:** the aside with its note, its readouts and its Reset, Reset scroll, Reset playhead, Replay or Return to surface button (Back to top and Play replace them), the old `header`, `.layout`, the `.ah-bar` and its Copy source script, and the old mobile block (a section keeps any phone rule the stage still needs).
+- **Removed on every page:** the aside with its note, its readouts and its Reset, Reset scroll, Reset playhead, Replay or Return to surface button (Back to top and Play replace them), the old `header`, `.layout`, the `.ah-bar` and its Copy source script, and the old mobile block. Each section names the phone rules its stage keeps (shared rule 1); a section that names none keeps none.
- **Pages without settings** follow the do-it/scroll plan's Task 1: no Try it step, steps numbered 1 (Scroll it) and 2 (Copy the prompt), the `hb-chips` markup kept, a prompt without "Match the settings listed below.", a Copy prompt hint without "Your settings are added at the end." (the section gives it), and a README Key parameters table of the technique's own values, in plain words (no backticks: the page checks forbid code there).
- **Stage class names:** no element on a stage uses the class `seg` or `swatches` (the shared stylesheet styles them for Try it). None does today.
-- **The page checks forbid the words "Read more"** anywhere on a page, so Stacking Cards' card button gets another label.
+- **The page checks forbid the words "Read more"** anywhere on a page, so Stacking Cards' card button reads "View project →" (owner decision 6).
+- **Headings, decorations and cues on the stage:** no stage keeps an `h1` or `h2` (shared rule 13); picture SVGs and decorative duplicates are `aria-hidden="true"` (shared rule 12); closing cue lines use the cue style, sentence case and centred (shared rule 14): 13px `#8a8a92`, `letter-spacing:.1em`, `text-align:center;padding:0 24px`.
## How to read a section
@@ -55,17 +96,18 @@ All thirteen are scroll pages. Parallax Depth-of-Field, ScrollTrigger Animation,
- **Description:** Layers move at their own speed as the focus shifts. Best for cinematic intros.
- **Step 1:** Scroll it · help line: default
- **Player bar:** Play · Back to top
-- **Try it:** none. The demo's only control, the Focal Plane slider, is not a setting: it moves the same 0–1 value that scrolling moves (a second way to scrub, like Scrub Animation's Seek slider), and the next scroll overwrites it. The page has steps 1 and 2. (A decision to confirm.)
+- **Try it:** none (owner decision 1). The demo's only control, the Focal Plane slider, is not a setting: it moves the same 0–1 value that scrolling moves (a second way to scrub, like Scrub Animation's Seek slider), and the next scroll overwrites it. The page has steps 1 and 2.
- **Scroller:** the stage.
-- **What scrolling shows:** a night landscape of five layers (sky, far peaks, mountains, hills, the ridge in front) held still in the box. As the box scrolls, each layer sinks by an amount that grows with its nearness, and the one sharp layer moves from the sky at the top to the ridge at the end; every other layer blurs by how far it sits from the sharp one. The layers ease toward the scroll position, so a wheel's jumps turn into a glide. Scrolling back reverses it.
+- **What scrolling shows:** a night landscape of five layers (sky, far peaks, mountains, hills, the ridge in front) held still in the box. As the box scrolls, each layer sinks by an amount that grows with its nearness, and the one sharp layer moves from the sky at the top to the ridge at the end; every other layer blurs by how far it sits from the sharp one. The layers ease toward the scroll position, so a wheel's jumps turn into a glide. Scrolling back reverses it. Back to top, and Play restarting from the top, jump the box at once; the layers then ease back over a moment, as after a wheel jump.
- **Scroll distance and Play:** `.scene` 400cqh with the sticky `.pinned` 100cqh: three box heights of scrolling (1,134px at 1280×800, 894px on a phone). Play racks the focus from far to near in six seconds.
- **Reduced motion:** nothing scrolls by itself. As today, the layers never move (the page's `reduced` flag keeps their offset at 0) and scrolling only moves the focus, without easing. The CSS rule `.layer{will-change:auto}` stays.
- **Stage font:** no text on the stage.
- **Stage:**
- `.stage`: `position:relative;overflow-y:auto;scrollbar-width:none;container-type:size;background:#0b0b0d`, with `aria-label="Mountain layers that move and blur as you scroll"`.
- `.scene{height:400cqh}`; `.pinned{position:sticky;top:0;height:100cqh;overflow:hidden}` (were `calc(var(--stage-h) * 4)` and `var(--stage-h)`).
- - The five SVG layers stay as they are (measured: the scene fills the wide laptop box and the phone box).
- - Script: the slider, its `input` listener and the `manual` flag go; `onScroll()` runs on every `scroll` event. `render()` keeps the blur and offset writes; its readout lines (`VALUES`, `ROWS`, the progress and focal texts) go. `measure()` stays (blur 14px, travel 120px; 8px and 60px up to 600px wide).
+ - The five layer SVGs get `preserveAspectRatio="none"` (was `xMidYMid slice`), as on Parallax Scrolling (owner decision 3), and `aria-hidden="true"`. The scene is drawn for a 3:2 box; in the new box, about 2.5:1 on laptops, `slice` crops it, and at the end of the focus pull the sharp front ridge shows only 30–45px at 1280×800 and a few tips at 1366×657. Stretched to fill, every layer shows at every size (measured, 258–438px boxes and phones); the hills look a little flatter on wide screens.
+ - The layers' travel becomes a share of the box: `measure()` sets `MAX_OFFSET = stage.clientHeight * 0.19`, and `* 0.125` up to 600px wide (today 120px of a 620px stage and 60px of a 480px one): 72px at 1280×800, 49px in the 258px box of a 1280×590 window, 83px in a 438px box and 37px on phones. Each layer still sinks its own share of it (sky 0, far peaks 10%, mountains 25%, hills 45%, front ridge 70%). The blur stays 14px (8px up to 600px wide).
+ - Script: the slider, its `input` listener and the `manual` flag go; `onScroll()` runs on every `scroll` event. `render()` keeps the blur and offset writes; its readout lines (`VALUES`, `ROWS`, the progress and focal texts) go. `measure()` keeps its resize listener, with the travel above.
- `hb-dots`: no. Default height.
- **Removed:**
- The note, and the Scroll Progress and Blur readouts.
@@ -86,7 +128,7 @@ All thirteen are scroll pages. Parallax Depth-of-Field, ScrollTrigger Animation,
|-----------|---------|--------|
| Focus | Follows the scroll | Sharp on the sky at the top of the scroll and on the front ridge at the end; each layer blurs by its distance from it |
| Strongest blur | 14px (8px on phones) | The blur of a layer as far from the focus as a layer can be |
- | Layer travel | Up to 120px (60px on phones) | How far the front ridge sinks over the whole scroll; farther layers sink less, and the sky not at all |
+ | Layer travel | 19% of the box's height (12.5% on phones) | What the layers' sinking is measured against: over the whole scroll the front ridge sinks 70% of it, the hills 45%, the mountains 25%, the far peaks 10% and the sky not at all |
| Easing | 14% a frame | How much of the remaining distance the layers cover each frame; lower is smoother but lags more |
| Pinned scene | Three box heights of scrolling | How much scrolling the whole focus pull takes |
@@ -114,7 +156,7 @@ All thirteen are scroll pages. Parallax Depth-of-Field, ScrollTrigger Animation,
- **Stage:**
- `.stage`: `position:relative;overflow-y:auto;scrollbar-width:none;container-type:size;background:#0b0b0d`, with `aria-label="A landscape in four layers that move at different speeds"`.
- `.scene{height:300cqh}` (1800px in a 600px stage today); `.layers{position:sticky;top:0;height:100cqh;overflow:hidden;background:#0a1628}`; `.layer{height:100%}`. The phone rule that set 400px goes.
- - The four layer SVGs get `preserveAspectRatio="none"` (was `xMidYMid slice`). The scene is drawn for a 4:3 box, and the new box is about 2.5:1 on laptops: `slice` crops the grass layer out of view there, so the layer that moves most never shows (measured). Stretched to fill, every layer shows at every size; the hills look a little flatter on wide screens.
+ - The four layer SVGs get `preserveAspectRatio="none"` (was `xMidYMid slice`; owner decision 3) and `aria-hidden="true"`. The scene is drawn for a 4:3 box, and the new box is about 2.5:1 on laptops: `slice` crops the grass layer out of view there, so the layer that moves most never shows (measured). Stretched to fill, every layer shows at every size; the hills look a little flatter on wide screens.
- The travel at 100% speed becomes a quarter of the box's height (`MAX_PARALLAX = stage.clientHeight / 4` in `update()`; 150px of a 600px stage today, 95px at 1280×800), so the grass still leaves the box exactly at the end of the scroll.
- `update()` keeps the offsets; its readout lines (progress and the four offsets) go.
- `hb-dots`: no. Default height.
@@ -168,14 +210,15 @@ None: leave out the `details.hb-options` block.
- **Step 1:** Scroll it · help line: default
- **Player bar:** Play · Back to top
- **Scroller:** the stage.
-- **What scrolling shows:** three columns of project cards held still in the box. As the box scrolls, the middle column's cards travel up with the scroll and the side columns' cards travel down, so they seem to flow against it. Each column holds two copies of its twelve cards and wraps around, so none ever runs out. Under 600px wide the right column is hidden, as today.
+- **What scrolling shows:** three columns of project cards held still in the box. As the box scrolls, the middle column's cards travel up with the scroll and the side columns' cards travel down, so they seem to flow against it. Each column holds two copies of its twelve cards and wraps around, so none ever runs out, whichever way the side columns go (see Stage). Under 600px wide the right column is hidden, as today.
- **Scroll distance and Play:** `.scene` 320cqh (2000px in a 620px stage today) with the sticky `.columns` 100cqh: 2.2 box heights of scrolling (832px at 1280×800, 656px on a phone). Play moves the columns at about 140px a second (110px on phones).
- **Reduced motion:** nothing scrolls by itself. As today, the columns stay still (`update()` returns early), so the box scrolls without moving them. The CSS rule `.col-inner{will-change:auto}` stays.
- **Stage font:** site font. `.card-label` becomes 13px (was 11px) and `.card-meta` 12px `var(--ui-muted)` (was 10px).
- **Stage:**
- `.stage`: `position:relative;overflow-y:auto;scrollbar-width:none;container-type:size;background:#0b0b0d`, with `aria-label="Three columns of project cards"`.
- `.scene{height:320cqh}`; `.columns{position:sticky;top:0;height:100cqh}` (with its flex, gap, padding and overflow). The phone rules that set 480px go; `.col-right{display:none}` under 600px stays.
- - `measure()` stays, with its re-measure on `document.fonts.ready` and `resize` (the loop period depends on the card height).
+ - `measure()` stays, with its re-measure on `document.fonts.ready` and `resize` (the loop period depends on the card height). It pre-offsets the side columns by one set (`marginTop = -singleSetH`) only while they move down (`mult < 0`); when they move up (`mult >= 0`) it sets their `marginTop` to 0. Today it always pre-offsets them, which only suits moving down: with Same way the side columns run out of cards, leaving up to 334px of empty column on a laptop (review measurement). With the change there is no gap at any speed in either direction, at any size (measured, 258–438px boxes and phones).
+ - The card icons' `svg` in `makeSet()` get `aria-hidden="true"` (shared rule 12).
- `update()` keeps the three transforms; its readout lines (progress and the three offsets) go.
- `hb-dots`: no. Default height.
@@ -183,7 +226,7 @@ None: leave out the `details.hb-options` block.
| Setting | Control | Choices or range (value shown) | Default | Hint | Sets in the demo |
|---|---|---|---|---|---|
-| Side columns go | Choice buttons | Opposite way · Same way | Opposite way | Same way shows the plain scroll, for comparison. | the sign of `mult`: −1 / +1, times Side column speed; then `update()` |
+| Side columns go | Choice buttons | Opposite way · Same way | Opposite way | Same way shows the plain scroll, for comparison. | the sign of `mult`: −1 / +1, times Side column speed; then `measure()` (which sets the side columns' `marginTop` for the direction) and `update()` |
| Side column speed | Choice buttons | Slower · Same · Faster | Same | Their speed compared with the middle column. | the size of `mult`: 0.5 / 1 / 1.5, with the sign from Side columns go; then `update()` |
**More options**
@@ -213,7 +256,7 @@ None: leave out the `details.hb-options` block.
- **README See also:**
- [Parallax Scrolling](../parallax-scrolling/) — layers move at different speeds as you scroll
- [Parallax Depth-of-Field](../parallax-depth-of-field/) — layers move and blur as the focus shifts
-- **README How it works:** unchanged
+- **README How it works:** in the snippet, the comment `// (margin-top pre-offsets them by -singleSetH so there is content above)` becomes `// (moving down, margin-top pre-offsets them by -singleSetH so there is content above; moving up, it is 0)`. The rest is unchanged.
- **README Production notes:** unchanged
- **Category line:** `01.03 · Scroll-Based`
- **Pager:** Previous: Parallax Scrolling (`../parallax-scrolling/`) · Next: Cover Card to Fixed Header (`../cover-card-to-fixed-header/`)
@@ -227,17 +270,19 @@ None: leave out the `details.hb-options` block.
- **Step 1:** Scroll it · help line: default
- **Player bar:** Play · Back to top
- **Scroller:** the stage.
-- **What scrolling shows:** an article page whose cover fills most of the box. As the box scrolls, the cover shrinks into a slim bar pinned at the top: the title scales down into the corner, the subtitle and date fade out first, the background dims and blurs, a thin line appears under the bar and the author's name fades into its corner. The article text then scrolls up under the bar. Scrolling back opens the cover again in reverse.
-- **Scroll distance and Play:** the scene is as tall as the full cover plus the article (below): about 1.3 box heights of scrolling at 1280×800 (498px) and 2.4 on a phone (701px). At the default Shrink distance, Play spends about four of its six seconds shrinking the cover (under three on phones) and the rest on the article.
+- **What scrolling shows:** an article page whose cover fills most of the box. As the box scrolls, the cover shrinks into a slim bar pinned at the top: the title scales down into the corner, the subtitle and date fade out first, the background dims and blurs, a thin line appears under the bar and the author's name fades into its corner. The article text then scrolls up under the bar, and a closing line fills the space after it. Scrolling back opens the cover again in reverse. Back to top, and Play restarting from the top, jump the box at once; the cover then eases open over a moment, as after a wheel jump.
+- **Scroll distance and Play:** the scene is as tall as the full cover plus the article (below): about 1.3 box heights of scrolling at 1280×800 (498px) and 2.4 on a phone (701px). At the default Shrink distance, Play spends about four of its six seconds shrinking the cover (under three on phones), then scrolls the article up and ends on the closing line, with the article's last line or so above it (15px of it at 1280×800, none in the 258px box).
- **Reduced motion:** nothing scrolls by itself. As today, the cover snaps between tall and slim at half the Shrink distance, with no easing (`snaps()` is true under reduced motion). The CSS rule for `will-change` stays.
- **Stage font:** site font (the stage text only inherited the old body font). The blockquote drops its italic.
- **Stage:**
- `.stage`: `position:relative;overflow-y:auto;scrollbar-width:none;overflow-anchor:none;container-type:size;background:#0b0b0d`, with `aria-label="An article with a tall cover"`. `overflow-anchor:none` stays (without it the shrinking cover fights the scroll).
- - The cover's full height becomes 85% of the box: `.cover{height:85cqh}` in the CSS, and `measure()` sets `FULL = Math.round(stage.clientHeight * 0.85)` (530px of a 620px stage today), so the whole cover shows on arrival: 321px at 1280×800, 276px at 1366×657, 253px on phones (measured: its text needs 117–135px). `--cover-full` goes; `--cover-min` stays (56px, 64px under 600px).
- - The scene's `min-height:2500px` goes. Today it leaves about 1,700px of empty box after the article, so Play would spend most of its six seconds on nothing. `measure()` sets `scene.style.minHeight = Math.max(FULL + article.offsetHeight, stage.clientHeight + 440) + 'px'`, so the box scrolls far enough to finish the longest shrink, its scroll length does not change while the cover shrinks, and it ends on the last paragraph. `measure()` also runs after `document.fonts.ready` (the article's height depends on the font).
+ - The cover's full height becomes 85% of the box: `.cover{height:85cqh}` in the CSS, and `measure()` sets `FULL = Math.round(stage.clientHeight * 0.85)` (530px of a 620px stage today), so the whole cover shows on arrival: 321px at 1280×800, 276px at 1366×657, 219px at 1280×590 and 253px on phones (measured: its text, with its margins and padding, needs 171px there and 192px on phones). `--cover-full` goes; `--cover-min` stays (56px, 64px under 600px).
+ - The scene's `min-height:2500px` goes. Today it leaves about 1,700px of empty box after the article, so Play would spend most of its six seconds on nothing. `measure()` sets `scene.style.minHeight = Math.max(FULL + article.offsetHeight, stage.clientHeight + 440) + 'px'`, so the box scrolls far enough to finish the longest shrink and its scroll length does not change while the cover shrinks. At every measured size the first term wins, so once the cover is slim, `FULL − MIN` of box is left empty after the article: 265px at 1280×800, 163px at 1280×590, 189px on phones. `measure()` also runs after `document.fonts.ready` (the article's height depends on the font).
+ - A closing line fills that space (owner decision 4): `<p class="end-cue">The end · scroll back up and the cover opens again</p>`, the last child of `.scene`, with `position:absolute;left:0;right:0;bottom:0;margin:0;display:flex;align-items:center;justify-content:center` and the cue style (shared rule 14: 13px `#8a8a92`, `letter-spacing:.1em`, `text-align:center;padding:0 24px`). `measure()` sets its height to `FULL − MIN` (`.scene` is already `position:relative`).
+ - The cover's title becomes `<p class="cover-title" id="cover-title">` (was an `h1`, shared rule 13): the shared rule `.hb-page h1` would restyle it at 64px. `.cover-title` keeps its own look (26px, `#d1f7d6`, `line-height:1.2`, `letter-spacing:-.5px`, `margin-bottom:8px`, `transform-origin:left top`). Measured: when the cover is slim, the title's two lines scale to half size and sit 22–53px down the 56px bar (64px on phones).
- The code shown on the cover (`.cover-code`) goes, with its line in `render()` (`coverCode.style.opacity`).
- - Text on the cover: the subtitle becomes "Why a tall cover can fold into a slim bar as you read" (was "How browsers render scroll-driven animations at 60fps"); "Article · 8 min read", the title and "Matin M. · May 2026" stay. `.cover-meta` and `.author-name` become 11px (were 10px), `.cover-sub` 13px (was 12px), and all three use `#5fa577` (was `#3d7a52`, 3.1:1 on the cover's green; the new green is 5.3:1).
- - The article is rewritten in plain words (today's text speaks of compositors, easing curves and the removed slider), with `.article-body p` at 14px (was 12px), `h2` 12px (was 11px) and the blockquote 15px (was 13px). In order:
+ - Text on the cover: the subtitle becomes "Why a tall cover can fold into a slim bar as you read" (was "How browsers render scroll-driven animations at 60fps"); "Article · 8 min read", the title and "Matin M. · May 2026" stay. `.cover-meta`, `.author-name` and `.chip-name` become 11px (were 10px) and `.cover-sub` 14px (was 12px). `.cover-meta`, `.cover-sub` and `.author-name` use `#5fa577` (was `#3d7a52`, 3.1:1 on the cover's green; the new green is 5.3:1); `.chip-name` keeps `#d1f7d6`.
+ - The article is rewritten in plain words (today's text speaks of compositors, easing curves and the removed slider), with `.article-body p` at 14px (was 12px), the headings 12px (was 11px) and the blockquote 15px (was 13px). Its three headings become `h3` (were `h2`, shared rule 13), so the `.article-body h2` rule becomes `.article-body h3`. In order:
| Part | Text |
|---|---|
@@ -316,6 +361,9 @@ None: leave out the `details.hb-options` block.
- **Stage:**
- `.stage`: `position:relative;overflow-y:auto;scrollbar-width:none;background:#0b0b0d`, with `aria-label="A list of contacts"`.
- The rows and the zone overlay stay; the overlay's labels keep "↑ exit zone" and "↓ entry zone", and the second label's inline style moves into a `.zone-label-end` rule (`position:absolute;bottom:2px`).
+ - Each row's avatar (its initials) gets `aria-hidden="true"` in the row template, because it repeats the name (shared rule 12).
+ - Phone rule kept (under 600px): `.avatar{width:32px;height:32px;font-size:11px}` (its font was 10px).
+ - In the 258px box of a 1280×590 window each band is 64px and two whole rows fit between them (measured).
- `update()` keeps the row styling; its Scroll and Visible rows readout lines go (`applyRow()` still returns whether the row is in view, unused).
- `hb-dots`: no. Default height.
@@ -323,7 +371,7 @@ None: leave out the `details.hb-options` block.
| Setting | Control | Choices or range (value shown) | Default | Hint | Sets in the demo |
|---|---|---|---|---|---|
-| Effect | Choice buttons | Move, fade, shrink · Move only · Fade only | Move, fade, shrink | Together the three read as smooth, physical motion. | `mode`: `'all'` / `'translate'` / `'fade'`, then `update()`; also shows How far rows move except with Fade only, and How much rows shrink only with Move, fade, shrink |
+| Effect | Choice buttons | All three · Move only · Fade only | All three | All three moves, fades and shrinks each row together. | `mode`: `'all'` / `'translate'` / `'fade'`, then `update()`; also shows How far rows move except with Fade only, and How much rows shrink only with All three |
| Edge zone size | Choice buttons | Small · Medium · Large | Medium | How close to the edge a row starts to fly out. | `Z`: 0.15 / 0.25 / 0.35, then `updateOverlay()` and `update()` |
| How far rows move | Choice buttons; shown only when Effect is not Fade only | Short · Medium · Far | Medium | The distance a row slides as it leaves. | `DIST`: 20 / 40 / 70 (px), then `update()` |
@@ -331,7 +379,7 @@ None: leave out the `details.hb-options` block.
| Setting | Control | Choices or range (value shown) | Default | Hint | Sets in the demo |
|---|---|---|---|---|---|
-| How much rows shrink | Choice buttons; shown only when Effect is Move, fade, shrink | A little · Medium · A lot | Medium | The size a row shrinks to at the edge. | `SCALE`: 0.97 / 0.94 / 0.88, then `update()` |
+| How much rows shrink | Choice buttons; shown only when Effect is All three | A little · Medium · A lot | Medium | The size a row shrinks to at the edge. | `SCALE`: 0.97 / 0.94 / 0.88, then `update()` |
| Shows the zones | Switch | on / off | off | Tints the two bands where rows fly in and out. | the zone overlay's `visible` class on / off |
- **Removed:**
@@ -353,7 +401,7 @@ None: leave out the `details.hb-options` block.
| Parameter | Default | Effect |
|-----------|---------|--------|
- | Effect | Move, fade, shrink | Which changes a row makes in the bands: all three together read as physical motion; each alone feels flatter |
+ | Effect | All three | Which changes a row makes in the bands: all three (moving, fading and shrinking) together read as physical motion; moving only or fading only feels flatter |
| Edge zone size | Medium | How tall each band is: small is 15% of the box, medium 25% and large 35% |
| How far rows move | Medium | How far a row slides at the very edge: short is 20px, medium 40px and far 70px |
| How much rows shrink | Medium | The size of a row at the very edge: a little is 97%, medium 94% and a lot 88% |
@@ -378,12 +426,12 @@ None: leave out the `details.hb-options` block.
- **Player bar:** Play · Back to top
- **Scroller:** the stage.
- **What scrolling shows:** white project cards scroll up one after another. Each sticks at the top of the box and the next slides over it, leaving a strip of every card underneath showing, and each covered card shrinks slightly from its top edge, so the pile reads as a deck. At the end the finished deck holds still for a moment. Scrolling back takes the deck apart.
-- **Scroll distance and Play:** a 25cqh lead-in, the cards (each one box tall less the strips), and a 30cqh run-out inside the deck: at five cards about 3.9 box heights at 1280×800 (1,460px) and 3.7 on a phone (1,096px). Play lays a card on the deck about every 1.3 seconds.
+- **Scroll distance and Play:** a 25cqh lead-in, the cards (each one box tall less the strips and a 12px foot), and a 30cqh run-out inside the deck: at five cards about 4 box heights at 1280×800 (1,520px) and 3.9 on a phone (1,155px). Play lays a card on the deck about every 1.3 seconds.
- **Reduced motion:** nothing scrolls by itself. As today, the cards still stack, but covered cards do not shrink (the demo's rule `animation:none!important`, and the fallback's check).
-- **Stage font:** site font. `.card-num` and `.card-title` drop `serif`; `.card-btn` drops `monospace`.
+- **Stage font:** site font. `.card-num` and `.card-title` drop `serif`; `.card-btn` drops `monospace`. `.card-sub` and `.card-btn` become 11px (were 10px) and `.card-body` 14px (was 12px), under shared rule 9.
- **Stage:**
- `.stage`: `position:relative;overflow-y:auto;scrollbar-width:none;container-type:size;background:#0b0b0d`, with `aria-label="A stack of project cards"`.
- - `.spacer{height:25cqh}`, `.run-out{height:30cqh}`, and `.card__content{height:calc(100cqh - 24px - (var(--numcards) - 1) * var(--peek))}` (were in `var(--stage-h)`; measured: the same deck and the same CSS scroll timeline).
+ - `.spacer{height:25cqh}`, `.run-out{height:30cqh}`, and `.card__content{height:calc(100cqh - 12px - (var(--numcards) - 1) * var(--peek))}` (were in `var(--stage-h)`, with a 24px foot; measured: the same deck and the same CSS scroll timeline). The foot under the deepest card becomes 12px, so every card is 12px taller.
- The card text is rewritten as plain project cards (today's cards explain the code). `ALL_CARDS` keeps each card's number, `ac` and `vis`, with this text:
| Card | Title | Kind (sub) | Line (body) |
@@ -396,10 +444,13 @@ None: leave out the `details.hb-options` block.
| 06 | Open Studio | Workshop | Two days of making things by hand. |
| 07 | Tide Tables | App | Daily tides for every beach on the coast. |
- - The card button reads "View project →" (the page checks forbid "Read more").
- - On white: `.card-sub` and `.card-body` drop their opacity and use `#5f5f66` (today about 2.9:1 and 3.9:1; the new grey is 6.3:1). The big faded number stays as it is (decoration, `aria-hidden="true"`).
- - Under 600px wide the card is one column without its coloured half (`.card__visual{display:none}`, `grid-template-columns:1fr;grid-template-rows:1fr`), `.card-num` becomes 36px and `.card__text` gets `gap:6px`, so the text (180px) fits the 218px card (measured). Today's rule `grid-template-rows:1fr 140px` goes: in the 300px box it pushes the coloured half out of the card anyway.
- - Measured on a phone, a card's text needs 180px. Every combination of the settings fits except seven cards with the Large edge, where the card is 154px and its button is cut off at the foot by the card's own `overflow:hidden`; the deck itself always fits the box.
+ - The card button reads "View project →" (owner decision 6; the page checks forbid "Read more").
+ - The big faded number becomes a watermark (owner decision 5): it keeps its 52px size and its opacity .1 but leaves the text column's flow, `.card-num{position:absolute;top:clamp(8px,3cqh,16px);right:clamp(12px,2.5vw,24px);margin:0;line-height:1}` with `.card__text{position:relative}`, and each number gets `aria-hidden="true"` in `buildCards()` (shared rule 12).
+ - `.card__text` padding follows the box's height: `padding:clamp(14px,6cqh,32px) clamp(18px,3vw,32px)` (was `clamp(18px,3vw,32px)` all round; `6cqh` is 6% of the box).
+ - On the shortest cards the one-line text hides, so the title, the kind and the button fit. `measure()` works out a card's height, `stage.clientHeight - 12 - (numCards - 1) * peekPx`, and toggles the class `short` on `#cards` when it is under 170px, with `#cards.short .card-body{display:none}`. `measure()` already runs after `buildCards()`, after a change of Edge that shows and on `resize`. The line hides only with seven cards and the Large edge (in the 258px and 288px boxes of short laptop windows and on phones), and with five cards and the Large edge or seven and Medium in the 258px box.
+ - On white: `.card-sub` and `.card-body` drop their opacity and use `#5f5f66` (today about 2.9:1 and 3.9:1; the new grey is 6.3:1).
+ - Phone rules (under 600px), in place of today's `grid-template-columns:1fr;grid-template-rows:1fr 140px`, which pushes the coloured half out of the 300px box: `.card__content{grid-template-columns:1fr;grid-template-rows:1fr}`, `.card__visual{display:none}` and `.card__text{gap:6px}`.
+ - Measured, all 12 combinations of Number of cards and Edge that shows fit their text at every size: 1280×800, 1366×657, 1280×640, 1280×620, 1280×590, 768×1024, 610×1000 and 375px and 320px phones. The tightest is seven cards with the Large edge in the 258px box: 2px to spare, with its line hidden. No `container-type` is used on the cards (shared rule 5).
- The debug badge goes, with its markup in `buildCards()`.
- Script: the automatic fallback stays (`useJsFallback = !supportsSDCA`); the switch that forced it goes. `update()` keeps the fallback's scale writes; its Scroll and Topmost card lines go.
- `hb-dots`: no. Default height.
@@ -409,7 +460,7 @@ None: leave out the `details.hb-options` block.
| Setting | Control | Choices or range (value shown) | Default | Hint | Sets in the demo |
|---|---|---|---|---|---|
| Edge that shows | Choice buttons | None · Small · Medium · Large | Medium | The strip of each card left showing above the next. | `peekPx` and `--peek`: 0 / 8 / 14 / 20 (px), then `measure()` and `update()` |
-| How much cards shrink | Choice buttons | A little · Medium · A lot | Medium | Covered cards shrink so the deck looks deep. | `scaleStep` and `--scale-step`: 0.05 / 0.10 / 0.16, then `lastScales` reset and `update()` |
+| How much cards shrink | Choice buttons | A little · Medium · A lot | Medium | Covered cards shrink so the deck looks deep. | `scaleStep` and `--scale-step`: 0.05 / 0.10 / 0.12, then `lastScales` reset and `update()` |
**More options**
@@ -437,7 +488,7 @@ None: leave out the `details.hb-options` block.
| Parameter | Default | Effect |
|-----------|---------|--------|
| Edge that shows | Medium | The strip of each card left showing above the next: none, small (8px), medium (14px) or large (20px) |
- | How much cards shrink | Medium | How much smaller each card gets for every card on top of it: a little is 5%, medium 10% and a lot 16% |
+ | How much cards shrink | Medium | How much smaller each card gets for every card on top of it: a little is 5%, medium 10% and a lot 12% |
| Number of cards | 5 | Three, five or seven cards; more make a taller deck and a longer scroll |
- **README See also:**
@@ -445,7 +496,7 @@ None: leave out the `details.hb-options` block.
- [Snap Scrolling](../snap-scrolling/) — the box settles on one section at a time
- [Cover Card to Fixed Header](../cover-card-to-fixed-header/) — a tall cover shrinks into a slim header
- **README How it works:** unchanged
-- **README Production notes:** unchanged
+- **README Production notes:** in the "Size cards to include their own offset" bullet, `stage − 24px − (N−1) × peek` becomes `stage − 12px − (N−1) × peek`. The rest is unchanged.
- **Category line:** `01.06 · Scroll-Based`
- **Pager:** Previous: Fly-in Fly-out Contact List (`../fly-in-fly-out-contact-list/`) · Next: ScrollTrigger Animation (`../scroll-trigger/`)
@@ -472,7 +523,7 @@ None: leave out the `details.hb-options` block.
- `.stage`: `position:relative;overflow-y:auto;scrollbar-width:none;container-type:size;background:#0b0b0d`, with `aria-label="Four scroll zones"`.
- Sizes: `.zone{min-height:90cqh}` (550px in a 620px stage today); `.z3{min-height:200cqh}`; `.pin-card{top:calc(50cqh - 70px)}`; `.run-out{height:100cqh}`.
- Zone labels (`.zone-tag`, 11px, was 9px): "Fades in", "Follows the scroll", "Pinned", "Steps" (were "Fade on Enter", "Scrub", "Pin + Scrub", "Snap").
- - Zone 1: the heading reads "Fades in on arrival" and the text "This text fades in when its zone scrolls into the box, and hides again once the zone has gone." (today's text names onEnter and onLeave).
+ - Zone 1: the heading reads "Fades in on arrival" and the text "This text fades in when its zone scrolls into the box, and hides again once the zone has gone." (today's text names onEnter and onLeave). `.reveal-sub` becomes 14px (was 13px).
- Zone 2: the caption reads "The square turns, grows and changes color as you scroll." The "progress: 0%" readout under the square goes.
- Zone 3: `PIN_STEPS` becomes:
@@ -482,10 +533,11 @@ None: leave out the `details.hb-options` block.
| Step 2 of 3 | Changing | Its text changes as you scroll through the zone. |
| Step 3 of 3 | Let go | Scroll on and the card moves away with the page. |
- `.pin-body` becomes 13px (was 12px).
+ `.pin-body` becomes 14px (was 12px).
- Zone 4: the caption reads "Scroll on to light up the dots, one at a time." The "0 / 5 lit" readout goes.
- The two captions' inline styles move into a `.zone-cap` rule (13px, `var(--ui-muted)`, the zone 2 caption with `margin-bottom:4px`).
- - The run-out reads "That's the end · scroll back up to see each zone again" in part 2's cue style: 13px `#8a8a92` with `letter-spacing:.1em`, keeping its capitals, without the opacity .5 (today 10px at about 2:1).
+ - The run-out reads "That's the end · scroll back up to see each zone again" in the cue style (shared rule 14): sentence case (its `text-transform:uppercase` goes), `text-align:center;padding:0 24px`, 13px `#8a8a92` with `letter-spacing:.1em`, without the opacity .5 (today 10px capitals at about 2:1, left-aligned against the edge on phones).
+ - Every zone's window is reached at every size: after zone 4 the one-box run-out lets zone 4's top rise well past 20% of the box, so all five dots light, and the pinned card's three stages fit inside zone 3's span (shared rule 4). In the 258px box of a 1280×590 window the zones are 232px, zone 2's content 187px, and the pinned card sits 60–196px down the box (measured; phones 80–238px of 298).
- Script: `update()` keeps the zone states, zone 1's class, the square, the card steps and the dots. The pills, the callback log and the progress readout go, with `logEvent()`, `NAMES`, `prevState`, `primed`, `cbEvents` and `EMPTY_LOG`. `measure()` also runs after `document.fonts.ready`.
- `hb-dots`: no. Default height.
- **Removed:**
@@ -519,7 +571,10 @@ None: leave out the `details.hb-options` block.
- "A change of state is a callback. Which one depends on the direction the state moved:" becomes "A change of state is a callback. Which one depends on the direction the state moved (the demo shows them through zone 1, which fades in on enter and hides on leave):".
- In that snippet, `log(ev); prev[i] = s;` becomes `prev[i] = s; // run the zone's enter or leave animation for ev`.
- The rest is unchanged.
-- **README Production notes:** unchanged
+- **README Production notes:** two bullets lose the removed log and readout:
+ - "**Prime the state before logging callbacks.** Comparing the first frame's state against a `null` starting value manufactures events that never happened: this log opened claiming zone 1 had fired `onEnterBack` and zones 2–4 `onLeaveBack`, before any scrolling." becomes "**Prime the state before firing callbacks.** Comparing the first frame's state against a `null` starting value manufactures events that never happened: zone 1 would fire `onEnterBack` and zones 2–4 `onLeaveBack` before any scrolling." Its last sentence stays.
+ - In "**Leave a run-out after the last trigger.**", "— the snap dots here were stuck at 0/5 forever." becomes "— without it, the dots in zone 4 could never all light up."
+ - The rest is unchanged.
- **Category line:** `01.07 · Scroll-Based`
- **Pager:** Previous: Stacking Cards (`../stacking-cards/`) · Next: Scrub Animation (`../scrub-animation/`)
@@ -535,13 +590,14 @@ None: leave out the `details.hb-options` block.
- **What scrolling shows:** a dashed flight route with marks at 0, 25, 50, 75 and 100%, held still in the box above a small player panel. As the box scrolls, the plane flies along the route, turning with it, the route behind it fills in, the marks it has passed light up, and the panel's bar fills with a frame count from 000 to 120. Scrolling back flies it back; the panel's label reads Forward, Backward or Still.
- **Scroll distance and Play:** `.track` 300cqh with the sticky `.pinned` 100cqh: two box heights of scrolling (756px at 1280×800, 596px on a phone). Play flies the whole route in six seconds.
- **Reduced motion:** nothing scrolls by itself. As today, the glow round the plane is hidden (`.halo{display:none}`) and the plane still follows the visitor's own scrolling.
-- **Stage font:** site font. `.frame` drops `var(--disp)`, and `.frame span` and `.mark-label` drop `var(--mono)`.
+- **Stage font:** site font. `.frame` drops `var(--disp)`, and `.frame span` and `.mark-label` drop `var(--mono)`. `.dir` becomes 11px (was 10px).
- **Stage:**
- `.stage`: `position:relative;overflow-y:auto;scrollbar-width:none;container-type:size;background:#0b0b0d`, with `aria-label="A plane on a flight route"`.
- - `.track{height:300cqh}`; `.pinned{position:sticky;top:0;height:100cqh}` (with its flex column, gap and padding). Measured: the route shrinks to fit above the panel in the 325px laptop box and the 298px phone box.
+ - `.track{height:300cqh}`; `.pinned{position:sticky;top:0;height:100cqh}` (with its flex column, gap and padding). Measured: the route shrinks to fit above the panel at every size. The drawing is shown at 0.83 of its size at 1280×800, 0.62 at 1366×657, 0.35 in the 258px box of a 1280×590 window (87px tall, the panel still inside the box), 1.06 at 768×1024, 0.50 on a 375px phone and 0.42 on a 320px phone.
- The player panel stays: it is the demo's picture of a video's playhead. Its label reads "Forward", "Backward" and "Still" (was "scrubbing", "rewinding" and "idle"); the frame count and the bar stay.
- - `.mark-label` becomes 13px in the drawing's units (was 9px; the drawing is shown at about nine tenths of its size on laptops, so under 8px on screen) and `.ticks` 11px (was 9px).
- - Script: `easeSel.value` becomes a variable `ease` set by Feel; `render()` loses its side-panel readout lines (`progKv`, `frameKv`, `seekVal`, the slider), and `setDir()` loses `dirKv`. The Seek slider's listener goes.
+ - Text that changes every frame (shared rule 10): the frame count (`#frame`) gets `role="img"`, and `render()` sets its `aria-label` together with its text ("Frame 42 of 120"); the direction label (`#dir`) gets `aria-hidden="true"`, because it only repeats which way the plane is moving. Neither is a live region.
+ - The route's labels (0%, 25% … 100%) keep one size on screen (shared rule 11, as part 2's SVG Line Draw does): today they are 9px in the drawing's units, so 7.5px on screen at 1280×800 and 3–6px on phones and short laptops. `.mark-label` loses its `font-size` and `stroke-width` in the CSS, and `buildMarks()` works out `k = 1 / rail.getScreenCTM().a` and gives each label `style.fontSize = 12 * k + 'px'`, `style.strokeWidth = 3 * k + 'px'` and `y = pt.y - 14 * k`, so they show at 12px, 14px above their mark, at every size. The `.flight` svg gets `overflow:visible`, so the 50% label over the top of the curve is not cut when the drawing is small. `.ticks` becomes 11px (was 9px).
+ - Script: `easeSel.value` becomes a variable `ease` set by Feel; `render()` loses its side-panel readout lines (`progKv`, `frameKv`, `seekVal`, the slider), and `setDir()` loses `dirKv`. The Seek slider's listener goes. `measure()` (which calls `buildMarks()`) also runs after `document.fonts.ready`, because the drawing's size depends on the panel's text.
- `hb-dots`: no. Default height.
**Main settings**
@@ -600,8 +656,10 @@ None: leave out the `details.hb-options` block.
- **Stage:**
- `.stage`: `position:relative;overflow-y:auto;scrollbar-width:none;container-type:size;background:#0b0b0d`, with `aria-label="A phone that holds still while its features change"`.
- `.intro{height:100cqh}`, `.pin-section{height:300cqh}`, `.pin-inner{position:sticky;top:0;height:100cqh}`, `.outro{height:100cqh}` (were 620px and 1860px, 480px on phones).
- - Under 600px wide the phone stays beside its text (today it stacks above it, and the text is cut off in the 300px box; measured): `.pin-inner{gap:14px;padding:16px}` keeps its row, and `.phone-wrap svg{width:72px;height:131px}` in place of `transform:scale(.8)`. Measured: the text takes 119px on a 375px phone and 139px on a 320px phone.
- - `.feat-desc` becomes 13px (was 12px).
+ - The phone drawing gets `aria-hidden="true"`: it repeats the feature's number and title (shared rule 12). On computers it becomes `.phone-wrap svg{height:min(200px,72cqh);width:auto}`, so it fits the 258px box of a 1280×590 window, where it is 186px tall (today's 200px drawing and the 32px padding need 264px). Measured: the phone 35–221px and the text 48–212px down the 258px box; at 1280×800 and above it stays 200px.
+ - Phone rules (under 600px): the phone stays beside its text (today it stacks above it, and the text is cut off in the 300px box; measured): `.pin-inner{gap:14px;padding:16px}` keeps its row (today's `flex-direction:column` goes), and `.phone-wrap svg{width:72px;height:131px}` in place of `transform:scale(.8)`. Measured with the 14px text: the longest feature's text takes 150px on a 375px phone and 198px on a 320px phone (51–249px down the 298px box).
+ - `.feat-desc` becomes 14px (was 12px), and so do the intro's and the closing panel's text (was 13px).
+ - The intro's and the closing panel's titles become `<p class="panel-title">` (were `h2`, shared rule 13), with the same sizes (`clamp(20px,3vw,28px)` and `clamp(18px,2.5vw,24px)`, 12px and 10px below) and `font-weight:700`.
- The intro's text reads "The phone and its text will stop in the middle of the box and hold still while four features go by." (today it says CSS handles the pinning). The closing panel keeps "Pin released", and its text reads "The phone and its text let go and scroll away with the page again." (today it speaks of the document flow).
- The four features' texts stay.
- Script: `update()` keeps the feature index, the texts and the phone's colours; the Scroll, Lifecycle and Feature readouts and the segment bar go.
@@ -662,19 +720,19 @@ None: leave out the `details.hb-options` block.
- **Kind:** scroll. Scrolling moves through five sections, and the box settles on one whole section at a time.
- **Description:** The box settles on one whole section at a time. Best for slides and galleries.
-- **Step 1:** Scroll it · help line: "Scroll inside the box and let go: it settles on the nearest section. Or press Play."
+- **Step 1:** Scroll it · help line: "Scroll inside the box and let go: it settles on the nearest section. Press Play and it glides through without snapping." (owner decision 2)
- **Player bar:** Play · Back to top
- **Scroller:** `<div class="scroller" id="scroller" data-hb-scroller tabindex="0" role="region" aria-label="Five sections that the box snaps to">` inside the `.stage`. The `.stage` does the job of today's `.stage-wrap`: it holds the dots beside the scroller, so they stay in place while the sections move. The script calls it `scroller` wherever it said `stage`.
-- **What scrolling shows:** five full-box sections in different colours. Stop scrolling between two and the box glides to the nearer one, so a section always shows whole; with When close it only settles near a section, and with Off it stops anywhere. The dots at the right edge light up for the section in view, and pressing a dot glides to its section.
-- **Scroll distance and Play:** five sections at 100cqh: four box heights of scrolling (1,512px at 1280×800, 1,192px on a phone).
-- **Needs a shared decision (reported to the coordinator):** Play writes the box's position every frame with `behavior:'instant'`, and the browser snaps each of those positions. Measured with today's shared code: with Always the box cannot rest between sections, so Play jumps from one section to the next about every 1.5 seconds, with no movement in between; with When close it scrolls freely between sections and jumps onto each one as it comes near. Measured alternative: if the shared automatic scroll wrote its positions with `behavior:'auto'` (the box's own `scroll-behavior`, smooth here), the box glides to each section in about 0.3 seconds and rests there, which is snap scrolling as a visitor sees it. The page itself needs nothing either way.
+- **What scrolling shows:** five full-box sections in different colours. Stop scrolling between two and the box glides to the nearer one, so a section always shows whole; with When close it only settles near a section, and with Off it stops anywhere. The dots at the right edge light up for the section in view, and pressing a dot glides to its section. Play glides straight through, because the shared script turns snapping off while it runs (shared rule 7); any input inside the stage stops Play (shared rule 6), snapping comes back, and the box settles on the nearest section by itself.
+- **Scroll distance and Play:** five sections at 100cqh: four box heights of scrolling (1,512px at 1280×800, 1,192px on a phone). Play glides through all five in six seconds, a section about every 1.5 seconds, without snapping (owner decision 2); the snapping shows when the visitor scrolls. The page does nothing for this: it never writes `scroll-snap-type` inline, so the shared script can turn it off and back on.
- **Reduced motion:** nothing scrolls by itself. As today, the box lands on a section at once instead of gliding, and the dots change without their transition: the demo's rule becomes `@media(prefers-reduced-motion:reduce){.scroller{scroll-behavior:auto!important}.dot::before{transition:none!important}}`.
- **Stage font:** site font. The quote drops its italic.
- **Stage:**
- `.stage`: `position:relative;overflow:hidden;background:#0b0b0d`.
- - `.scroller`: `height:100%;overflow-y:auto;scrollbar-width:none;position:relative;container-type:size;scroll-snap-type:y mandatory;scroll-behavior:smooth`, with the `::-webkit-scrollbar{display:none}` rule. The old stage's border and height go.
+ - `.scroller`: `height:100%;overflow-y:auto;scrollbar-width:none;position:relative;container-type:size;scroll-behavior:smooth`, with the `::-webkit-scrollbar{display:none}` rule. The old stage's border and height go.
+ - Snapping comes from an attribute, never from an inline style (shared rule 7): the scroller starts with `data-snap="mandatory"`, and three rules read it: `.scroller[data-snap="mandatory"]{scroll-snap-type:y mandatory}`, `.scroller[data-snap="proximity"]{scroll-snap-type:y proximity}` and `.scroller[data-snap="off"]{scroll-snap-type:none}`.
- `.section{height:100cqh}` (was 620px, 480px on phones). The script's `620` becomes `scroller.clientHeight` (the dot and the section in view: `Math.min(Math.round(scroller.scrollTop / scroller.clientHeight), 4)`; the dot's jump: `scroller.scrollTo({ top: i * scroller.clientHeight })`, without `behavior`, so the box's own `scroll-behavior` decides: a glide, or a jump under reduced motion).
- - The dots sit at the right edge inside the box on every screen: `.snap-dots{position:absolute;right:4px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column}`; the phone rule that fixed them to the window goes. Each dot becomes `<button type="button" class="dot" aria-label="Section 1">` (to 5): `.dot{width:44px;height:44px;padding:0;border:0;background:none;display:grid;place-items:center;cursor:pointer}`, with the 8px dot drawn by `.dot::before{content:'';width:8px;height:8px;border-radius:50%;background:var(--ui-muted);transition:background .2s,transform .2s}` and `.dot.active::before{background:var(--ui-accent);transform:scale(1.4)}`. The active dot also gets `aria-current="true"`. The shared script stops Play on any press inside the stage, so a dot works during Play too. Five dots take 220px, which fits the 298px phone box.
+ - The dots sit at the right edge inside the box on every screen: `.snap-dots{position:absolute;right:4px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column}`; the phone rule that fixed them to the window goes. Each dot becomes `<button type="button" class="dot" aria-label="Section 1">` (to 5): `.dot{width:44px;height:44px;padding:0;border:0;background:none;display:grid;place-items:center;cursor:pointer}`, with the 8px dot drawn by `.dot::before{content:'';width:8px;height:8px;border-radius:50%;background:var(--ui-muted);transition:background .2s,transform .2s}` and `.dot.active::before{background:var(--ui-accent);transform:scale(1.4)}`. The active dot also gets `aria-current="true"`. The shared script stops Play on any press inside the stage, so a dot works during Play too. Five dots take 220px, which fits the 258px box of a 1280×590 window and the 298px phone box. The dots' focus ring comes from the shared stylesheet (shared rule 2).
- The section texts are rewritten in plain words (today's speak of the browser engine, CSS and JavaScript):
| Section | Title | Text |
@@ -685,7 +743,7 @@ None: leave out the `details.hb-options` block.
| 04 | (quote) | "The feeling of deliberate motion is hard to achieve with code alone." — on scroll design (unchanged) |
| 05 | That's the whole trick | The browser does the pulling. Nothing has to be timed or scripted. |
- Section 03's three figures read 5 "Sections", 5 "Resting points" and 0 "Stops in between" (were Snap points, Lines of CSS and JS needed), with `.stat-label` at 12px (was 10px).
+ Section 03's three figures read 5 "Sections", 5 "Resting points" and 0 "Stops in between" (were Snap points, Lines of CSS and JS needed), with `.stat-label` at 12px (was 10px). `.sec-sub` becomes 14px (was 13px). Measured: every section's text fits its box at every size; the tallest, section 03, needs 191px in the 258px box and 217px of 298 on a 320px phone.
- Script: the Position, Title and Status readouts and `getStatus()` go; the `scroll` listener keeps the dots.
- `hb-dots`: no. Default height.
@@ -693,7 +751,7 @@ None: leave out the `details.hb-options` block.
| Setting | Control | Choices or range (value shown) | Default | Hint | Sets in the demo |
|---|---|---|---|---|---|
-| Snapping | Choice buttons | Always · When close · Off | Always | When close only settles near a section; Off never does. | `scroller.style.scrollSnapType`: `'y mandatory'` / `'y proximity'` / `'none'` |
+| Snapping | Choice buttons | Always · When close · Off | Always | When close only settles near a section; Off never does. | `scroller.dataset.snap`: `'mandatory'` / `'proximity'` / `'off'` (the three CSS rules above set `scroll-snap-type`) |
**More options**
@@ -723,8 +781,24 @@ None: leave out the `details.hb-options` block.
- [Section Wipe](../section-wipe/) — each section slides up over the one before
- [Fly-in Fly-out Contact List](../fly-in-fly-out-contact-list/) — rows fade and slide as they near the edges
- **README How it works:**
- - In the CSS snippet, `.stage` becomes `.scroller` (with `overflow-y: auto;`), and `height: 620px; /* matches the container height */` becomes `height: 100cqh; /* one box tall */`.
- - "The mode toggle in the demo changes `scroll-snap-type` live." becomes "The Snapping setting changes `scroll-snap-type` live."
+ - The CSS snippet becomes:
+
+ ```css
+ /* On the scroll container */
+ .scroller {
+ overflow-y: auto;
+ container-type: size; /* 100cqh is the box's height */
+ scroll-snap-type: y mandatory; /* or 'y proximity' */
+ }
+
+ /* On each section */
+ .section {
+ height: 100cqh; /* one box tall */
+ scroll-snap-align: start;
+ }
+ ```
+
+ - "The mode toggle in the demo changes `scroll-snap-type` live." becomes "The Snapping setting switches between the three through a `data-snap` attribute that three CSS rules read. The page never writes `scroll-snap-type` inline: the Play button turns snapping off inline while it scrolls the box, and puts back what was there when it stops."
- "Pagination dots and jump-to buttons use `scrollTo` with `behavior: 'smooth'`:" becomes "The dots scroll to their section; leaving out `behavior` lets the box's own `scroll-behavior` decide, so it glides, or jumps under reduced motion:", and its snippet becomes `scroller.scrollTo({ top: sectionIndex * scroller.clientHeight });`.
- The last snippet becomes `const sectionIndex = Math.round(scroller.scrollTop / scroller.clientHeight);`.
- **README Production notes:** unchanged
@@ -739,17 +813,19 @@ None: leave out the `details.hb-options` block.
- **Description:** A picture beside the story changes as you read down. Best for data stories.
- **Step 1:** Scroll it · help line: default
- **Player bar:** Play · Back to top
-- **Try it:** none. The demo has no settings today (its aside holds only a Jump to chapter list and Return to surface). The page has steps 1 and 2. (A decision to confirm: the rollout spec names only Pin Animation, ScrollTrigger Animation and Sticky Section.)
+- **Try it:** none (owner decision 1). The demo has no settings today (its aside holds only a Jump to chapter list and Return to surface). The page has steps 1 and 2.
- **Scroller:** the stage (a row: the porthole column sticks while the chapters scroll).
- **What scrolling shows:** six chapters, from the surface down to the deepest trench, scroll up beside a porthole that holds still. As each chapter passes a reading line 42% down the box, the porthole's water and ring blend smoothly toward the next chapter's colours, darkening as you sink, and the depth under it counts up from 0 to 10,935 metres. Under 600px wide the porthole and the depth sit in a strip across the top and the chapters scroll under it.
-- **Scroll distance and Play:** six chapters of at least 90cqh (their text makes some taller): about 4.5 box heights at 1280×800 (1,683px) and 5.1 on a phone (1,517px). Play sinks through a chapter about every second.
-- **Reduced motion:** nothing scrolls by itself. As today, the water changes colour without its 1.2-second fade (`#ph-bg{transition:none!important}`); the depth still counts with the visitor's own scrolling.
+- **Scroll distance and Play:** six chapters of at least 90cqh (their text makes some taller): about 4.5 box heights at 1280×800 (1,683px) and 5.4 on a 375px phone (1,600px). Play sinks through a chapter about every second.
+- **Reduced motion:** nothing scrolls by itself, and nothing needs simplifying: the water's colour, the ring and the depth follow the visitor's own scrolling directly. The demo's `#ph-bg{transition:background 1.2s ease}` and its reduced-motion rule (`#ph-bg{transition:none!important}`) both go: a gradient background cannot be transitioned, so neither ever did anything.
- **Stage font:** site font. `.ch-fact` drops its italic.
- **Stage:**
- `.stage`: `position:relative;overflow-y:auto;scrollbar-width:none;container-type:size;background:#0b0b0d;display:flex`, with `aria-label="Six chapters about the ocean's depths"`.
- `.vis{height:100cqh}` and `.ch{min-height:90cqh}` (were `var(--stage-h)` and `calc(var(--stage-h) * 0.9)`).
- - Under 600px wide (the demo's phone rule, with new sizes): the strip is 112px tall (was 200px, two-thirds of the new 300px box), `padding:14px 16px;gap:16px`, and gets `background:#0b0b0d` so the text scrolls under it instead of showing through (today it shows through); `#porthole{width:84px;border-width:3px}` (was 140px). Measured: the chapters get 186px of the phone box.
- - Text sizes: `.ch-body` 14px (was 12px), `.ch-fact` 12px (was 10px), `.ch-eye` 11px (was 10px), `#depth-lbl` 11px `#8a8a92` without the opacity .4 (today about 3.5:1).
+ - The porthole shrinks in short boxes so the column fits: `#porthole{width:min(220px,85%,calc(100cqh - 106px))}` (was `min(220px,85%)`). Today, in the 258px box of a 1280×590 window, the porthole and the depth need 306px and overflow the column by 24px at each end; with the new width the porthole is 152px there (content 238px), 219px at 1366×657 and 220px from 1280×800 up (measured).
+ - Phone rules (under 600px), today's with new sizes: `.stage{flex-direction:column}`; `.vis{position:sticky;top:0;width:100%;height:112px;flex-direction:row;gap:16px;padding:14px 16px;z-index:2;background:#0b0b0d}` (was 200px tall, two-thirds of the new 300px box, and without a background, so the text showed through it); `#porthole{width:84px;border-width:3px}` (was 140px); `.chapters{padding:12px 16px}`. Measured: the strip's content fits (14–98px of 112) and the chapters get 186px of the phone box.
+ - Text sizes: `.ch-body` 14px (was 12px), `.ch-fact` 14px (was 10px), `.ch-eye` 11px (was 10px), `#depth-lbl` 11px `#8a8a92` without the opacity .4 (today about 3.5:1).
+ - Text that changes every frame (shared rule 10): `#depth-num` gets `role="img"`, and `update()` sets its `aria-label` with its text ("1,000 metres deep"); `#depth-lbl` gets `aria-hidden="true"`, because its words are in that label. It is not a live region. The porthole (`#porthole`) gets `aria-hidden="true"` (shared rule 12).
- The depth number and the chapter labels mix their chapter colour half and half with `#f4f4f2`: `depNum.style.color = lerpCol(col, '#f4f4f2', 0.5)`, and each `.ch-eye` gets `lerpCol(c.ac, '#f4f4f2', 0.5)` without its opacity .6. The three deepest colours (`#003d55`, `#001f30`, `#000e18`) are nearly invisible on the dark stage today; mixed, the darkest reads about 5:1. The porthole's ring and water keep the full colours, which is where the darkening shows.
- The chapter texts stay.
- Script: `update()` keeps the fraction, the depth, the water and the ring; the Scroll and Chapter readouts and the jump buttons' `on` class go, and so does the jump list's build.
@@ -782,7 +858,7 @@ None: leave out the `details.hb-options` block.
- [Reveal on Scroll](../reveal-on-scroll/) — cards appear as they cross a line
- [Progress Bar](../progress-bar/) — a bar fills as you read
- **README How it works:** unchanged
-- **README Production notes:** unchanged
+- **README Production notes:** the Reduced motion bullet becomes: "**Reduced motion**: nothing here moves on its own; the colours and the depth follow the reader's scrolling, so there is nothing to switch off. A CSS transition on the porthole's gradient would not help anyway: gradients cannot be transitioned, which is why the blend is worked out in JavaScript." The rest is unchanged.
- **Category line:** `01.11 · Scroll-Based`
- **Pager:** Previous: Snap Scrolling (`../snap-scrolling/`) · Next: Reveal on Scroll (`../reveal-on-scroll/`)
@@ -796,14 +872,15 @@ None: leave out the `details.hb-options` block.
- **Player bar:** Play · Back to top
- **Scroller:** `<div class="scroller" id="scroller" data-hb-scroller tabindex="0" role="region" aria-label="Seven cards that appear as you scroll">` inside the `.stage`. The `.stage` does the job of today's `.stage-wrap`: it holds the dashed trigger line beside the scroller, so the line stays in place while the cards move. The script calls it `scroller` wherever it said `stage`.
- **What scrolling shows:** seven cards rise toward a dashed line across the box. Each stays hidden until its top passes the line, then settles into place in its own way: a fade, a rise, a slide from the left, a grow, a sharpen from a blur, a wipe from the left, and a group of four chips that arrive one by one. A card stays shown after that, unless Plays every time is on; then it hides again when it drops back below the line.
-- **Scroll distance and Play:** the cards' own height, with 200px of room after the last so it can pass the highest line: about 2.1 box heights at 1280×800 (791px) and 3.1 on a phone (910px). The first two cards show on arrival, and Play reveals the other five about a second apart.
-- **Back to top and Play from the end:** Back to top, and Play pressed with the box at its end (Play then starts from the top), hide every card and arm the reveals again, as today's Reset all cards did. The page listens for clicks on `#btn-top`, and on `#btn-scroll` when `scroller.scrollTop >= scroller.scrollHeight - scroller.clientHeight - 2`: it calls `hide()` on every card and `buildObserver()` 50ms later, after the jump to the top.
+- **Scroll distance and Play:** the cards' own height, with 200px of room after the last so it can pass the highest line: about 2.1 box heights at 1280×800 (800px) and 3.1 on a 375px phone (921px). The first card or two show on arrival (two on laptops and tablets, one in the 258px box and on phones), and Play reveals the rest about a second apart.
+- **Every Trigger line is reached** (shared rule 4): at the end of the scroll the last card's top is at most 115px down the box (at 768×1024 and at 610×1000, where the box is 438px), always above even the Higher line at half the box; measured from the 258px box to the 438px box and on phones.
+- **Back to top and Play from the end:** Back to top, and Play pressed with the box at its end (Play then starts from the top), hide every card and arm the reveals again, as today's Reset all cards did. The page listens for clicks on `#btn-top`, and on `#btn-scroll` when `scroller.scrollTop >= scroller.scrollHeight - scroller.clientHeight - 2`: it calls `hide()` on every card and `buildObserver()` 50ms later, after the jump to the top. This relies on the order of the listeners: the page's inline script registers its click listeners before the shared script (loaded with `defer`) registers Play's and Back to top's, so on a click the page still sees the box at its end before Play jumps it to the top. The listeners must stay in the inline script's top level.
- **Reduced motion:** nothing scrolls by itself. As today, each card appears at the line without moving (`.card, .card .stagger-child{transition:none!important}`).
- **Stage font:** site font.
- **Stage:**
- `.stage`: `position:relative;overflow:hidden;background:#0b0b0d`.
- `.scroller`: `height:100%;overflow-y:auto;scrollbar-width:none;position:relative`, with the `::-webkit-scrollbar{display:none}` rule. The old stage's width, border and height go, and so does `--stage-h`.
- - `#trigger-line` stays in the `.stage`, over the scroller: `updateLine()` sets its `top` to `scroller.clientTop + threshold / 100 * scroller.clientHeight`. Its label keeps "trigger", at 11px (was 9px).
+ - `#trigger-line` stays in the `.stage`, over the scroller: `updateLine()` sets its `top` to `scroller.clientTop + threshold / 100 * scroller.clientHeight`. Its label keeps "trigger", at 11px (was 9px). Today the line and its label each have `opacity:.7`, so the label reads about 2.7:1; the line drops its opacity and draws its dashes in `rgba(110,168,255,.7)` instead, and the label drops its own, so it shows in the full accent (7.9:1) while the dashes look as they do today.
- The cards' texts are rewritten in plain words (today's bodies are CSS values such as "opacity 0 → 1"). The tag reads "Technique 01" to "Technique 07" (the code names after it go), at 11px without the opacity .7; the titles stay:
| Card | Title | Text |
@@ -816,7 +893,7 @@ None: leave out the `details.hb-options` block.
| 06 | Mask Reveal | Uncovered from left to right. |
| 07 | Stagger Group | (the four chips Alpha, Beta, Gamma and Delta, unchanged) |
- `.card-body` becomes 13px (was 11px) and `.stagger-chip` 12px (was 10px).
+ `.card-body` becomes 14px (was 11px) and `.stagger-chip` 12px (was 10px).
- Script: `reveal()` and `hide()` keep the class change; their state-readout lines go, and so do `logEvent()`, `obsSnippet()` and the Card states list.
- `hb-dots`: no. Default height.
@@ -872,14 +949,16 @@ None: leave out the `details.hb-options` block.
- **Player bar:** Play · Back to top
- **Scroller:** the stage.
- **What scrolling shows:** three groups: a grid of twelve cards (two columns on phones), a list of six people and a cluster of eight tags. As each group comes into the box, its items fade in and rise one after another, a short delay apart, in the chosen order. A group stays shown after that. On a laptop the grid and the top of the list are in the box on arrival, so both play at once and the tags play as the box scrolls.
-- **Scroll distance and Play:** the groups' own height: about 1.3 box heights at 1280×800 (510px) and 2.7 on a phone (792px). Play reaches the tags about four seconds in (on phones only the grid is in the box on arrival).
-- **Back to top, Play from the end, and settings:** Back to top, Play pressed with the box at its end, and every settings change rebuild the three groups hidden and watch them again, as today's Replay all groups did (without its scroll to the top). A new helper `rebuild()` clears the timers still pending from the last reveal, rebuilds the grid, list and chips hidden, and calls `attachObservers()`; the groups in the box then replay with the current settings. The page calls it on clicks on `#btn-top` and on `#btn-scroll` when `stage.scrollTop >= stage.scrollHeight - stage.clientHeight - 2`, 50ms later, after the jump to the top; a settings change calls it at once, so the difference shows where the box is.
+- **Scroll distance and Play:** the groups' own height: about 1.3 box heights at 1280×800 (510px) and 2.7 on a phone (792px). Play reaches the tags about four seconds in (on phones and in the 258px box only the grid is in the box on arrival).
+- **Every group plays** (shared rule 4): a group has no line; it plays once 5% of it is in the box, and the box scrolls until the last group is wholly in view, so all three play at every size.
+- **Back to top, Play from the end, and settings:** Back to top, Play pressed with the box at its end, and every settings change rebuild the three groups hidden and watch them again, as today's Replay all groups did (without its scroll to the top). A new helper `rebuild()` clears the timers still pending from the last reveal, rebuilds the grid, list and chips hidden, and calls `attachObservers()`; the groups in the box then replay with the current settings. The page calls it on clicks on `#btn-top` and on `#btn-scroll` when `stage.scrollTop >= stage.scrollHeight - stage.clientHeight - 2`, 50ms later, after the jump to the top; a settings change calls it at once, so the difference shows where the box is. This relies on the order of the listeners: the page's inline script registers its click listeners before the shared script (loaded with `defer`) registers Play's and Back to top's, so on a click the page still sees the box at its end before Play jumps it to the top. The listeners must stay in the inline script's top level.
- **Reduced motion:** nothing scrolls by itself. As today, the items appear in the same order and with the same delays, but without moving (`.item{transition:none!important}`).
- **Stage font:** site font.
- **Stage:**
- `.stage`: `position:relative;overflow-y:auto;scrollbar-width:none;background:#0b0b0d`, with `aria-label="Three groups of items"`.
- The group headings read "01 · Grid", "02 · List" and "03 · Tags" (were "01 · Card Grid (4 × 3)", "02 · List Rows" and "03 · Tag Chips"), without the opacity .7.
- The delay badges on the grid ("0ms", "50ms" …) go: they are readouts.
+ - Phone rule kept (under 600px): `.grid{grid-template-columns:repeat(2,1fr)}`.
- The tags become plain words (today they are code names such as IntersectionObserver and rAF): Design, Travel, Music, Food, Books, Film, Sport, Science. The grid's Greek letters and the list's six people stay.
- Text sizes: `.grid-cell` 12px (was 10px), `.list-label` 13px (was 11px), `.list-meta` 12px `#8a8a92` without its opacity .4 (today about 3.5:1), `.chip` 12px (was 10px).
- Script: `staggerIn()` keeps each pending timer in a list that `rebuild()` clears, and loses its badge argument. The matrix code (`updateMatrix()` and the matrix build) goes.