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: tidy Reverse-Scrolling Columns for screen readers and reduced motion
matinfbfb8fe85539
diff --git a/animations/01-scroll-based/reverse-scrolling-columns/index.html b/animations/01-scroll-based/reverse-scrolling-columns/index.htmlindex 5d0b29d1..b3d1c743 100644--- a/animations/01-scroll-based/reverse-scrolling-columns/index.html+++ b/animations/01-scroll-based/reverse-scrolling-columns/index.html@@ -69,13 +69,13 @@<div class="stage" id="stage" tabindex="0" role="region" aria-label="Three columns of project cards"><div class="scene"><div class="columns">- <div class="col">+ <div class="col" aria-hidden="true"><div class="col-inner" id="inner-left"></div></div><div class="col"><div class="col-inner" id="inner-center"></div></div>- <div class="col col-right">+ <div class="col col-right" aria-hidden="true"><div class="col-inner" id="inner-right"></div></div></div>@@ -201,7 +201,8 @@[leftInner, centerInner, rightInner].forEach(el => {el.appendChild(makeSet());- el.appendChild(makeSet());+ // The second set only repeats the first so the column can loop, and the side columns repeat the middle one: a screen reader hears the twelve cards once+ el.appendChild(makeSet()).setAttribute('aria-hidden', 'true');});// Side columns: dir -1 runs them the opposite way, +1 the same way; speed is their share of the middle column's.@@ -226,8 +227,8 @@const st = stage.scrollTop;ticking = false;- // Reduced motion: columns stay put- if (motionMQ.matches) return;+ // Reduced motion: columns stay put, and switching it on mid-visit sets them back at rest+ if (motionMQ.matches) { centerInner.style.transform = leftInner.style.transform = rightInner.style.transform = ''; return; }// Center: scrolls with the input — content travels up as you scroll downcenterInner.style.transform = `translate3d(0,${-(st % singleSetH)}px,0)`;@@ -255,6 +256,8 @@choices('speed-seg', d => { speed = +d.speed; mult = dir * speed; update(); });window.addEventListener('resize', () => { measure(); update(); });+ // Reduced motion switched on or off mid-visit: clear the movement, or take it up again from where the box is+ motionMQ.addEventListener('change', update);measure();update();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..d2a5e846 100644--- a/docs/superpowers/plans/2026-09-29-scroll-content-part1.md+++ b/docs/superpowers/plans/2026-09-29-scroll-content-part1.md@@ -219,6 +219,8 @@ None: leave out the `details.hb-options` block.- `.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). 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).+ - **Screen readers hear the twelve cards once (final fix wave).** The left and right `.col` get `aria-hidden="true"` (they repeat the middle column), and so does the second `.card-set` of every column, which only repeats the first so the column can loop: `el.appendChild(makeSet()).setAttribute('aria-hidden', 'true')`, with a comment. Before, each card was read six times (four on a phone, where the right column is hidden).+ - **Reduced motion switched on mid-visit clears the movement (final fix wave).** The reduced-motion line of `update()` sets the three inner transforms to `''` before it returns, and `motionMQ.addEventListener('change', update)` after the resize listener runs it when the setting changes, so the columns go back to rest at once and, switched off again, take up the scroll position. This replaces "`update()` returns early" in Reduced motion above. Before, the transforms stayed frozen where they were, and a later change of Side columns go emptied the side columns (measured at 1280×800, at 61% of the scroll: a 508px gap at the top of each side column after a switch to Same way); now every direction and speed leaves them full.- `update()` keeps the three transforms; its readout lines (progress and the three offsets) go.- `hb-dots`: no. Default height.@@ -260,6 +262,7 @@ None: leave out the `details.hb-options` block.- **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/`)+- **Final fix wave:** the side columns and the second card set of every column are hidden from screen readers (each card is read once, not six times), and reduced motion switched on mid-visit clears the column transforms (see the last two Stage bullets).---