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.

docs: Production notes name a library or say none is needed on the 15 pages that had neither (each claim checked against the library's own docs)

matine48f2d5c3f1d
diff --git a/animations/01-scroll-based/scroll-background-color/README.md b/animations/01-scroll-based/scroll-background-color/README.md
index 915ba8d3..391fa653 100644
--- a/animations/01-scroll-based/scroll-background-color/README.md
+++ b/animations/01-scroll-based/scroll-background-color/README.md
@@ -54,6 +54,7 @@ The scroll handler is rAF-coalesced and performs no layout reads; `maxScroll` is
- A CSS-only version is possible with `animation-timeline: scroll()` driving a keyframe animation over `background-color`; add `steps()` to reproduce the snap variant. Support is not yet universal, so treat it as progressive enhancement over the JS approach.
- If the site has a dark mode, the palettes need dark-mode counterparts and the luminance threshold may shift — a "light" background in dark mode is more jarring than the same color in light mode.
- Color change is not vestibular motion, so this demo deliberately keeps the blend running under `prefers-reduced-motion: reduce`. The preference targets movement — parallax, zoom, skew — not paint. Any transform-based decorations layered on top should still be disabled.
+- GSAP's ScrollTrigger with `scrub: true` ties a `backgroundColor` tween to the scroll position and can replace the blending code here; picking the text color for each blend stays your own code.
## See also
diff --git a/animations/01-scroll-based/scrollspy-nav/README.md b/animations/01-scroll-based/scrollspy-nav/README.md
index ded045f2..29937b66 100644
--- a/animations/01-scroll-based/scrollspy-nav/README.md
+++ b/animations/01-scroll-based/scrollspy-nav/README.md
@@ -57,6 +57,7 @@ The menu sits inside the scroller, in a row that is zero tall and `position: sti
- **Suppress spy updates during programmatic scroll.** A smooth scroll from section 1 to section 5 passes through 2, 3, and 4; without a lock the indicator rapid-fires across every link in between. Activate the target immediately, ignore spy results until the scroll settles, then resume.
- **IntersectionObserver is not a drop-in replacement.** It tells you which sections intersect a band, but scrollspy needs *exactly one* active section at all times — sections taller than the viewport report no intersection with a thin band unless you observe carefully-tuned `rootMargin` bands, and ties between two intersecting sections still need a scroll-position tiebreak. For "one active link" semantics, the cached-tops comparison is simpler and deterministic.
- **Using native anchors instead?** If you link with `href="#section"` and let the browser jump, set `scroll-margin-top` on the targets so a fixed header does not cover the section heading, and use `scroll-behavior: smooth` on the scroller.
+- **Libraries**: Bootstrap's Scrollspy highlights the link of the section in view once `data-bs-spy="scroll"` is on the scroll container, and Gumshoe is a small standalone script that does the same.
## See also
diff --git a/animations/04-micro-interactions/copy-to-clipboard/README.md b/animations/04-micro-interactions/copy-to-clipboard/README.md
index e1de5d59..6dfcdda3 100644
--- a/animations/04-micro-interactions/copy-to-clipboard/README.md
+++ b/animations/04-micro-interactions/copy-to-clipboard/README.md
@@ -50,6 +50,7 @@ The two labels are stacked in the same grid cell so they crossfade in place with
- **Announce for screen readers**: sighted users see the label change, but assistive tech needs an `aria-live="polite"` (or `role="status"`) region that receives the "Copied to clipboard" string on success. Clear it on revert so it does not re-announce stale state.
- **Revert timing and rapid clicks**: clear any pending timer before starting a new one, otherwise a second copy can revert early. Keep the button interactive during the confirmation so repeated copies work.
- **Reduced motion**: under `prefers-reduced-motion: reduce`, drop the morph, pulse, and stroke draw — swap the icon and label instantly. The confirmation still lands, just without movement.
+- **Libraries**: clipboard.js copies from a `data-clipboard-text` attribute and fires `success` and `error` events to start this feedback from, but it relies on the older `execCommand` route rather than the Clipboard API.
## See also
- [Checkmark Draw](../checkmark-draw/) — a tick that draws itself
diff --git a/animations/05-text-typography/text-gradient-animation/README.md b/animations/05-text-typography/text-gradient-animation/README.md
index 87cb797a..fa2d5dc9 100644
--- a/animations/05-text-typography/text-gradient-animation/README.md
+++ b/animations/05-text-typography/text-gradient-animation/README.md
@@ -69,6 +69,7 @@ el.style.backgroundImage = `linear-gradient(${angle}deg, ${c1}, ${c2})`;
- **Performance**: `background-position` animation does not use the CSS compositor and triggers paint on each frame. For long-running animations on large text, test performance on mid-range devices. `@keyframes` (vs. JS `requestAnimationFrame`) avoids the main thread.
- **Fallback**: set a solid `color` on the element before the gradient properties. Browsers that don't support `background-clip: text` will show solid-color text rather than invisible text.
- **Selection color**: selected text with `color: transparent` may render without a visible selection highlight in some browsers. Test selection behavior and add `::selection { color: white; background: blue; }` if needed.
+- **No library needed**: `background-clip: text` and a keyframe animation are plain CSS; GSAP can tween `backgroundPosition` instead when the sweep has to keep time with other animations.
## See also
- [Variable Font Morph](../variable-font-morph/) — the letters themselves change weight and lean
diff --git a/animations/05-text-typography/variable-font-morph/README.md b/animations/05-text-typography/variable-font-morph/README.md
index fe236382..33937536 100644
--- a/animations/05-text-typography/variable-font-morph/README.md
+++ b/animations/05-text-typography/variable-font-morph/README.md
@@ -73,6 +73,7 @@ setInterval(() => { apply(...Object.values(PRESETS[i++ % PRESETS.length])); }, 1
- **Transition performance**: variable font interpolation is handled by the GPU text rendering pipeline in modern browsers. It is not as fast as `transform`/`opacity` animations, but it is generally smooth on mid-range devices for single display elements.
- **Font loading**: the demo uses the site's own font, Schibsted Grotesk, which every page already loads and which is variable in weight from 400 to 900, so the weight morphs smoothly offline. It has no slant axis, so the lean is a `skewX()` tilt. A font with more axes gives you more to morph: Recursive, for example, adds Casual and slant axes. Self-host it with `@font-face` and `font-display: swap`.
- **Recommended variable fonts**: Recursive (CASL, MONO, slnt, wght), Inter (wght), Fraunces (opsz, SOFT, WONK, wght), Bricolage Grotesque (opsz, wdth, wght).
+- **Libraries**: GSAP tweens `fontVariationSettings` and `fontWeight` like any other value, which helps when the morph has to keep time with other animations; on its own, a CSS transition is enough, as here.
## See also
- [Text Gradient Animation](../text-gradient-animation/) — colors flow through the letters instead
diff --git a/animations/06-3d-advanced/chromatic-aberration/README.md b/animations/06-3d-advanced/chromatic-aberration/README.md
index 19ae7db9..e483c5a4 100644
--- a/animations/06-3d-advanced/chromatic-aberration/README.md
+++ b/animations/06-3d-advanced/chromatic-aberration/README.md
@@ -60,6 +60,7 @@ function applyOffset(amount, angleDeg) {
- **WebGL shader approach**: for radial chromatic aberration (stronger at edges, matching real lens behavior), a fragment shader samples the texture at three different UV offsets per pixel. The CSS approach only supports uniform directional offset.
- **Text legibility**: at intensities above ~6px, text becomes hard to read. Use at high intensities only for short headlines or decorative elements, never for body copy.
- **Performance**: CSS stacked elements with `mix-blend-mode` trigger compositing on the GPU. Three `screen`-blended layers is inexpensive. Avoid applying it to large image areas on mobile.
+- **Libraries**: for images and 3D scenes, the postprocessing library for three.js has a `ChromaticAberrationEffect` (with an optional radial falloff), and pixi-filters has an `RGBSplitFilter` for PixiJS.
## See also
- [Glitch Text](../../05-text-typography/glitch-text/) — red and cyan strips tear across a word
diff --git a/animations/06-3d-advanced/glassmorphism-animated/README.md b/animations/06-3d-advanced/glassmorphism-animated/README.md
index e0e005fd..7f190b39 100644
--- a/animations/06-3d-advanced/glassmorphism-animated/README.md
+++ b/animations/06-3d-advanced/glassmorphism-animated/README.md
@@ -97,6 +97,7 @@ Three CSS properties create the glass effect:
- **Dark mode**: glassmorphism requires a dark-enough background to read as glass rather than a white haze. The effect works better on dark themes.
- **Changing the length of a running animation**: a new `animation-duration` puts a running CSS animation at a different point of its cycle, so it jumps. The demo makes its negative delays fractions of the duration and multiplies each blob's `currentTime` by the new length divided by the old one, so a change of Speed keeps every blob where it is.
- **Compare with the blur off**: the demo's Frost setting has an Off choice. If the page is noticeably faster without the blur, reconsider the design.
+- **No library needed**: `backdrop-filter` is plain CSS, and so are the drifting blobs behind the glass; Framer Motion or GSAP only help when the glass has to move in step with the rest of the page.
## See also
- [Mesh Gradient Animation](../../07-ambient-background/mesh-gradient/) — soft color blobs drifting as a background
diff --git a/animations/07-ambient-background/ambient-ripple/README.md b/animations/07-ambient-background/ambient-ripple/README.md
index 08d27026..1d84ce31 100644
--- a/animations/07-ambient-background/ambient-ripple/README.md
+++ b/animations/07-ambient-background/ambient-ripple/README.md
@@ -84,6 +84,7 @@ function updateSource(source) {
- **Canvas vs SVG vs CSS**: canvas is best here because the ring count is variable and positions are dynamic. SVG animation for 15+ simultaneous animated elements creates expensive SMIL calculations. CSS `@keyframes` cannot easily spawn elements dynamically.
- **IntersectionObserver pause**: these loops run continuously — always pause them when the element is off-screen to avoid draining battery on long pages.
- **Accessibility**: the animation is purely decorative. Pause on `prefers-reduced-motion` and remove the canvas entirely if needed — no content is lost.
+- **No library needed**: the rings are a few arcs a frame on a 2D canvas; for ripples that bend a picture like water, PixiJS's `DisplacementFilter` or a shader, as in the GPGPU water example of three.js, are the usual tools.
## See also
- [Click / Tap Ripple](../../04-micro-interactions/click-ripple/) — a ripple that answers a click instead
diff --git a/animations/07-ambient-background/animated-gradient-background/README.md b/animations/07-ambient-background/animated-gradient-background/README.md
index de709452..3a24d402 100644
--- a/animations/07-ambient-background/animated-gradient-background/README.md
+++ b/animations/07-ambient-background/animated-gradient-background/README.md
@@ -56,6 +56,7 @@ Note: `filter` on the gradient element also affects any children — wrap conten
- **Seamless loop**: repeat the first color stop at the end of the gradient to ensure the transition back to the start is smooth. Without this, there's a visible "snap" when the animation restarts.
- **`@property` for smooth hue stop animation**: native CSS custom property interpolation (`@property` with `syntax: '<color>'`) allows animating individual color stops within a gradient — a newer approach that doesn't require the `background-size` hack.
- **Performance**: on low-end devices a large repainting gradient can cost frames; `will-change: background-position` does not stop the repaint, the `transform` version does.
+- **Libraries**: Granim.js draws gradients on a `<canvas>` and moves between named gradient states, for when a CSS loop is not enough.
## See also
- [Mesh Gradient Animation](../mesh-gradient/) — soft blobs of color drift and blend
diff --git a/animations/07-ambient-background/game-of-life/README.md b/animations/07-ambient-background/game-of-life/README.md
index 92ad000f..67a476f8 100644
--- a/animations/07-ambient-background/game-of-life/README.md
+++ b/animations/07-ambient-background/game-of-life/README.md
@@ -45,6 +45,7 @@ A random world usually settles into still shapes and blinkers within a few hundr
- **Pattern files**: patterns are shared as run-length code (RLE), as in the demo; LifeWiki and the Golly pattern collection hold thousands.
- **Reduced motion**: the demo starts paused, showing the world a few generations in, until the visitor presses Play. Drawing still works while paused.
- **It is decorative**: keep the canvas `aria-hidden`, dim the cells or use large ones behind text, and stop the loop when the section is off-screen.
+- **Libraries**: none is needed for the rules; for the GPU version above, the examples of regl, a WebGL library, include a Game of Life that swaps two framebuffers each step.
## See also
- [Matrix Rain](../matrix-rain/) — another canvas grid that changes step by step
diff --git a/animations/07-ambient-background/grid-dot-pattern-parallax/README.md b/animations/07-ambient-background/grid-dot-pattern-parallax/README.md
index 1020ef39..815bc4be 100644
--- a/animations/07-ambient-background/grid-dot-pattern-parallax/README.md
+++ b/animations/07-ambient-background/grid-dot-pattern-parallax/README.md
@@ -84,6 +84,7 @@ function autoLoop(now) {
- **`will-change: transform`** on the pattern layer: useful when the layer is large and translation is frequent (every `mousemove` event). Add/remove dynamically on `mouseenter`/`mouseleave`.
- **`transform: translate()` not `background-position`**: `translate` uses the compositor thread; `background-position` triggers paint. Always use `transform` for the parallax offset.
- **SVG pattern alternative**: `<svg><pattern>` can define more complex repeating patterns (hexagons, triangles, etc.) as background images via `background-image: url("data:image/svg+xml,...")`. This keeps the pattern as pure CSS/SVG with no canvas overhead.
+- **Libraries**: Parallax.js moves layers against the pointer, or against a phone's tilt where there is a gyroscope, by each layer's `data-depth`; with GSAP, `quickTo()` lets the pattern ease toward each new pointer position.
## See also
- [Floating Elements](../floating-elements/) — shapes that drift on their own instead
diff --git a/animations/07-ambient-background/matrix-rain/README.md b/animations/07-ambient-background/matrix-rain/README.md
index 2713d04a..9670e75c 100644
--- a/animations/07-ambient-background/matrix-rain/README.md
+++ b/animations/07-ambient-background/matrix-rain/README.md
@@ -46,6 +46,7 @@ Because the canvas is never fully cleared, the length of the tail is entirely co
- **Pause on hidden tab**: the `requestAnimationFrame` loop is cancelled on `visibilitychange` when `document.hidden` is true and restarted when the tab returns, so a background tab burns no CPU or battery.
- **Reduced motion**: the demo starts paused, showing a screen of rain drawn at once, until the visitor presses Play. In production, show these visitors a still frame.
- **It is decorative**: real usage should sit behind content with `aria-hidden="true"`, `pointer-events: none`, and enough contrast on the foreground text that the rain does not reduce readability. Treat it as texture, not information.
+- **No library needed**: a 2D canvas, `fillText` and a translucent `fillRect` are the whole effect.
## See also
- [Starfield / Space Particles](../starfield/) — another canvas background of moving points
diff --git a/animations/07-ambient-background/mesh-gradient/README.md b/animations/07-ambient-background/mesh-gradient/README.md
index 5df80697..2bb13967 100644
--- a/animations/07-ambient-background/mesh-gradient/README.md
+++ b/animations/07-ambient-background/mesh-gradient/README.md
@@ -77,6 +77,7 @@ Heavy blur is the costly part on phones, so the demo halves it on small screens:
- **Native CSS mesh gradients**: the CSS Working Group has a `mesh()` function specification in progress that would render true mesh gradients in CSS without the blur trick. It is not yet shipped in any browser.
- **Figma / Sketch "mesh gradient" tools**: design tools generate mesh gradients as images. For web, the blur-div approach produces a similar aesthetic with full animation capability.
- **Keep the blobs out of step**: if every blob shares one duration and starts with the others, they all turn around at the same moment and the same mix comes back every cycle. The demo gives each blob its own path and its own duration instead. A negative `animation-delay` (e.g., `-10s`) is another way: it starts an animation mid-cycle, so blobs that share a duration still never line up.
+- **Libraries**: Paper Shaders has a `MeshGradient` that draws the colors in a shader instead of with blurred circles, animated by a speed setting, in plain JavaScript or as a React component.
## See also
- [Animated Gradient Background](../animated-gradient-background/) — one gradient that slowly shifts
diff --git a/animations/07-ambient-background/plasma/README.md b/animations/07-ambient-background/plasma/README.md
index cfcbd036..9dbf04ed 100644
--- a/animations/07-ambient-background/plasma/README.md
+++ b/animations/07-ambient-background/plasma/README.md
@@ -73,6 +73,9 @@ math.
in the DOM above it.
- For the real thing, move the sum-of-sines into a WebGL fragment shader. The GPU
runs it per pixel at full resolution for free, and you drop the upscale entirely.
+- No library is needed for this canvas version. For the shader version, glslCanvas
+ runs a fragment shader in a `<canvas>` from one `data-fragment-url` attribute,
+ and three.js does the same with a `ShaderMaterial` on a full-screen plane.
## See also
diff --git a/animations/07-ambient-background/scanline/README.md b/animations/07-ambient-background/scanline/README.md
index 68f89842..1aebafae 100644
--- a/animations/07-ambient-background/scanline/README.md
+++ b/animations/07-ambient-background/scanline/README.md
@@ -88,6 +88,7 @@ travel without JavaScript measuring the stage.
- **Phosphor glow**: real CRT phosphors emit light that spreads slightly, creating a soft "halo" around bright text. CSS `text-shadow: 0 0 8px currentColor` approximates this. Keep it subtle — heavy glow degrades legibility.
- **Accessibility**: scanlines reduce contrast. Ensure all text meets WCAG contrast ratios *with* the scanline overlay applied. Test with the overlay at your intended darkness value.
- **Retrowave aesthetic**: combines well with [Grain Overlay](../grain-overlay/) (for texture), [Chromatic Aberration](../../06-3d-advanced/chromatic-aberration/) (for color fringing), and dark neon color palettes.
+- **Libraries**: none is needed for the CSS version; over a WebGL scene, the postprocessing library for three.js has a `ScanlineEffect` with density and scroll speed settings.
## See also
- [Grain / Film Noise Overlay](../grain-overlay/) — a flickering texture of fine grain