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.

feat: add reverse-scrolling-columns README and update all indexes

matine5c3fa4f2f78
diff --git a/animations/01-scroll-based/README.md b/animations/01-scroll-based/README.md
index fc03e450..f2539e33 100644
--- a/animations/01-scroll-based/README.md
+++ b/animations/01-scroll-based/README.md
@@ -8,3 +8,5 @@ Techniques driven by scroll position.
parallax translation and blur-based depth-of-field driven by scroll progress.
- [Parallax Scrolling](parallax-scrolling/) — Four SVG layers at different scroll speeds
create a 3D depth illusion; adjustable speed multipliers show how ratios make or break the effect.
+- [Reverse-Scrolling Columns](reverse-scrolling-columns/) — A center column that scrolls
+ normally while two flanking columns scroll in the opposite direction, looping infinitely.
diff --git a/animations/01-scroll-based/parallax-depth-of-field/README.md b/animations/01-scroll-based/parallax-depth-of-field/README.md
index 8761c0e4..e12408b3 100644
--- a/animations/01-scroll-based/parallax-depth-of-field/README.md
+++ b/animations/01-scroll-based/parallax-depth-of-field/README.md
@@ -60,5 +60,8 @@ Layers closer to the viewer travel farther, reinforcing the sense of depth.
## See also
-- [Parallax Scrolling](../parallax-scrolling/) — four SVG layers at different scroll speeds
- with adjustable multipliers; the speed-ratio concept without the blur.
+- [Parallax Scrolling](../parallax-scrolling/) — the same depth
+ technique with blur applied per layer based on focal-plane distance rather
+ than translation speed.
+- [Reverse-Scrolling Columns](../reverse-scrolling-columns/) — takes speed-ratio
+ depth further by making columns scroll in opposite directions.
diff --git a/animations/01-scroll-based/parallax-scrolling/README.md b/animations/01-scroll-based/parallax-scrolling/README.md
index ae92edba..1b6f1020 100644
--- a/animations/01-scroll-based/parallax-scrolling/README.md
+++ b/animations/01-scroll-based/parallax-scrolling/README.md
@@ -64,3 +64,5 @@ ratio between speeds determines how convincing the illusion is.
- [Parallax Depth-of-Field](../parallax-depth-of-field/) — the same depth
technique with blur applied per layer based on focal-plane distance rather
than translation speed.
+- [Reverse-Scrolling Columns](../reverse-scrolling-columns/) — takes speed-ratio
+ depth further by making columns scroll in opposite directions.
diff --git a/animations/01-scroll-based/reverse-scrolling-columns/README.md b/animations/01-scroll-based/reverse-scrolling-columns/README.md
new file mode 100644
index 00000000..48e2fb96
--- /dev/null
+++ b/animations/01-scroll-based/reverse-scrolling-columns/README.md
@@ -0,0 +1,75 @@
+# Reverse-Scrolling Columns
+
+[Live demo](index.html)
+
+## What it is
+
+Reverse-scrolling columns place a normally-scrolling center column between
+two flanking columns that scroll in the opposite direction. All three columns
+loop infinitely using a two-set DOM structure and modulo offset math. The
+opposing motion amplifies perceived depth: the brain interprets counter-motion
+as evidence of different distances — the same cue used in parallax, but made
+explicit and exaggerated.
+
+## When to use it
+
+- Hero layouts where bold visual contrast sets the editorial tone
+- Portfolio or agency showcases that need motion without heavy assets
+- Scrolljacking-free scroll-driven features (the stage drives its own scroll)
+- Anywhere opposing motion is used intentionally to create visual tension
+
+## How it works
+
+Each column contains two identical card sets stacked vertically. A single
+`scroll` event listener reads `stage.scrollTop` and feeds it into a
+`requestAnimationFrame` callback that applies `translate3d` to each column:
+
+```js
+// Center column — scrolls down (margin-top pre-offsets by -singleSetH)
+const cOff = scrollTop % singleSetH;
+centerInner.style.transform = `translate3d(0, ${cOff}px, 0)`;
+
+// Side columns — scroll up at the multiplier's magnitude
+const sideOff = (scrollTop * Math.abs(mult)) % singleSetH;
+const sideY = mult >= 0 ? sideOff : -sideOff;
+sideInner.style.transform = `translate3d(0, ${sideY}px, 0)`;
+```
+
+`singleSetH` is the height of one card set (12 cards + gaps), measured from
+the DOM after card generation. The modulo keeps the offset in the range
+`[0, singleSetH)`, producing a seamless wrap when the second set aligns
+exactly with where the first set started.
+
+## Key parameters
+
+| Parameter | Default | Effect |
+|-----------|---------|--------|
+| `mult` | −1.0 | Side-column direction and speed; negative = reverse |
+| `singleSetH` | measured | Height of one card set; determines loop period |
+| Card count | 12 | More cards = longer loop period |
+| Scene height | 2000px | Total scroll travel (max scroll ≈ 1380px) |
+
+## Production notes
+
+- **Infinite loop requires modulo math.** Without wrapping, columns run out
+ of content after one traversal. The two-set structure (one visible, one
+ waiting) ensures there is always content at either end.
+- **Vestibular risk at high speed.** Opposing motion is a known vestibular
+ trigger. In production, keep `|mult|` between 0.3 and 1.0; avoid values
+ above 1.5. Always respect `prefers-reduced-motion` by setting `mult = 0`
+ (side columns freeze) — opposing motion is specifically listed in WCAG 2.3
+ as a hazard for motion-sensitive users.
+- **Library equivalents.** GSAP ScrollTrigger can drive column transforms
+ with `scrub: true` and custom callbacks per column. Locomotive Scroll
+ exposes per-element `data-scroll-speed` attributes that accept negative
+ values for reverse motion. Lenis + a scroll subscriber achieves the same.
+- **Performance.** `translate3d` promotes each column to its own compositor
+ layer. Pair with `will-change: transform` declared in CSS before the first
+ paint. Never animate `top`, `margin-top`, or `height` — those trigger layout.
+
+## See also
+
+- [Parallax Scrolling](../parallax-scrolling/) — speed-ratio depth without
+ opposing direction; the foundation this technique builds on.
+- [Parallax Depth-of-Field](../parallax-depth-of-field/) — depth via blur
+ rather than directional contrast.
diff --git a/index.html b/index.html
index 646dda3a..1c10091e 100644
--- a/index.html
+++ b/index.html
@@ -31,6 +31,10 @@
<a href="animations/01-scroll-based/parallax-scrolling/">Parallax Scrolling</a>
<span class="desc" style="display:block">Four SVG layers at different scroll speeds create a 3D depth illusion; adjustable speed sliders show how ratios make or break the effect.</span>
</li>
+ <li>
+ <a href="animations/01-scroll-based/reverse-scrolling-columns/">Reverse-Scrolling Columns</a>
+ <span class="desc" style="display:block">A center column scrolls normally while two flanking columns scroll in reverse, looping infinitely — the opposing motion creates a striking depth contrast.</span>
+ </li>
</ul>
</body>
</html>