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
fix: show the focus ring on Snap Scrolling's box
matin98b387ba35fb
diff --git a/animations/01-scroll-based/snap-scrolling/index.html b/animations/01-scroll-based/snap-scrolling/index.htmlindex 7300caaf..a033ca83 100644--- a/animations/01-scroll-based/snap-scrolling/index.html+++ b/animations/01-scroll-based/snap-scrolling/index.html@@ -30,7 +30,7 @@.scroller[data-snap="mandatory"]{scroll-snap-type:y mandatory}.scroller[data-snap="proximity"]{scroll-snap-type:y proximity}.scroller[data-snap="off"]{scroll-snap-type:none}- .section{height:100cqh;scroll-snap-align:start;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px;text-align:center;position:relative}+ .section{height:100cqh;scroll-snap-align:start;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px;text-align:center}.sec-num{font-size:11px;letter-spacing:2px;text-transform:uppercase;margin-bottom:16px}.sec-title{font-size:clamp(20px,3vw,30px);font-weight:bold;margin-bottom:14px;line-height:1.2}.sec-sub{font-size:14px;opacity:.65;max-width:360px;line-height:1.65}diff --git a/docs/superpowers/plans/2026-09-29-scroll-content-part1.md b/docs/superpowers/plans/2026-09-29-scroll-content-part1.mdindex 279f8885..c83225a6 100644--- a/docs/superpowers/plans/2026-09-29-scroll-content-part1.md+++ b/docs/superpowers/plans/2026-09-29-scroll-content-part1.md@@ -746,7 +746,7 @@ None: leave out the `details.hb-options` block.- `.stage`: `position:relative;overflow:hidden;background:#0b0b0d`.- `.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 (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}`. None uses `!important`, so the shared rule can turn snapping off during Play.- - `.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).+ - `.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). `.section` is not positioned: a positioned section paints over the scroller's inset focus ring.- The dots sit at the right edge inside the box on every screen, in the rail: `.snap-rail{position:sticky;top:0;height:0;z-index:1}` (the scroller's first child, so it sticks to the top of the box while the sections scroll under it, and adds nothing to the scroll range, the section offsets or the first snap point at 0) and `.snap-dots{position:absolute;right:4px;top:50cqh;transform:translateY(-50%);display:flex;flex-direction:column}` (`50cqh` is half the scroller's height; a percentage would be of the 0px-tall rail); 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;font:inherit;display:grid;place-items:center;cursor:pointer}` (`font:inherit`: a button computes Arial otherwise, and the stage's font audit then finds only the site font), 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):@@ -820,6 +820,7 @@ None: leave out the `details.hb-options` block.- **README Production notes:** unchanged- **Category line:** `01.10 · Scroll-Based`- **Pager:** Previous: Pin Animation (`../pin-animation/`) · Next: Scrollytelling (`../scrollytelling/`)+- **Final fix wave (2026-09-30):** the final category review found no focus ring on the box: the sections were positioned, and a positioned section with an opaque gradient paints over the scroller's inset outline. `.section` is no longer positioned (nothing in a section is), the ring shows on a laptop and a phone, and 55 captures at five sizes are otherwise pixel-identical.---