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.
HTML ai-promptsanimationcss-animationsfrontendgithub-pagesjavascriptmicrointeractionsmotion-designno-dependenciesreferencescroll-animationui-animationweb-animationweb-developmentwebgl
docs: record Scrollspy's menu rail
matinc1863273bbb4
diff --git a/docs/superpowers/plans/2026-09-29-scroll-content-part2.md b/docs/superpowers/plans/2026-09-29-scroll-content-part2.mdindex 969340e9..5053dc3b 100644--- a/docs/superpowers/plans/2026-09-29-scroll-content-part2.md+++ b/docs/superpowers/plans/2026-09-29-scroll-content-part2.md@@ -60,7 +60,7 @@ The two lists below, A and B, were settled after both halves were reviewed. They- **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 redraw the stage at once, where it is; the others (a count's speed, how far rows lean) show at the next scroll.-- **The scroller** is the `.stage` itself, or, on Progress Bar and Scrollspy Navigation, an inner element marked `data-hb-scroller`. On those two the indicator and the menu sit beside the scroller, and the `.stage` does the job of today's `.stage-wrap`. Every scroller gets:+- **The scroller** is the `.stage` itself, or, on Progress Bar and Scrollspy Navigation, an inner element marked `data-hb-scroller`. On those two the `.stage` does the job of today's `.stage-wrap`: Progress Bar's indicators sit beside the scroller with `pointer-events:none`, and Scrollspy's menu sits inside it, in a zero-height sticky rail (`.spy-rail`). Every scroller gets:- `tabindex="0" role="region"` and an `aria-label` (each section gives it), as on the scratch scroll page, 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. Sticky Section and Zoom Into Image read `offsetTop` without it today, so it is measured from the top of the page and their steps and their zoom start about 100px of scrolling late (measured: 111px and 103px).@@ -1002,7 +1002,7 @@ None: leave out the `details.hb-options` block.- **Description:** A menu highlights the section you are reading. Best for long docs.- **Step 1:** Scroll it · help line: "Scroll inside the box or pick a section in the menu, or press Play and it scrolls for you."- **Player bar:** Play · Back to top-- **Scroller:** `<div class="doc" id="doc" data-hb-scroller tabindex="0" role="region" aria-label="Documentation sections">` inside the `.stage`. The `.stage` does the job of today's `.stage-wrap`: it holds the menu (`nav.spy-nav`) beside the scroller, so the menu stays in place. The script calls the scroller `doc` wherever it said `stage`. The page adds no focus rule: the shared stylesheet draws the focus ring of the scroller and of the menu links inset, inside the stage (rule B2).+- **Scroller:** `<div class="doc" id="doc" data-hb-scroller tabindex="0" role="region" aria-label="Documentation sections">` inside the `.stage`. The `.stage` does the job of today's `.stage-wrap`, the box around the scroller; the menu (`nav.spy-nav`) sits inside the scroller, in the sticky zero-height `.spy-rail` (`position:sticky;top:0;height:0;z-index:1`, the scroller's first child), so the menu stays in place while the sections move and a wheel turn or a swipe that starts on it still scrolls the box. The script calls the scroller `doc` wherever it said `stage`. The page adds no focus rule: the shared stylesheet draws the focus ring of the scroller and of the menu links inset, inside the stage (rule B2).- **Play and the menu:** the shared script stops Play on any trusted input anywhere inside the stage (rule B6), including a press on a menu link, so Play has stopped before the link scrolls the box. The link handler needs nothing more.- **What scrolling shows:** six documentation sections scroll by. As a section's heading passes the line that Link changes at sets, its link lights and the marker slides to it; at the very bottom the last link lights. Pressing a link glides (or jumps) to its section and lights that link at once, without flickering through the links in between. Under 600px wide the menu is a strip across the top, as today.- **Scroll distance and Play:** six sections of at least 500px and a 40cqh run-out. In the site font the sections are exactly 500px (3,000px in all) from 375px wide up. On a 320px phone the text wraps more, and each section is 564px (3,384px in all). Measured, that is about 6 box heights on a 440px tablet stage, 8.6 at 1366×657, 9.5 on a 375px phone, 10.8 on a 320px phone and 11 in the smallest stage (1280×590). Play passes about one section a second, so the marker steps down the menu about once a second.@@ -1066,6 +1066,7 @@ None: leave out the `details.hb-options` block.- **README Production notes:** the "`offsetTop` is the recurring trap" bullet is wrong about this demo (its scroller is positioned, so `offsetTop` would be measured from it). The words "here it would be body-relative and every comparison would be wrong" become "and then every comparison is wrong (this demo positions its scroller, but still measures as below, which works whatever sits in between)". The rest is unchanged.- **Category line:** `01.25 · Scroll-Based`- **Pager:** Previous: SVG Line Draw on Scroll (`../svg-line-draw/`) · Next: Scroll-Driven Background Color (`../scroll-background-color/`)+- **Final fix wave:** sheet only. The menu is not beside the scroller: it sits inside it, in the sticky zero-height `.spy-rail` (the Scroller line above and the category rule at the top of this half). Checked at 1280×800: the rail is the scroller's first child, and a 300px wheel turn over a menu link scrolls the box while the menu stays 16px below its top edge.---