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: correct the last Scroll-Based wording found by the fix-wave re-reviews
matinf725c0cda991
diff --git a/animations/01-scroll-based/scroll-trigger/index.html b/animations/01-scroll-based/scroll-trigger/index.htmlindex d3c59348..38dbc633 100644--- a/animations/01-scroll-based/scroll-trigger/index.html+++ b/animations/01-scroll-based/scroll-trigger/index.html@@ -199,7 +199,7 @@begins once its centre has risen to 80% down the box, while the whole piece is in view, and completes at 25%,which leaves the finished square (1.3 times its size) inside even the smallest box. The window belongs to thepiece, not to its zone: a zone is nearly a box tall and centres its content, so a window keyed to the zone's- top ran about half a box before the piece could be seen. */+ top ran ahead before the piece could be seen. */const START = 0.8, END = 0.25;const follow = mid => clamp((stage.scrollTop - (mid - START * VH)) / ((START - END) * VH), 0, 1);/* A pinned zone scrubs over the distance it is held, not over the window indiff --git a/docs/superpowers/plans/2026-09-29-scroll-content-part1.md b/docs/superpowers/plans/2026-09-29-scroll-content-part1.mdindex e934cd92..c0e3e063 100644--- a/docs/superpowers/plans/2026-09-29-scroll-content-part1.md+++ b/docs/superpowers/plans/2026-09-29-scroll-content-part1.md@@ -281,7 +281,7 @@ None: leave out the `details.hb-options` block.- **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).+ - `.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 (since the final fix wave the cover no longer changes height on scroll; the rule guards a resize, see the wave note).- 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 cover then moves with transforms and keeps its full height in the layout: `measure()` also sets `cover.style.height = FULL + 'px'` and `CONTENT = FULL − spacer height` (the cover's text with its margins and padding, read from `.cover-spacer`), and `render()` writes, for `v = q(lerp(FULL, MIN, e), 1)` and `d = FULL − v`: `translateY(-d)` on `.cover` and `.article-body`, `translateY(d)` on `#header-chip`, `translateY(d) scaleY(v / FULL)` on `#cover-bg` (`transform-origin:top`) and `translateY(max(0, CONTENT − v))` on `.cover-inner`. `.cover` and `.article-body` get `will-change:transform` (`auto` under reduced motion). (final review: height is no longer animated; layouts during a scroll fell from about one per two frames to none)- 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`).@@ -559,7 +559,7 @@ None: leave out the `details.hb-options` block.- 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 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, and happens where the visitor can see it (the binding rule: the effect is seen during Play and while scrolling by hand). The square and the row of dots each follow their own centre from 80% to 25% down the box: `clamp((scrollTop - (centre - 0.8 * box)) / (0.55 * box), 0, 1)`. A window keyed to the zone's top (80% to 20%, as the old page had it) ran about half a box too early, because a zone is 90% of the box tall and centres its content: dot 1 lit with the row 61–96px below the box, the row came into view with two or three dots already lit, and the square started turning below the box. An end line of 20% would also leave the finished square 7px above the 258px box; 25% keeps it inside (measured in boxes of 258–438px and on phones: dot 1 lights with the row centre at 74–75% down the box, dot 5 at 30–31%; the square starts turning at 161–252px of the 258px box and is done at 6–123px, inside the box for the whole turn). After zone 4 the one-box run-out lets the row rise well past 25% 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 is 236px: its content is taller), zone 2's content 170px (186px on phones, where its caption wraps; the square sits 40px under its caption: turned and grown it reaches 33px beyond its box, so it stays at least 7px clear of the caption) and the pinned card, 136px tall with two lines of text at every width, sits 59–195px down the box (measured; phones 79–215px of 298).+ - Every zone's window is reached at every size, and happens where the visitor can see it (the binding rule: the effect is seen during Play and while scrolling by hand). The square and the row of dots each follow their own centre from 80% to 25% down the box: `clamp((scrollTop - (centre - 0.8 * box)) / (0.55 * box), 0, 1)`. A window keyed to the zone's top (80% to 20%, as the old page had it) ran about half a box too early, because a zone is 90% of the box tall and centres its content: dot 1 lit with the row 61–96px below the box, the row came into view with two or three dots already lit, and the square started turning below the box. An end line of 20% would also leave the finished square 7px above the 258px box; 25% keeps it inside (measured in boxes of 258–438px and on phones: dot 1 lights with the row centre at 74–75% down the box, dot 5 at 30–31%; the square starts turning at 161–252px of the 258px box and is done at 6–123px, inside the box for the whole turn). After zone 4 the one-box run-out lets the row rise well past 25% 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 is 236px: its content is taller), zone 2's content 170px (186px on phones, where its caption wraps; the square sits 40px under its caption: turned and grown it reaches 33px beyond its box, so it stays about 7px clear of the caption, 6.8px at the closest) and the pinned card, 136px tall with two lines of text at every width, sits 59–195px down the box (measured; phones 79–215px 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`, measures the zone tops against the stage's inner edge (`clientTop`, the 1px border) so they match `scrollTop`, and caches the place of the text (`#reveal`), the centre of the square and the centre of the row of dots from their layout boxes (the zone top plus `offsetTop`; `offsetHeight` for the height and the centre), not from their on-screen rectangles, which the turn, the scale and the 30px translate change.- `hb-dots`: no. Default height.- **Removed:**@@ -601,7 +601,7 @@ None: leave out the `details.hb-options` block.- The rest is unchanged.- **Category line:** `01.07 · Scroll-Based`- **Pager:** Previous: Stacking Cards (`../stacking-cards/`) · Next: Scrub Animation (`../scrub-animation/`)-- **Final fix wave (2026-09-30):** the turning square cut into its caption (turned and grown it reaches 33px beyond its box, and the gap was 24px; on phones it covered "you scroll."). `.swatch` is now `margin:40px auto 24px`: measured over the whole follow window at eight sizes, the square stays at least 7px clear of the caption's line (30px would still overlap it by 3px), and only the 258px box changes (zone 2 is 236px there, the scroll 3px longer). Zone 1's stage text now says the fade is keyed to the text itself, and two README wordings are corrected ("half a box", and GSAP's "default" start and end).+- **Final fix wave (2026-09-30):** the turning square cut into its caption (turned and grown it reaches 33px beyond its box, and the gap was 24px; on phones it covered "you scroll."). `.swatch` is now `margin:40px auto 24px`: measured over the whole follow window at eight sizes, the square stays about 7px clear of the caption (6.8px at the closest)'s line (30px would still overlap it by 3px), and only the 258px box changes (zone 2 is 236px there, the scroll 3px longer). Zone 1's stage text now says the fade is keyed to the text itself, and two README wordings are corrected ("half a box", and GSAP's "default" start and end).---diff --git a/docs/superpowers/plans/2026-09-29-scroll-content-part2.md b/docs/superpowers/plans/2026-09-29-scroll-content-part2.mdindex 4d9c1396..434f582b 100644--- a/docs/superpowers/plans/2026-09-29-scroll-content-part2.md+++ b/docs/superpowers/plans/2026-09-29-scroll-content-part2.md@@ -1157,4 +1157,4 @@ None: leave out the `details.hb-options` block.- **README Production notes:** unchanged- **Category line:** `01.26 · Scroll-Based`- **Pager:** Previous: Scrollspy Navigation (`../scrollspy-nav/`) · Next: none-- **Final fix wave:** each chapter's text is one paragraph, `<p>${c[1]} ${c[2]}</p>`, with no `<br>`, so it wraps on its own (the table lists the text, not where it breaks). The forced break had left "background" and "text." alone on a line at 375px. Without it a chapter could still end on one word at 320-344px and 352-373px (360px, for example), so `.stage p` also has `text-wrap:pretty`. Measured at every width from 320 to 1600px: no chapter has a one-word line (47 widths had one without `text-wrap:pretty`), and the wraps from 374px up (375, 390 and 414px, tablets, laptops) are the same as without it. On laptops and tablets chapters 1 to 4 take two lines and chapter 5 one, and the section heights and the scroll length are unchanged. A browser that ignores `text-wrap:pretty` wraps as before and can still end a chapter on one word at those narrow widths.+- **Final fix wave:** each chapter's text is one paragraph, `<p>${c[1]} ${c[2]}</p>`, with no `<br>`, so it wraps on its own (the table lists the text, not where it breaks). The forced break had left "background" and "text." alone on a line at 375px. Without it a chapter could still end on one word at 320-344px and 352-373px (360px, for example), so `.stage p` also has `text-wrap:pretty`. Measured at every width from 320 to 1600px: no chapter has a one-word line (47 widths had one without `text-wrap:pretty`), and the wraps from 374px up (375, 390 and 414px, tablets, laptops) are the same as without it. On laptops and tablets chapters 1 to 4 take two lines and chapter 5 one, and the section heights and the scroll length are unchanged, except in the 258px box of a 1280×590 window, where chapter 5 now takes one line and its section is 5px shorter. A browser that ignores `text-wrap:pretty` wraps as before and can still end a chapter on one word at those narrow widths.