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: Audio Visualizer (06.28), a new 3D & Advanced page

matin2b23805a3dd6
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index f53f4d2b..094317af 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -5,7 +5,7 @@ contact_links:
about: "Saw an animation on a website and don't know its name? Answer three short questions and see the ones that match."
- name: Browse the live handbook
url: https://matinmonshizadeh.github.io/animation-handbook/
- about: See all 172 techniques running before filing an issue.
+ about: See all 173 techniques running before filing an issue.
- name: Ask a question or share an idea
url: https://github.com/matinmonshizadeh/animation-handbook/discussions
about: Questions, ideas and things you made with the handbook go to Discussions.
diff --git a/404.html b/404.html
index 694da1db..23c20c4f 100644
--- a/404.html
+++ b/404.html
@@ -133,7 +133,7 @@ button,input{font:inherit;color:inherit}
</form>
<nav class="ways" aria-label="Ways back">
<a class="way" href="/animation-handbook/">Go to the home page</a>
- <a class="way" href="/animation-handbook/?view=all#results">Browse all 172 animations</a>
+ <a class="way" href="/animation-handbook/?view=all#results">Browse all 173 animations</a>
<a class="way" href="/animation-handbook/?view=find">Find an animation by what you saw</a>
</nav>
</main>
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8de7e250..38084694 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -27,6 +27,8 @@ The main steps of Animation Handbook, newest first, with the number of animation
and Compare from the start.
- A new animation, Water Ripple (172 in all): ripples spread from your finger and bend the picture below, with See inside
and Compare from the start.
+- A new animation, Audio Visualizer (173 in all): bars dance to the music, from bass to treble, silent until Hear it is
+ pressed, with See inside and Compare from the start.
## 1.0.0 — 2026-10-10
diff --git a/README.md b/README.md
index 2eaae339..2d0b677f 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,10 @@
<div align="center">
-<a href="https://matinmonshizadeh.github.io/animation-handbook/"><picture><source media="(prefers-reduced-motion: reduce) and (max-width: 600px)" srcset="docs/hero-phone-still.webp"><source media="(prefers-reduced-motion: reduce)" srcset="docs/hero-still.webp"><source media="(max-width: 600px)" srcset="docs/hero-phone.webp"><img src="docs/hero.webp" alt="Six animations from the handbook playing at once: Text Particles, Synthwave Grid, Liquid Glass, Shatter Effect, Holographic Card, and Dynamic Island, six of its 172 web animation techniques" width="820"></picture></a>
+<a href="https://matinmonshizadeh.github.io/animation-handbook/"><picture><source media="(prefers-reduced-motion: reduce) and (max-width: 600px)" srcset="docs/hero-phone-still.webp"><source media="(prefers-reduced-motion: reduce)" srcset="docs/hero-still.webp"><source media="(max-width: 600px)" srcset="docs/hero-phone.webp"><img src="docs/hero.webp" alt="Six animations from the handbook playing at once: Text Particles, Synthwave Grid, Liquid Glass, Shatter Effect, Holographic Card, and Dynamic Island, six of its 173 web animation techniques" width="820"></picture></a>
# Animation Handbook
-**A visual reference of 172 web animation techniques: watch each one play live, change most of them with plain settings, and copy a ready-made prompt for your AI assistant. Free to use, with no sign-up.**
+**A visual reference of 173 web animation techniques: watch each one play live, change most of them with plain settings, and copy a ready-made prompt for your AI assistant. Free to use, with no sign-up.**
[**Open the live handbook →**](https://matinmonshizadeh.github.io/animation-handbook/)
@@ -14,7 +14,7 @@ Add it to your AI coding assistant (run in your project folder; needs Node.js):
npx skills add matinmonshizadeh/animation-handbook
```
-[![Live site](https://img.shields.io/website?url=https%3A%2F%2Fmatinmonshizadeh.github.io%2Fanimation-handbook%2F&label=live%20demo&up_message=online&color=91bdff)](https://matinmonshizadeh.github.io/animation-handbook/) [![Stars](https://img.shields.io/github/stars/matinmonshizadeh/animation-handbook?style=flat&color=79de9d)](https://github.com/matinmonshizadeh/animation-handbook) [![License](https://img.shields.io/github/license/matinmonshizadeh/animation-handbook?color=c6a1ff)](LICENSE) [![Techniques](https://img.shields.io/badge/techniques-172-ff9d5c)](#full-catalog) [![Dependencies](https://img.shields.io/badge/dependencies-0-ff94a9)](#design-principles) [![Build](https://img.shields.io/badge/build-none-62ddcf)](#design-principles)
+[![Live site](https://img.shields.io/website?url=https%3A%2F%2Fmatinmonshizadeh.github.io%2Fanimation-handbook%2F&label=live%20demo&up_message=online&color=91bdff)](https://matinmonshizadeh.github.io/animation-handbook/) [![Stars](https://img.shields.io/github/stars/matinmonshizadeh/animation-handbook?style=flat&color=79de9d)](https://github.com/matinmonshizadeh/animation-handbook) [![License](https://img.shields.io/github/license/matinmonshizadeh/animation-handbook?color=c6a1ff)](LICENSE) [![Techniques](https://img.shields.io/badge/techniques-173-ff9d5c)](#full-catalog) [![Dependencies](https://img.shields.io/badge/dependencies-0-ff94a9)](#design-principles) [![Build](https://img.shields.io/badge/build-none-62ddcf)](#design-principles)
</div>
@@ -22,7 +22,7 @@ npx skills add matinmonshizadeh/animation-handbook
## What this is
-Here are 172 web animation techniques in one place, each shown working. Every page plays its animation live and gives you a ready-made prompt to paste into your AI assistant, so you can add the animation to your own site without writing the code yourself. Most pages also let you change the animation with a few plain settings, and the prompt you copy lists your choices. Each folder's `README.md` explains how the technique works, the values that matter, and the production gotchas, for anyone who wants to build it by hand.
+Here are 173 web animation techniques in one place, each shown working. Every page plays its animation live and gives you a ready-made prompt to paste into your AI assistant, so you can add the animation to your own site without writing the code yourself. Most pages also let you change the animation with a few plain settings, and the prompt you copy lists your choices. Each folder's `README.md` explains how the technique works, the values that matter, and the production gotchas, for anyone who wants to build it by hand.
Everything is plain HTML, CSS, and JavaScript: no build step, no frameworks, no CDN. Open any page's `index.html` from a copy of this repository and its demo runs offline; [Run it locally](#run-it-locally) covers the parts that need a local server. Built to *inspire* and *teach*, not to sell a library.
@@ -64,12 +64,12 @@ Then ask for an animation in plain words, like "make the cards fade in as they s
| 03 | [Page Transitions](#03) | 17 |
| 04 | [Micro-Interactions](#04) | 44 |
| 05 | [Text & Typography](#05) | 19 |
-| 06 | [3D & Advanced](#06) | 27 |
+| 06 | [3D & Advanced](#06) | 28 |
| 07 | [Ambient & Background](#07) | 23 |
## Full catalog
-All 172 techniques, each linked to its live demo.
+All 173 techniques, each linked to its live demo.
Each technique's code and README are in its folder under [animations/](animations/).
@@ -252,11 +252,11 @@ Each technique's code and README are in its folder under [animations/](animation
<a id="06"></a>
-### 06 · 3D & Advanced · 27 techniques
+### 06 · 3D & Advanced · 28 techniques
<sub>WebGL, shaders, particles, 3D transforms, simulations, and other heavier effects.</sub>
-<details><summary>Browse all 27 techniques in 3D & Advanced</summary>
+<details><summary>Browse all 28 techniques in 3D & Advanced</summary>
- **[3D Model Orbit](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/3d-model-orbit/)** — A lit 3D shape spins, or turns to face your pointer. Best for product views.
- **[Scroll-Driven 3D Rotation](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/scroll-driven-3d-rotation/)** — Scrolling turns a 3D cube from pose to pose. Best for product tours.
@@ -285,6 +285,7 @@ Each technique's code and README are in its folder under [animations/](animation
- **[Holographic Card](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/holographic-card/)** — A card tilts as you point, and its rainbow foil shimmers. Best for collectibles.
- **[Infinite Zoom](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/infinite-zoom/)** — The view keeps zooming into pictures inside pictures. Best for page intros.
- **[Water Ripple](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/water-ripple/)** — Ripples spread from your finger and bend the picture below. Best for hero images.
+- **[Audio Visualizer](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/audio-visualizer/)** — Bars dance to the music, from bass to treble. Best for music players.
</details>
diff --git a/animations/06-3d-advanced/README.md b/animations/06-3d-advanced/README.md
index e20ef26f..98f47513 100644
--- a/animations/06-3d-advanced/README.md
+++ b/animations/06-3d-advanced/README.md
@@ -33,6 +33,7 @@ WebGL, shaders, particles, 3D transforms, simulations, and other heavier effects
| [Holographic Card](holographic-card/) | A card tilts as you point, and its rainbow foil shimmers. Best for collectibles. |
| [Infinite Zoom](infinite-zoom/) | The view keeps zooming into pictures inside pictures. Best for page intros. |
| [Water Ripple](water-ripple/) | Ripples spread from your finger and bend the picture below. Best for hero images. |
+| [Audio Visualizer](audio-visualizer/) | Bars dance to the music, from bass to treble. Best for music players. |
## Key concepts
@@ -51,6 +52,7 @@ WebGL, shaders, particles, 3D transforms, simulations, and other heavier effects
| All WebGL demos | WebGL 1.0 (all modern browsers) |
| GPGPU Particle System | WebGL2 (Chrome 56+, Firefox 51+, Safari 15+) |
| backdrop-filter (Glassmorphism) | Chrome, Edge, Safari; Firefox 103+ |
+| Web Audio (Audio Visualizer) | Every modern browser; the sound starts only after Hear it is pressed, and the bars move without it |
| SVG filter in backdrop-filter (Liquid Glass) | Chromium browsers on a computer or Android (Chrome, Edge, Opera); Safari, Firefox and every browser on iPhone and iPad show frosted glass instead |
## See also
diff --git a/animations/06-3d-advanced/audio-visualizer/README.md b/animations/06-3d-advanced/audio-visualizer/README.md
new file mode 100644
index 00000000..5b920f8d
--- /dev/null
+++ b/animations/06-3d-advanced/audio-visualizer/README.md
@@ -0,0 +1,54 @@
+# Audio Visualizer
+
+[Live demo](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/audio-visualizer/)
+
+## What it is
+An audio visualizer turns sound into moving shapes: a row of bars from bass on the left to treble on the right, each as tall as its band of pitches is loud right now. The bars jump up when a sound starts and sink back as it fades, so a kick drum makes the low bars leap and the hi-hats flicker at the top. The same loudness can be drawn as bars, as a ring of bars around a circle, or as the wave the sound itself makes.
+
+## When to use it
+- Music players, from a site's own player to a band's page
+- Podcast and audiobook cards, to show that something is playing
+- Radio, DJ and event sites, as a lively header
+- Voice notes and recorders, as a sign that sound is coming in
+
+## How it works
+In a real player the page connects the playing audio to the Web Audio API's `AnalyserNode`, which reports many times a second how loud each slice of pitches is (`getByteFrequencyData`) or the shape of the sound (`getByteTimeDomainData`):
+
+```js
+const ctx = new AudioContext(), source = ctx.createMediaElementSource(audioElement), analyser = ctx.createAnalyser();
+analyser.fftSize = 2048;
+source.connect(analyser); analyser.connect(ctx.destination);
+const freq = new Uint8Array(analyser.frequencyBinCount);
+analyser.getByteFrequencyData(freq); // 0 to 255 for each slice of about 22 Hz
+```
+
+The analyzer's slices are all the same width in hertz, but hearing works in octaves: 40 to 80 Hz is as wide a step for the ear as 4,000 to 8,000 Hz. So the bars group the slices by octave, from 40 Hz to 16 kHz, each band wider than the one before, and each bar shows the average of its slices. With equal slices instead (the demo's Compare), the bass and the tune crowd into the first few bars and the rest only flicker.
+
+```js
+const edges = [...Array(n + 1)].map((_, i) => 40 * Math.pow(400, i / n)); // 40 Hz × 400 = 16 kHz
+```
+
+Each frame a bar jumps straight to a louder value and otherwise sinks by How bars fall, measured in bar heights a second, so it falls at the same speed on every screen; a peak mark holds the highest point for 0.4 seconds, then sinks slowly. The palette's two colors are drawn once into a strip one pixel wide, and each bar copies the part of the strip it reaches with `drawImage`, which costs far less than filling every bar with a gradient each frame.
+
+The demo plays no file and uses no microphone. Its tune is written in the page as notes (kick, snare, hi-hats, bass and a short melody, four bars at 100 beats a minute), and every frame the page works out how loud each band would be from the notes playing at that moment, so the bars move in silence, offline and on a muted phone. Hear it plays the same notes through the browser's own oscillators and a burst of generated noise, scheduled a tenth of a second ahead on the audio clock; only then do the bars read a real analyzer. The sound is made on that press and never before (browsers block sound that starts by itself); Pause and a hidden tab suspend it, and Slow motion plays the tune at a third of the tempo.
+
+## Key parameters
+| Parameter | Default | Effect |
+|-----------|---------|--------|
+| Style | Bars | Bars stand in a row from bass to treble; wave draws the sound's shape over a few hundredths of a second instead of its pitches; circle sets the bars around a ring that swells with the bass |
+| Number of bars | Many | Few is 16 bars, some 32 and many 64; phones start at some, and each row of Compare holds half as many bars on phones; a wave has no bars, so it ignores this |
+| How bars fall | Gently | How fast a bar sinks after it jumps: quickly is 2.6 bar heights a second, gently 1.2 and slowly 0.45, like an old stereo; a wave ignores it |
+| Peak marks | on | A thin mark (a dot in the ring) holds each bar's highest point for 0.4 seconds, then sinks slowly; off, only the bars show; a wave has none |
+| Colors | Sunset | The colors from the bottom of each bar to its top: sunset runs from coral to gold, ocean from deep blue to cyan, neon from pink to cyan; See inside lays the colors of the tune's parts over them |
+
+## Production notes
+- **Ask before sound.** Create the `AudioContext` inside the visitor's own press of play: browsers keep a context made earlier suspended and warn in the console. Never open the microphone without a clear reason and the visitor's yes.
+- **Group by octave.** Average the analyzer's slices into bands that widen with pitch, or most bars show only hiss. `smoothingTimeConstant` (0 to 1) smooths the analyzer's own values; the jump-and-fall of the bars is better done in your own code, by time.
+- **Light drawing.** One canvas and a few dozen copied rectangles a frame are cheap; a gradient filled over every bar each frame is not. Draw fewer bars on phones and stop the loop when the player is paused or out of view.
+- **Cross-origin audio.** An `<audio>` element playing a file from another site needs `crossorigin="anonymous"` and the right CORS headers, or the analyzer reads only zeros.
+- **Reduced motion.** Keep the bars still until the visitor presses play, and let them turn the movement off while the music plays.
+- **Libraries.** Wavesurfer.js draws waveforms and plays files; Tone.js schedules notes and synths on the Web Audio clock; audioMotion-analyzer is a ready-made bar analyzer with octave bands and peaks.
+
+## See also
+- [Starfield / Space Particles](../../07-ambient-background/starfield/) — a loop drawn by JavaScript every frame
+- [Abstract Geometric Motion](../../07-ambient-background/abstract-geometric-motion/) — a pattern for music players that ignores the sound
diff --git a/animations/06-3d-advanced/audio-visualizer/index.html b/animations/06-3d-advanced/audio-visualizer/index.html
new file mode 100644
index 00000000..dfd6ec1d
--- /dev/null
+++ b/animations/06-3d-advanced/audio-visualizer/index.html
@@ -0,0 +1,466 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Audio Visualizer — Animation Handbook</title>
+ <meta name="description" content="Bars dance to the music, from bass to treble. Best for music players.">
+ <link rel="canonical" href="https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/audio-visualizer/">
+ <link rel="icon" type="image/png" sizes="96x96" href="../../../favicon.png">
+ <link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
+ <link rel="apple-touch-icon" href="../../../apple-touch-icon.png">
+ <meta property="og:type" content="article">
+ <meta property="og:site_name" content="Animation Handbook">
+ <meta property="og:title" content="Audio Visualizer — Animation Handbook">
+ <meta property="og:description" content="Bars dance to the music, from bass to treble. Best for music players.">
+ <meta property="og:url" content="https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/audio-visualizer/">
+ <meta property="og:image" content="https://matinmonshizadeh.github.io/animation-handbook/og-image.png">
+ <meta name="twitter:card" content="summary_large_image">
+ <meta name="twitter:title" content="Audio Visualizer — Animation Handbook">
+ <meta name="twitter:description" content="Bars dance to the music, from bass to treble. Best for music players.">
+ <meta name="twitter:image" content="https://matinmonshizadeh.github.io/animation-handbook/og-image.png">
+ <script type="application/ld+json">{"@context": "https://schema.org", "@type": "TechArticle", "headline": "Audio Visualizer", "name": "Audio Visualizer", "description": "Bars dance to the music, from bass to treble. Best for music players.", "url": "https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/audio-visualizer/", "inLanguage": "en", "articleSection": "3D & Advanced", "isPartOf": {"@type": "WebSite", "name": "Animation Handbook", "url": "https://matinmonshizadeh.github.io/animation-handbook/"}, "author": {"@type": "Person", "name": "matinmonshizadeh"}, "keywords": "web animation, CSS animation, 3D & Advanced, Audio Visualizer"}</script>
+ <style>
+ :root{--ui-accent:#3fd6c4}
+ *,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
+ .stage{position:relative;overflow:hidden;background:radial-gradient(80% 70% at 50% 100%,#1a1430,#08080c 70%)}
+ #cvs{position:absolute;inset:0;width:100%;height:100%;display:block}
+ /* Hear it: a small player row in the box, at least 44px */
+ .hear{position:absolute;right:10px;top:10px;z-index:2;display:inline-flex;align-items:center;gap:8px;min-height:44px;min-width:44px;padding:0 14px;
+ border:1px solid rgba(255,255,255,.28);border-radius:999px;background:rgba(8,8,12,.82);color:#f4f4f2;font:600 14px/1 var(--hb-font);cursor:pointer}
+ .hear svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
+ .hear[aria-pressed="true"]{border-color:var(--ui-accent);color:var(--ui-accent)}
+ @media(hover:hover){.hear:hover{border-color:rgba(255,255,255,.6)}}
+ /* See inside and Compare: plain words over the picture */
+ .av-lbl{display:none;position:absolute;padding:3px 8px;border-radius:6px;background:rgba(8,8,12,.9);color:#f4f4f2;font:600 13px/1.25 var(--hb-font);white-space:nowrap;pointer-events:none}
+ .stage[data-hb-mode="inside"] .in:not(.scale),.stage[data-hb-mode="compare"] .row{display:block}
+ .key{left:10px;top:10px;max-width:calc(100% - 140px);white-space:normal}
+ .key i{display:inline-block;width:9px;height:9px;margin:0 4px 0 2px;border-radius:50%;vertical-align:0}
+ .beat{left:10px;top:var(--beat-y,50px)}
+ .scale{left:10px;right:10px;bottom:8px}
+ .stage[data-hb-mode="inside"].st-bars .scale{display:flex;justify-content:space-between}
+ .row{left:10px}.row.first{top:10px}.row.second{top:var(--l2-y,50%)}
+ </style>
+ <link rel="stylesheet" href="../../../assets/css/demo-page.css?v=10">
+ <script src="../../../assets/js/demo-page.js?v=10" defer></script>
+</head>
+<body class="hb" data-hb-kind="loop">
+<nav class="hb-bar" aria-label="Animation Handbook">
+ <a class="hb-home" href="../../../"><svg class="hb-mark" viewBox="0 0 32 32" aria-hidden="true"><g class="g"><circle cx="11.16" cy="20.84" r="6.1"/><circle cx="15.12" cy="16.88" r="6.1"/><circle cx="18.51" cy="13.49" r="6.1"/></g><circle class="b" cx="21.2" cy="10.8" r="6.6"/></svg><span>Animation Handbook</span></a>
+ <span class="hb-pager"><a href="../water-ripple/" rel="prev" aria-label="Previous: Water Ripple"><svg class="hb-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg><span><span class="hb-dir">Previous: </span>Water Ripple</span></a></span>
+ <a class="hb-star" href="https://github.com/matinmonshizadeh/animation-handbook" target="_blank" rel="noopener" aria-label="Star on GitHub"><svg class="hb-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1-4.4-4.3 6.1-.9z"/></svg><span>Star on GitHub</span></a>
+</nav>
+<main class="hb-page">
+ <header class="hb-head">
+ <p class="hb-cat">06.28 · 3D &amp; Advanced</p>
+ <h1>Audio Visualizer</h1>
+ <p class="hb-lede">Bars dance to the music, from bass to treble. Best for music players.</p>
+ </header>
+
+ <section class="hb-step hb-watch" aria-labelledby="hb-watch-title">
+ <div class="hb-step-head">
+ <span class="hb-num" aria-hidden="true">1</span>
+ <div><h2 id="hb-watch-title">Watch it</h2><p>It moves to a built-in beat, in silence. Press Hear it to play the beat out loud.</p></div>
+ </div>
+ <div class="seg hb-modes" role="group" aria-label="What the box shows" data-hb-modes>
+ <button type="button" data-hb-mode="normal" class="on" aria-pressed="true">Normal</button>
+ <button type="button" data-hb-mode="inside" aria-pressed="false">See inside</button>
+ <button type="button" data-hb-mode="compare" aria-pressed="false">Compare</button>
+ </div>
+ <div class="stage st-bars">
+ <canvas id="cvs" role="img" aria-label="Bars from bass on the left to treble on the right, jumping to a beat and sinking back"></canvas>
+ <button class="hear" type="button" id="hear" aria-pressed="false"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 9v6h4l5 4V5L8 9z"/><path d="M16.5 8.5a5 5 0 0 1 0 7M19 6a8.5 8.5 0 0 1 0 12"/></svg><span>Hear it</span></button>
+ <p class="av-lbl in key" aria-hidden="true" data-hb-caption><i style="background:#ff5d5d"></i>Kick <i style="background:#ffa94d"></i>Snare <i style="background:#b07cff"></i>Bass <i style="background:#5cd18a"></i>Melody <i style="background:#4fc3f7"></i>Hi-hats</p>
+ <p class="av-lbl in beat" aria-hidden="true" data-hb-caption>The beat</p>
+ <p class="av-lbl in scale" aria-hidden="true" data-hb-caption><span>Bass</span><span>Middle</span><span>Treble</span></p>
+ <p class="av-lbl row first" aria-hidden="true" data-hb-caption>Equal slices</p>
+ <p class="av-lbl row second" aria-hidden="true" data-hb-caption>Wider for treble</p>
+ </div>
+ <div class="hb-player">
+ <button class="hb-play" type="button" id="btn-pause" data-hb-pause data-state="playing"><svg class="hb-ic hb-i-pause" viewBox="0 0 24 24" aria-hidden="true"><rect x="6" y="4" width="4" height="16" rx="1"/><rect x="14" y="4" width="4" height="16" rx="1"/></svg><svg class="hb-ic hb-i-play" viewBox="0 0 24 24" aria-hidden="true"><path d="M6 3l14 9-14 9z"/></svg><span class="hb-pause-label">Pause</span></button>
+ <label class="hb-toggle"><input class="hb-switch" type="checkbox" role="switch" id="slow-tog" data-hb-slowmo autocomplete="off"><span>Slow motion</span></label>
+ </div>
+ <div class="hb-mode-notes" aria-live="polite">
+ <p data-hb-for="inside" hidden>Inside, each bar is split by the parts of the tune filling it, kick and bass on the left, hi-hats on the right. The top strip marks the beat: each kick lifts the low bars.</p>
+ <p data-hb-for="compare" hidden>Equal slices gives every bar the same share of pitches, so the bass crowds into a few bars. Wider for treble widens the slices as pitches rise, as we hear, so the whole row dances.</p>
+ </div>
+ </section>
+
+ <section class="hb-step hb-try" aria-labelledby="hb-try-title">
+ <div class="hb-step-head">
+ <span class="hb-num" aria-hidden="true">2</span>
+ <div><h2 id="hb-try-title">Try it</h2><p>Change a setting and see the difference as it moves.</p></div>
+ </div>
+ <div class="hb-settings">
+ <div class="hb-setting">
+ <p class="hb-setting-name" id="style-lbl">Style</p>
+ <div class="seg" id="style-seg" role="group" aria-labelledby="style-lbl">
+ <button type="button" data-style="bars" class="on" aria-pressed="true">Bars</button>
+ <button type="button" data-style="wave" aria-pressed="false">Wave</button>
+ <button type="button" data-style="circle" aria-pressed="false">Circle</button>
+ </div>
+ <p class="hb-hint">Wave draws the sound's shape instead of its pitches.</p>
+ </div>
+ <div class="hb-setting">
+ <p class="hb-setting-name" id="bars-lbl">Number of bars</p>
+ <div class="seg" id="bars-seg" role="group" aria-labelledby="bars-lbl">
+ <button type="button" data-n="16" aria-pressed="false">Few</button>
+ <button type="button" data-n="32" data-hb-phone aria-pressed="false">Some</button>
+ <button type="button" data-n="64" class="on" aria-pressed="true">Many</button>
+ </div>
+ <p class="hb-hint">Fewer read better when small.</p>
+ </div>
+ <div class="hb-setting">
+ <p class="hb-setting-name" id="fall-lbl">How bars fall</p>
+ <div class="seg" id="fall-seg" role="group" aria-labelledby="fall-lbl">
+ <button type="button" data-fall="2.6" aria-pressed="false">Quickly</button>
+ <button type="button" data-fall="1.2" class="on" aria-pressed="true">Gently</button>
+ <button type="button" data-fall="0.45" aria-pressed="false">Slowly</button>
+ </div>
+ <p class="hb-hint">Slowly sinks like an old stereo.</p>
+ </div>
+ </div>
+ <details class="hb-options">
+ <summary><span class="hb-more-label">More options</span><span class="hb-less">Fewer options</span><svg class="hb-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg></summary>
+ <div class="hb-settings">
+ <div class="hb-setting">
+ <label class="hb-switch-row"><span>Peak marks</span><input class="hb-switch" type="checkbox" role="switch" id="peak-tog" checked autocomplete="off"></label>
+ <p class="hb-hint">A small mark holds each bar's highest point for a moment.</p>
+ </div>
+ <div class="hb-setting">
+ <p class="hb-setting-name" id="colors-lbl">Colors</p>
+ <div class="seg" id="colors-seg" role="group" aria-labelledby="colors-lbl">
+ <button type="button" data-pal="sunset" class="on" aria-pressed="true">Sunset</button>
+ <button type="button" data-pal="ocean" aria-pressed="false">Ocean</button>
+ <button type="button" data-pal="neon" aria-pressed="false">Neon</button>
+ </div>
+ <p class="hb-hint">The colors from the bottom of each bar to its top.</p>
+ </div>
+ </div>
+ </details>
+ </section>
+
+ <section class="hb-step hb-prompt-step" aria-labelledby="hb-prompt-title">
+ <div class="hb-step-head">
+ <span class="hb-num" aria-hidden="true">3</span>
+ <div><h2 id="hb-prompt-title">Copy the prompt</h2><p>Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.</p></div>
+ </div>
+ <div class="hb-card">
+ <p class="hb-prompt">Add an audio visualizer to [your music player, podcast card or hero section]. Connect the playing audio to an analyzer that reports, many times a second, how loud each band of pitches is, and draw the bands on a canvas from bass to treble, in the style the settings choose, each sized by its loudness. Give higher bands wider slices of pitch, as hearing does, so the whole row moves. Let bands jump up at once and sink back as the settings choose. Start sound only when the visitor presses play, never use the microphone without asking, and draw fewer bars on phones. If the visitor has reduced motion turned on, keep the bars still until they press play. Match the settings listed below.</p>
+ <div class="hb-chips-box" hidden>
+ <p class="hb-chips-title">Your settings</p>
+ <ul class="hb-chips"></ul>
+ </div>
+ <div class="hb-copy-row">
+ <button class="hb-copy" type="button"><svg class="hb-ic hb-i-copy" viewBox="0 0 24 24" aria-hidden="true"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg><svg class="hb-ic hb-i-done" viewBox="0 0 24 24" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg><span class="hb-copy-label" aria-live="polite">Copy prompt</span></button>
+ <p class="hb-hint">Replace the words in brackets with your own element. Your settings are added at the end.</p>
+ </div>
+ </div>
+ <div class="hb-star-row"><p>Free and open source. If this helped, a star on GitHub helps other people find it.</p><a class="hb-star-btn" href="https://github.com/matinmonshizadeh/animation-handbook" target="_blank" rel="noopener"><svg class="hb-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1-4.4-4.3 6.1-.9z"/></svg>Star on GitHub</a></div>
+ </section>
+
+ <section class="hb-about" aria-labelledby="hb-what-title">
+ <div class="hb-what">
+ <h2 id="hb-what-title">What it is</h2>
+ <div class="hb-what-text"><p>The full explanation is in <a href="README.md">README.md</a>.</p></div>
+ </div>
+ <div class="hb-fit">
+ <h2>Good for</h2>
+ <ul class="hb-tags hb-good"><li>Music players</li><li>Podcast pages</li><li>Radio and DJ sites</li><li>Voice notes</li></ul>
+ <h3>Avoid on</h3>
+ <ul class="hb-tags hb-avoid"><li>Pages without sound</li><li>Reading pages</li></ul>
+ </div>
+ </section>
+
+ <section class="hb-related" aria-labelledby="hb-related-title" hidden>
+ <h2 id="hb-related-title">Similar animations</h2>
+ <div class="hb-rel-list"></div>
+ </section>
+</main>
+<footer class="hb-foot"><span>Animation Handbook</span><a href="https://github.com/matinmonshizadeh/animation-handbook" target="_blank" rel="noopener">Source on GitHub</a><a href="#top">Back to top ↑</a></footer>
+<script>
+ const cvs=document.getElementById('cvs'),ctx=cvs.getContext('2d'),stage=cvs.parentElement,hear=document.getElementById('hear');
+ const slowTog=document.getElementById('slow-tog'),peakTog=document.getElementById('peak-tog'),pauseBtn=document.getElementById('btn-pause');
+ const reduceMQ=matchMedia('(prefers-reduced-motion: reduce)'),phone=matchMedia('(max-width:600px),(max-height:500px)');
+ // The tune: four bars at 100 beats a minute (a beat is 0.6 s, the loop 9.6 s), written as the beats each part plays on.
+ // Bass and melody notes are [beat, length in beats, frequency in Hz].
+ const BEAT=.6,LOOP=16*BEAT;
+ const KICK=[0,1.5,2,4,5.5,6,8,9.5,10,12,13.5,14,15],SNARE=[1,3,5,7,9,11,13,15],HATS=[...Array(32)].map((_,i)=>i/2);
+ const BASS=[[0,1.5,55],[1.5,.5,55],[2,1,55],[3,1,110],[4,1.5,43.65],[5.5,.5,43.65],[6,1,43.65],[7,1,87.3],[8,1.5,65.4],[9.5,.5,65.4],[10,1,65.4],[11,1,130.8],[12,1.5,49],[13.5,.5,49],[14,1,49],[15,1,98]];
+ const MELODY=[[0,1,440],[1,1,523.3],[2,2,659.3],[4,1,587.3],[5,1,523.3],[6,2,440],[8,1,392],[9,1,440],[10,2,523.3],[12,1,493.9],[13,1,392],[14,2,329.6]];
+ const PARTS=['kick','snare','bass','melody','hats'],PART_COLORS=['#ff5d5d','#ffa94d','#b07cff','#5cd18a','#4fc3f7'];
+ const PALETTES={sunset:['#ff5f6d','#ffc371'],ocean:['#0083b0','#00e5ff'],neon:['#ff00a0','#00f0ff']};
+ // The box's name follows the view and the style (then the loop: "held still" while it is paused)
+ const NAMES={
+ normal:{bars:'Bars from bass on the left to treble on the right',wave:'A line that traces the shape of the sound',circle:'A ring of bars from bass at the top round to treble'},
+ inside:{bars:'The bars split by the parts of the tune that fill them, with a scale from bass to treble and the beat on top',
+ wave:'The sound\'s shape split into one line for each part of the tune, with the beat on top',circle:'The ring of bars split by the parts of the tune that fill them, with the beat on top'},
+ compare:{bars:'Two rows of bars for the same tune: equal slices of pitch above, slices that widen for treble below',
+ wave:'Two matching lines for the same tune: Wave draws the sound\'s shape, so both rows are the same',circle:'Two rings of bars for the same tune: equal slices of pitch above, slices that widen for treble below'}};
+ let style='bars',count=64,fall=1.2,pal='sunset',mode='normal',paused=false;
+ let W=0,H=0,raf=0,lastT=null,clock=.03,song=.03,rows=null,audio=null,insideTop=40;
+ // On phones the bars start at the choice marked data-hb-phone (Some), pressed here before the shared script reads the settings
+ if(phone.matches){const b=document.querySelector('#bars-seg [data-hb-phone]');count=+b.dataset.n;
+ document.querySelectorAll('#bars-seg button').forEach(x=>{x.classList.toggle('on',x===b);x.setAttribute('aria-pressed',String(x===b))})}
+ const bars=()=>count;
+ // How loud each part is at a time of the loop (s, in seconds): a hit dies away after it is struck, a note while it sounds
+ const since=(beats,s)=>{let best=1e9;for(const b of beats){const d=s-b*BEAT;if(d>=0&&d<best)best=d;const w=s+LOOP-b*BEAT;if(w>=0&&w<best)best=w}return best};
+ const note=(notes,s)=>{for(const [b,l,f] of notes){const d=s-b*BEAT;if(d>=0&&d<l*BEAT)return{f,amp:Math.exp(-d/(l*BEAT*1.2))}}return{f:0,amp:0}};
+ function parts(s){
+ return{kick:Math.exp(-since(KICK,s)/.12),snare:.8*Math.exp(-since(SNARE,s)/.15),hats:.55*Math.exp(-since(HATS,s)/.05),bass:note(BASS,s),melody:note(MELODY,s)};
+ }
+ // How strongly a part fills a band of pitches (lo to hi Hz), as an analyzer would measure it: the part's loudness averaged over
+ // the band, its energy sitting around its own pitches, spread over a range (a drum) or over a note and its overtones
+ // (pitches in octaves: lf is a sampled pitch of the band, c a part's own pitch, w how far its energy spreads)
+ const near=(lf,c,w)=>{const d=(lf-c)/w;return Math.exp(-d*d)};
+ const L62=Math.log2(62),L200=Math.log2(200),L1800=Math.log2(1800),L9000=Math.log2(9000);
+ function fill(row,i,p,out){
+ const lb=p.bass.amp?Math.log2(p.bass.f):0,lm=p.melody.amp?Math.log2(p.melody.f):0;
+ const tone=(n,k,l,lf)=>n.amp?k*n.amp*(near(lf,l,.3)+.5*near(lf,l+1,.3)+.25*near(lf,l+1.585,.3)):0;
+ out.fill(0);
+ for(let j=0;j<6;j++){const lf=row.lf[i*6+j];
+ out[0]+=p.kick*near(lf,L62,.9);out[1]+=p.snare*(.6*near(lf,L200,.6)+near(lf,L1800,1.6));out[2]+=tone(p.bass,1,lb,lf);out[3]+=tone(p.melody,.8,lm,lf);out[4]+=p.hats*near(lf,L9000,.9)}
+ for(let k=0;k<5;k++)out[k]/=6;
+ return out;
+ }
+ // A row of bands: Wider for treble splits 40 Hz to 16 kHz evenly by octave (each band wider in pitches than the last), Equal
+ // slices into equal widths of 0 to 16 kHz. Each keeps its bars' heights and peak marks.
+ function makeRow(even,n){
+ const edges=[...Array(n+1)].map((_,i)=>even?16000*i/n:40*Math.pow(400,i/n)),lf=new Float32Array(n*6);
+ // six pitches spread across each band, kept in octaves, at which the parts are measured
+ for(let i=0;i<n;i++)for(let j=0;j<6;j++)lf[i*6+j]=Math.log2(Math.max(20,edges[i]+(edges[i+1]-edges[i])*(j+.5)/6));
+ return{edges,lf,level:new Float32Array(n),peak:new Float32Array(n),hold:new Float32Array(n),split:[...Array(n)].map(()=>[0,0,0,0,0])};
+ }
+ // Normal and See inside draw the log row; Compare draws its own pair, each row half as many bars on phones. All three follow
+ // the tune every frame, so a mode opens on the current beat.
+ function build(){const n=bars(),c=phone.matches?n/2:n;rows={log:makeRow(false,n),lin:makeRow(true,c),cmp:makeRow(false,c)};
+ for(const row of Object.values(rows))settle(row,aim(row,song,null),1e6)}
+ phone.addEventListener('change',()=>{if(rows){build();draw()}});
+ // The heights a frame aims for: from the tune itself, or from the real sound once Hear it plays it
+ function aim(row,s,freq){
+ const p=parts(s),n=row.level.length,bin=freq?audio.ctx.sampleRate/2/freq.length:1,out=new Float32Array(n);
+ for(let i=0;i<n;i++){
+ const lo=row.edges[i],hi=row.edges[i+1],f=fill(row,i,p,row.split[i]),sum=f[0]+f[1]+f[2]+f[3]+f[4];
+ for(let k=0;k<5;k++)f[k]=sum?f[k]/sum:0;
+ if(freq){let a=0,c=0;for(let k=Math.floor(lo/bin);k<=Math.max(Math.floor(lo/bin),Math.floor(hi/bin));k++){a+=freq[k]||0;c++}out[i]=Math.min(1,a/c/210)}
+ else out[i]=1-Math.exp(-1.6*sum);
+ }
+ return out;
+ }
+ // Bars jump up at once and sink back by How bars fall (heights a second, a third of it in slow motion); a peak mark holds for
+ // 0.4 s, then falls slowly
+ function settle(row,target,dt){
+ const k=dt/1000,{level,peak,hold}=row;
+ for(let i=0;i<level.length;i++){
+ level[i]=target[i]>level[i]?target[i]:Math.max(target[i],level[i]-fall*k);
+ if(level[i]>=peak[i]){peak[i]=level[i];hold[i]=.4}else if((hold[i]-=k)<0)peak[i]=Math.max(level[i],peak[i]-.35*k);
+ }
+ }
+ // The sound's shape: the parts of the tune added together, a short stretch of time around now, worked out once for a moment of the
+ // tune and shared by every line drawn from it (120 points, 80 on phones)
+ const waveSize=()=>phone.matches?80:120;
+ let waveSet=null;
+ function waves(s){
+ const n=waveSize();
+ if(waveSet&&waveSet.s===s&&waveSet.n===n)return waveSet;
+ const p=parts(s),sum=new Float32Array(n),each=[0,1,2,3,4].map(()=>new Float32Array(n));
+ for(let j=0;j<n;j++){const ph=(s+j/n*.03)*6.283,
+ v=[p.kick*Math.sin(ph*60),p.snare*.5*Math.sin(ph*3100+j*j),p.bass.amp*.8*Math.sin(ph*p.bass.f),p.melody.amp*.5*Math.sin(ph*p.melody.f),p.hats*.3*Math.sin(ph*9000+j*7)];
+ for(let k=0;k<5;k++)each[k][j]=v[k]*.6;
+ sum[j]=(v[0]+v[1]+v[2]+v[3]+v[4])*.6}
+ return waveSet={s,n,sum,each};
+ }
+ const wave=(s,part)=>part===undefined?waves(s).sum:waves(s).each[part];
+ function grad(x0,y0,x1,y1){const g=ctx.createLinearGradient(x0,y0,x1,y1),[a,b]=PALETTES[pal];g.addColorStop(0,a);g.addColorStop(1,b);return g}
+ // One row of bars in a rectangle; split: draw each bar in the colors of the parts filling it (See inside)
+ // The palette's colors from the bottom of a bar to its top, drawn once into a strip one pixel wide; each bar copies the part of
+ // the strip it reaches, which costs far less than filling bars with a gradient every frame
+ let strip=null;
+ function stripFor(h){
+ if(strip&&strip.h===Math.round(h)&&strip.pal===pal)return strip.c;
+ const c=document.createElement('canvas'),g=c.getContext('2d'),[a,b]=PALETTES[pal],gr=g.createLinearGradient(0,h,0,0);
+ c.width=1;c.height=Math.max(1,Math.round(h));gr.addColorStop(0,a);gr.addColorStop(1,b);g.fillStyle=gr;g.fillRect(0,0,1,h);
+ strip={c,h:Math.round(h),pal};return c;
+ }
+ // Every bar is drawn in the palette first (in See inside a little larger, so the palette frames it); See inside then fills it part
+ // by part, every bar of one color in one path, filled once over the palette, so Colors shows there too
+ function drawBars(row,x,y,w,h,split){
+ const n=row.level.length,bw=w/n,gap=Math.min(3,bw*.25),c=stripFor(h),e=split?Math.max(.6,gap/2-.3):0;
+ for(let i=0;i<n;i++){const bh=Math.max(2,row.level[i]*h);ctx.drawImage(c,0,c.height-bh,1,bh,x+i*bw+gap/2-e,y+h-bh-e,bw-gap+2*e,bh+e)}
+ if(split){
+ ctx.globalAlpha=.86;
+ for(let k=0;k<5;k++){
+ ctx.beginPath();
+ for(let i=0;i<n;i++){const bh=Math.max(2,row.level[i]*h),sh=row.split[i][k];let under=0;for(let q=0;q<k;q++)under+=row.split[i][q];
+ if(sh)ctx.rect(x+i*bw+gap/2,y+h-(under+sh)*bh,bw-gap,sh*bh)}
+ ctx.fillStyle=PART_COLORS[k];ctx.fill();
+ }
+ ctx.globalAlpha=1;
+ }
+ if(peakTog.checked){ctx.beginPath();for(let i=0;i<n;i++)ctx.rect(x+i*bw+gap/2,y+h-row.peak[i]*h-3,bw-gap,2);ctx.fillStyle=split?PALETTES[pal][1]:'#f4f4f2';ctx.fill()}
+ }
+ // The ring: every bar in the palette (one path), the parts over it in See inside (one path each), a dot beyond each bar's peak
+ function drawCircle(row,cx,cy,r0,len,split){
+ const n=row.level.length,bass=(row.level[0]+row.level[1]+row.level[2])/3,r=r0*(1+.18*bass),[ca,cb]=PALETTES[pal],g=ctx.createRadialGradient(cx,cy,r,cx,cy,r+len);
+ g.addColorStop(0,ca);g.addColorStop(1,cb);
+ const lw=Math.max(2,Math.min(8,6.283*r/n*.55)),spoke=i=>{const a=-Math.PI/2+i/n*6.283;return[Math.cos(a),Math.sin(a),Math.max(2,row.level[i]*len)]};
+ ctx.lineWidth=split?lw+1.6:lw;ctx.lineCap='round';ctx.strokeStyle=g;ctx.beginPath();
+ for(let i=0;i<n;i++){const[c,s,l]=spoke(i);ctx.moveTo(cx+c*r,cy+s*r);ctx.lineTo(cx+c*(r+l),cy+s*(r+l))}
+ ctx.stroke();
+ if(split){
+ ctx.globalAlpha=.86;ctx.lineWidth=lw;ctx.lineCap='butt';
+ for(let k=0;k<5;k++){
+ ctx.strokeStyle=PART_COLORS[k];ctx.beginPath();
+ for(let i=0;i<n;i++){const sh=row.split[i][k];if(sh<.02)continue;const[c,s,l]=spoke(i);let under=0;for(let q=0;q<k;q++)under+=row.split[i][q];
+ const d0=r+under*l,d1=r+(under+sh)*l;ctx.moveTo(cx+c*d0,cy+s*d0);ctx.lineTo(cx+c*d1,cy+s*d1)}
+ ctx.stroke();
+ }
+ ctx.globalAlpha=1;
+ }
+ if(peakTog.checked){ctx.fillStyle=split?cb:'#f4f4f2';ctx.beginPath();const pr=Math.max(1.5,lw*.4);
+ for(let i=0;i<n;i++){const[c,s]=spoke(i),d=r+row.peak[i]*len+lw/2+pr+1,px=cx+c*d,py=cy+s*d;ctx.moveTo(px+pr,py);ctx.arc(px,py,pr,0,6.283)}
+ ctx.fill()}
+ ctx.strokeStyle='rgba(255,255,255,.25)';ctx.lineWidth=1.5;ctx.beginPath();ctx.arc(cx,cy,r-4,0,6.283);ctx.stroke();
+ }
+ // A soft limit keeps the line inside its box at the loudest moments, so it never reaches into the half beside it
+ // (step 3 for the noisy parts, whose jagged lines cost the most to draw and read the same with fewer points)
+ function drawWave(pts,x,y,w,h,color,width,step=1){
+ ctx.strokeStyle=color;ctx.lineWidth=width;ctx.lineJoin='bevel';ctx.beginPath();
+ for(let j=0;j<pts.length;j+=step){const v=pts[j],px=x+j/(pts.length-1)*w,py=y+h/2-v/(1+.25*Math.abs(v))*h*.42;j?ctx.lineTo(px,py):ctx.moveTo(px,py)}
+ ctx.stroke();
+ }
+ function drawRow(row,x,y,w,h,split,s,live){
+ if(style==='bars')drawBars(row,x,y,w,h,split);
+ else if(style==='circle'){const R=Math.min(w,h)/2-8;drawCircle(row,x+w/2,y+h/2,R*.36,R*.6,split)}
+ else{
+ // See inside: the line of Normal, with one thin line for each part of the tune under it
+ if(split)PART_COLORS.forEach((c,k)=>drawWave(wave(s,k),x,y,w,h,c,1.5,k===1||k===4?3:1));
+ drawWave(live||wave(s),x,y,w,h,grad(x,0,x+w,0),3)}
+ }
+ // See inside's beat strip: the loop in half beats, the kicks in the kick's color and the snares in the snare's, and a mark that
+ // moves with the tune
+ const CELLS=[...Array(32)].map((_,b)=>KICK.includes(b/2)?PART_COLORS[0]:SNARE.includes(b/2)?PART_COLORS[1]:'rgba(255,255,255,.14)');
+ function drawBeat(y){
+ const x=10,w=W-20,cw=w/32;
+ for(let b=0;b<32;b++){ctx.fillStyle=CELLS[b];ctx.fillRect(x+b*cw+1,y,cw-2,10)}
+ ctx.fillStyle='#fff';ctx.fillRect(x+song/LOOP*w-1.5,y-4,3,18);
+ }
+ // Where Compare draws: the top 58px hold Hear it and the first name, then two halves of the same width and height, the second
+ // name in the band between them
+ function layout(){const h=Math.max(40,Math.floor((H-58-8-30)/2));return{h,y1:58,y2:58+h+30,l2:58+h+4}}
+ function draw(){
+ ctx.clearRect(0,0,W,H);
+ const live=audio&&audio.ctx.state==='running'&&style==='wave'?toWave(audio.an):null;
+ if(mode==='compare'){const L=layout();drawRow(rows.lin,10,L.y1,W-20,L.h,false,song,live);drawRow(rows.cmp,10,L.y2,W-20,L.h,false,song,live);
+ ctx.fillStyle='rgba(255,255,255,.12)';ctx.fillRect(0,L.y1+L.h+1,W,2)}
+ else if(mode==='inside'){drawBeat(insideTop+30);drawRow(rows.log,10,insideTop+56,W-20,H-insideTop-96,true,song,live)}
+ else drawRow(rows.log,10,58,W-20,H-68,false,song,live);
+ }
+ const waveBuf=new Float32Array(120);
+ const toWave=an=>{const d=audio.td||(audio.td=new Uint8Array(an.fftSize)),n=waveSize(),stride=Math.floor(600/n);an.getByteTimeDomainData(d);for(let j=0;j<n;j++)waveBuf[j]=(d[j*stride]-128)/128*1.6;return waveBuf.subarray(0,n)};
+ // One frame: the tune moves on by the time that passed (a third of it in slow motion), the heights follow it (or the real
+ // sound), and the sound is scheduled a little ahead
+ function frame(dt){
+ if(!rows)return;
+ const rate=slowTog.checked?1/3:1;clock+=dt/1000*rate;song=clock%LOOP;
+ // the real sound only once the browser plays it: a context it holds back (no sound device, or no permission) leaves the bars
+ // on the tune's own heights
+ let freq=null;if(audio&&audio.ctx.state==='running'){freq=audio.freq||(audio.freq=new Uint8Array(audio.an.frequencyBinCount));audio.an.getByteFrequencyData(freq);schedule()}
+ for(const row of Object.values(rows))settle(row,aim(row,song,freq),dt*rate);
+ draw();
+ }
+ function loop(ts){
+ raf=requestAnimationFrame(loop);
+ if(lastT===null){lastT=ts;return}
+ const dt=Math.min(ts-lastT,50);lastT=ts;frame(dt);
+ }
+ function start(){if(raf||paused)return;lastT=null;raf=requestAnimationFrame(loop)}
+ // Hear it: the same tune played by the browser (oscillators and a burst of generated noise), made only on this press; the bars
+ // then follow a real analyzer. Pause and a hidden tab suspend the sound; slow motion plays it at a third of the tempo.
+ // The browser answers a start, stop or close with a promise that can fail (a context already closed): nothing to report then
+ const quiet=p=>{if(p&&p.catch)p.catch(()=>{})};
+ function startAudio(){
+ const ac=new (window.AudioContext||window.webkitAudioContext)(),an=ac.createAnalyser(),out=ac.createGain();
+ an.fftSize=2048;an.smoothingTimeConstant=.5;out.gain.value=.45;out.connect(an);an.connect(ac.destination);
+ const noise=ac.createBuffer(1,ac.sampleRate,ac.sampleRate),d=noise.getChannelData(0);for(let i=0;i<d.length;i++)d[i]=Math.random()*2-1;
+ audio={ctx:ac,an,out,noise,upTo:clock};
+ quiet(ac.resume());
+ }
+ function play(kind,at,f,len){
+ const {ctx:ac,out,noise}=audio,g=ac.createGain();g.connect(out);
+ const env=(peak,dur)=>{g.gain.setValueAtTime(peak,at);g.gain.exponentialRampToValueAtTime(.001,at+dur)};
+ if(kind==='kick'){const o=ac.createOscillator();o.frequency.setValueAtTime(150,at);o.frequency.exponentialRampToValueAtTime(45,at+.12);env(1,.35);o.connect(g);o.start(at);o.stop(at+.4)}
+ else if(kind==='snare'||kind==='hats'){const s=ac.createBufferSource(),fl=ac.createBiquadFilter();s.buffer=noise;fl.type=kind==='hats'?'highpass':'bandpass';
+ fl.frequency.value=kind==='hats'?7000:1800;env(kind==='hats'?.25:.6,kind==='hats'?.05:.18);s.connect(fl);fl.connect(g);s.start(at);s.stop(at+.3)}
+ else{const o=ac.createOscillator();o.type=kind==='bass'?'sawtooth':'triangle';o.frequency.value=f;env(kind==='bass'?.3:.2,len);o.connect(g);o.start(at);o.stop(at+len+.05)}
+ }
+ // Every note whose time falls in the next tenth of a second of the tune is handed to the browser, at the time it should sound;
+ // clock is the tune's time counted on, past the end of the loop
+ function schedule(){
+ // notes that came and went while the context was held back are dropped, never played all at once
+ const rate=slowTog.checked?1/3:1,{ctx:ac}=audio,from=Math.max(audio.upTo,clock-.02),to=clock+.1;
+ if(to<=from)return;
+ const each=(b,fn)=>{const s0=b*BEAT;for(let o=s0+Math.floor((from-s0)/LOOP)*LOOP;o<to;o+=LOOP)if(o>=from)fn(Math.max(ac.currentTime,ac.currentTime+(o-clock)/rate))};
+ for(const [list,kind] of [[KICK,'kick'],[SNARE,'snare'],[HATS,'hats']])for(const b of list)each(b,at=>play(kind,at,0,0));
+ for(const [list,kind] of [[BASS,'bass'],[MELODY,'melody']])for(const [b,l,f] of list)each(b,at=>play(kind,at,f,l*BEAT/rate*.9));
+ audio.upTo=to;
+ }
+ hear.addEventListener('click',()=>{
+ if(audio){quiet(audio.ctx.close());audio=null;hear.setAttribute('aria-pressed','false');if(paused)draw();return}
+ if(paused)pauseBtn.click(); // the sound follows the loop, so Hear it pressed while paused plays both
+ try{startAudio();hear.setAttribute('aria-pressed','true')}catch(err){audio=null}
+ });
+ // Registered at the top level: under reduced motion the shared script pauses the loop at once, on a kick
+ document.addEventListener('hb:pause',e=>{
+ paused=e.detail.paused;notes();
+ if(audio)quiet(paused?audio.ctx.suspend():audio.ctx.resume());
+ if(paused){cancelAnimationFrame(raf);raf=0;if(rows)draw()}else start();
+ });
+ document.addEventListener('visibilitychange',()=>{lastT=null;if(audio)quiet(document.hidden?audio.ctx.suspend():paused||audio.ctx.resume())});
+ // The mode switch draws the mode at once, playing or paused
+ document.addEventListener('hb:mode',e=>{mode=e.detail.mode;notes();place();if(rows)draw()});
+ // See inside's beat strip sits under the key, which wraps onto more lines in a narrow box
+ function place(){insideTop=stage.querySelector('.key').offsetHeight+20;stage.style.setProperty('--beat-y',insideTop+2+'px');stage.style.setProperty('--l2-y',layout().l2+'px')}
+ // The words follow the view, the style, the loop and reduced motion: with Wave both rows of Compare match and See inside shows the
+ // parts of the wave; Circle runs from the bass at the top round to the hi-hats; "Shown still" only while the loop is paused under
+ // reduced motion (also when the device's setting changes after load); the box's name says "held still" while it is paused
+ const insideEl=document.querySelector('[data-hb-for="inside"]'),compareEl=document.querySelector('[data-hb-for="compare"]');
+ const said={inside:insideEl.textContent,compare:compareEl.textContent};
+ const setText=(el,t)=>{if(el.textContent!==t)el.textContent=t};
+ function notes(){
+ const still=reduceMQ.matches&&paused,ring=style==='circle';
+ setText(insideEl,style==='wave'?'Inside, each thin colored line is one part of the tune, and the thick line is all of them added together: the shape a speaker moves to.'
+ :still?`Shown still: each bar is split by the parts of the tune filling it, ${ring?'kick and bass at the top, round to the hi-hats':'kick and bass on the left, hi-hats on the right'}. The top strip marks the beat.`
+ :ring?said.inside.replace('on the left, hi-hats on the right','at the top, round to the hi-hats'):said.inside);
+ setText(compareEl,style==='wave'?'Style is set to Wave, which draws the sound\'s shape, not its pitches, so Equal slices and Wider for treble match. Pick Bars or Circle in Try it to see the difference.'
+ :still?`Shown still: Equal slices crowds the bass into a few bars, while Wider for treble spreads the tune across the whole ${ring?'ring':'row'}.`
+ :ring?said.compare.replace('whole row dances','whole ring dances'):said.compare);
+ cvs.setAttribute('aria-label',NAMES[mode][style]+(paused?', held still':mode==='normal'?(style==='wave'?', moving to a beat':', jumping to a beat and sinking back'):''));
+ }
+ reduceMQ.addEventListener('change',notes);
+ function resize(){
+ const w=stage.clientWidth,h=stage.clientHeight;if(!w||!h||(w===W&&h===H))return;W=w;H=h;
+ const dpr=Math.min(devicePixelRatio||1,1.5);cvs.width=W*dpr;cvs.height=H*dpr;ctx.setTransform(dpr,0,0,dpr,0,0);
+ if(!rows)build();
+ place();draw();
+ }
+ // A setting shows at once, playing or paused
+ function choices(id,pick){
+ const buttons=document.querySelectorAll('#'+id+' button');
+ buttons.forEach(b=>b.addEventListener('click',()=>{
+ buttons.forEach(x=>{x.classList.toggle('on',x===b);x.setAttribute('aria-pressed',String(x===b))});
+ pick(b.dataset);notes();if(rows)draw();
+ }));
+ }
+ choices('style-seg',d=>{style=d.style;stage.classList.toggle('st-bars',style==='bars')});
+ choices('bars-seg',d=>{count=+d.n;build()});
+ choices('fall-seg',d=>{fall=+d.fall});
+ choices('colors-seg',d=>{pal=d.pal});
+ peakTog.addEventListener('change',()=>{if(rows)draw()});
+ notes();
+ new ResizeObserver(resize).observe(stage);
+ resize();
+ start();
+</script>
+</body>
+</html>
diff --git a/animations/06-3d-advanced/water-ripple/index.html b/animations/06-3d-advanced/water-ripple/index.html
index 1bdd6754..b782c8ab 100644
--- a/animations/06-3d-advanced/water-ripple/index.html
+++ b/animations/06-3d-advanced/water-ripple/index.html
@@ -49,7 +49,7 @@
<body class="hb" data-hb-kind="do" data-hb-autoplay>
<nav class="hb-bar" aria-label="Animation Handbook">
<a class="hb-home" href="../../../"><svg class="hb-mark" viewBox="0 0 32 32" aria-hidden="true"><g class="g"><circle cx="11.16" cy="20.84" r="6.1"/><circle cx="15.12" cy="16.88" r="6.1"/><circle cx="18.51" cy="13.49" r="6.1"/></g><circle class="b" cx="21.2" cy="10.8" r="6.6"/></svg><span>Animation Handbook</span></a>
- <span class="hb-pager"><a href="../infinite-zoom/" rel="prev" aria-label="Previous: Infinite Zoom"><svg class="hb-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg><span><span class="hb-dir">Previous: </span>Infinite Zoom</span></a></span>
+ <span class="hb-pager"><a href="../infinite-zoom/" rel="prev" aria-label="Previous: Infinite Zoom"><svg class="hb-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg><span><span class="hb-dir">Previous: </span>Infinite Zoom</span></a><a href="../audio-visualizer/" rel="next" aria-label="Next: Audio Visualizer"><span><span class="hb-dir">Next: </span>Audio Visualizer</span><svg class="hb-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></a></span>
<a class="hb-star" href="https://github.com/matinmonshizadeh/animation-handbook" target="_blank" rel="noopener" aria-label="Star on GitHub"><svg class="hb-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1-4.4-4.3 6.1-.9z"/></svg><span>Star on GitHub</span></a>
</nav>
<main class="hb-page">
diff --git a/animations/07-ambient-background/abstract-geometric-motion/README.md b/animations/07-ambient-background/abstract-geometric-motion/README.md
index 71fd60e9..369908ec 100644
--- a/animations/07-ambient-background/abstract-geometric-motion/README.md
+++ b/animations/07-ambient-background/abstract-geometric-motion/README.md
@@ -89,3 +89,4 @@ ctx.setLineDash([]);
- [Ambient Ripple Effect](../ambient-ripple/) — rings spreading from a few spots, on their own
- [WebGL Shader Animation](../../06-3d-advanced/webgl-shader-animation/) — patterns drawn by the graphics card
- [Noise-Based Motion](../../06-3d-advanced/noise-based-motion/) — smooth, natural-looking random motion
+- [Audio Visualizer](../../06-3d-advanced/audio-visualizer/) — bars that move to the music, from bass to treble
diff --git a/index.html b/index.html
index 939dbdff..217c5838 100644
--- a/index.html
+++ b/index.html
@@ -4,8 +4,8 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="google-site-verification" content="2PnJemecfPix7j08I3cojuzPTfwKpwxxFMADFxv4wk8">
-<title>Animation Handbook — 172 Web Animation Techniques with Live Demos</title>
-<meta name="description" content="A free visual reference of 172 web animation techniques, from scroll effects to 3D: each plays live and comes with a ready-made prompt for your AI assistant.">
+<title>Animation Handbook — 173 Web Animation Techniques with Live Demos</title>
+<meta name="description" content="A free visual reference of 173 web animation techniques, from scroll effects to 3D: each plays live and comes with a ready-made prompt for your AI assistant.">
<meta name="keywords" content="web animation, CSS animation, animation examples, scroll animation, page transitions, micro-interactions, kinetic typography, WebGL, frontend animation reference, motion design, animation handbook">
<meta name="author" content="Matin Monshizadeh">
<meta name="robots" content="index, follow, max-image-preview:large">
@@ -19,8 +19,8 @@
<!-- Open Graph -->
<meta property="og:type" content="website">
<meta property="og:site_name" content="Animation Handbook">
-<meta property="og:title" content="Animation Handbook — 172 Web Animation Techniques with Live Demos">
-<meta property="og:description" content="A free visual reference of 172 web animation techniques, from scroll effects to 3D: each plays live and comes with a ready-made prompt for your AI assistant.">
+<meta property="og:title" content="Animation Handbook — 173 Web Animation Techniques with Live Demos">
+<meta property="og:description" content="A free visual reference of 173 web animation techniques, from scroll effects to 3D: each plays live and comes with a ready-made prompt for your AI assistant.">
<meta property="og:url" content="https://matinmonshizadeh.github.io/animation-handbook/">
<meta property="og:image" content="https://matinmonshizadeh.github.io/animation-handbook/og-image.png">
<meta property="og:image:width" content="1200">
@@ -28,8 +28,8 @@
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image">
-<meta name="twitter:title" content="Animation Handbook — 172 Web Animation Techniques with Live Demos">
-<meta name="twitter:description" content="A free visual reference of 172 web animation techniques, from scroll effects to 3D: each plays live and comes with a ready-made prompt for your AI assistant.">
+<meta name="twitter:title" content="Animation Handbook — 173 Web Animation Techniques with Live Demos">
+<meta name="twitter:description" content="A free visual reference of 173 web animation techniques, from scroll effects to 3D: each plays live and comes with a ready-made prompt for your AI assistant.">
<meta name="twitter:image" content="https://matinmonshizadeh.github.io/animation-handbook/og-image.png">
<!-- Structured data: parsed by search + AI answer engines -->
@@ -39,7 +39,7 @@
"@type": "WebSite",
"name": "Animation Handbook",
"url": "https://matinmonshizadeh.github.io/animation-handbook/",
- "description": "A free visual reference of 172 web animation techniques, from scroll effects to 3D: each plays live and comes with a ready-made prompt for your AI assistant.",
+ "description": "A free visual reference of 173 web animation techniques, from scroll effects to 3D: each plays live and comes with a ready-made prompt for your AI assistant.",
"inLanguage": "en",
"author": { "@type": "Person", "name": "Matin Monshizadeh" },
"about": ["web animation", "CSS animation", "motion design", "frontend development"],
@@ -1286,6 +1286,11 @@ button,input{font:inherit;color:inherit}
.pv-waterripple .a{left:36%;top:46%}.pv-waterripple .b{left:64%;top:58%;animation-delay:-1.5s}.pv-waterripple .r2{animation-delay:-.6s}.pv-waterripple .b.r2{animation-delay:-2.1s}
@keyframes waterripple-ring{0%{opacity:.9;transform:translate(-50%,-50%) scale(.05)}100%{opacity:0;transform:translate(-50%,-50%) scale(1)}}
+.pv-audioviz{background:radial-gradient(80% 70% at 50% 100%,#1a1430,#08080c 70%);display:flex;align-items:flex-end;justify-content:center;gap:2.2%;padding:0 9% 12%;overflow:hidden}
+.pv-audioviz i{flex:1;height:68%;border-radius:2px 2px 0 0;background:linear-gradient(0deg,#ff5f6d,#ffc371);transform-origin:50% 100%;transform:scaleY(.15);
+ animation:audioviz-bar .6s cubic-bezier(.2,.6,.4,1) infinite}
+@keyframes audioviz-bar{0%{transform:scaleY(var(--hi,.9))}100%{transform:scaleY(.12)}}
+
/* ── bespoke: 07 Ambient & Background ── */
.pv-grain2{background:radial-gradient(circle at 50% 40%,#1a1710,#08080a);overflow:hidden}
.pv-grain2 .g{position:absolute;inset:-50%;opacity:.5;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E");animation:d-grain .5s steps(4) infinite}
@@ -1703,7 +1708,7 @@ button,input{font:inherit;color:inherit}
<section class="wrap home-hero" aria-labelledby="hero-title">
<span class="float fl1" aria-hidden="true"></span><span class="float fl2" aria-hidden="true"></span><span class="float fl3" aria-hidden="true"></span>
<span class="float fl4" aria-hidden="true"></span><span class="float fl5" aria-hidden="true"></span><span class="float fl6" aria-hidden="true"></span>
- <p class="pill"><span class="pill-dot" aria-hidden="true"></span>172 free animations · no coding needed</p>
+ <p class="pill"><span class="pill-dot" aria-hidden="true"></span>173 free animations · no coding needed</p>
<h1 class="h1" id="hero-title">What do you want to animate?</h1>
<p class="sub">Pick a place, or describe it in your own words. Every animation plays live, and each one comes with a ready-made prompt for your AI assistant.</p>
<form class="search" id="search-form" role="search" action="./" method="get">
@@ -1768,14 +1773,14 @@ button,input{font:inherit;color:inherit}
<p class="empty-s">Try a simpler word, or pick one of these:</p>
<p class="pop"><button type="button" data-q="fade in">fade in</button><button type="button" data-q="typing text">typing text</button><button type="button" data-q="loading spinner">loading spinner</button><button type="button" data-q="parallax">parallax</button><button type="button" data-q="confetti">confetti</button></p>
</div>
- <div class="more" id="more"><button type="button" class="bigbtn" id="more-btn"><span id="more-label">Browse all 172 animations</span><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M6 13l6 6 6-6"/></svg></button></div>
+ <div class="more" id="more"><button type="button" class="bigbtn" id="more-btn"><span id="more-label">Browse all 173 animations</span><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M6 13l6 6 6-6"/></svg></button></div>
<div class="fd-not" id="find-not" hidden>
<h3 class="fd-not-t">Not here?</h3>
<p class="fd-not-s" id="find-not-s">Tell us what you saw. We use it to add the animation or to fix the finder.</p>
<p class="fd-not-acts"><a class="fd-btn" id="find-gh" href="https://github.com/matinmonshizadeh/animation-handbook/issues/new?template=animation_not_here.yml" target="_blank" rel="noopener">Tell us on GitHub</a><button type="button" class="pillbtn" id="find-words">Describe it in words</button></p>
<p class="fd-fine">The form is on GitHub and needs a free account.</p>
</div>
- <noscript><p class="noscript">This page shows its animations with JavaScript. All 172 are still easy to reach: see the <a href="https://github.com/matinmonshizadeh/animation-handbook#categories">category list on GitHub</a> or the <a href="sitemap.xml">full sitemap</a>. Each demo is a page of its own under <code>/animations/&lt;category&gt;/&lt;name&gt;/</code>.</p></noscript>
+ <noscript><p class="noscript">This page shows its animations with JavaScript. All 173 are still easy to reach: see the <a href="https://github.com/matinmonshizadeh/animation-handbook#categories">category list on GitHub</a> or the <a href="sitemap.xml">full sitemap</a>. Each demo is a page of its own under <code>/animations/&lt;category&gt;/&lt;name&gt;/</code>.</p></noscript>
</section>
<section class="how" id="how" aria-labelledby="how-title">
@@ -1793,7 +1798,7 @@ button,input{font:inherit;color:inherit}
<footer class="wrap foot">
<a class="brand" href="./"><svg class="mark" viewBox="0 0 32 32" aria-hidden="true"><circle class="ring" cx="11.16" cy="20.84" r="6.1"/><circle class="ring" cx="15.12" cy="16.88" r="6.1"/><circle class="ring" cx="18.51" cy="13.49" r="6.1"/><circle class="ball" cx="21.2" cy="10.8" r="6.6"/></svg><span>Animation Handbook</span></a>
- <p class="foot-t">172 web animations with live demos and copyable prompts.</p>
+ <p class="foot-t">173 web animations with live demos and copyable prompts.</p>
<nav class="nav" aria-label="Footer"><a class="lnk" href="famous/">Famous effects</a><a class="lnk" href="https://github.com/matinmonshizadeh/animation-handbook" target="_blank" rel="noopener">GitHub</a><a class="lnk" href="#top">Back to top</a></nav>
</footer>
<div class="toast" id="toast" role="status" aria-live="polite"><span class="ok" aria-hidden="true"><svg class="i" viewBox="0 0 24 24"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg></span><span class="toast-t"></span></div>
@@ -1998,6 +2003,7 @@ const CATS=[
['holographic-card','Holographic Card','A card tilts as you point, and its rainbow foil shimmers. Best for collectibles.'],
['infinite-zoom','Infinite Zoom','The view keeps zooming into pictures inside pictures. Best for page intros.'],
['water-ripple','Water Ripple','Ripples spread from your finger and bend the picture below. Best for hero images.'],
+ ['audio-visualizer','Audio Visualizer','Bars dance to the music, from bass to treble. Best for music players.'],
]
},
{
@@ -2043,7 +2049,7 @@ const PV={
'typing-indicator':'typing',
'hold-to-confirm':'holdconf','expanding-search':'xsearch','button-loading-states':'btnload',
'image-trail':'imgtrail','gooey-menu':'gooey','dynamic-island':'dynisland','before-after-slider':'beforeafter','magnifier-lens':'magnifier','card-deck-swipe':'deckswipe',
- 'flip-card-3d':'flip3d','carousel-3d':'carousel3d','depth-map-photo':'depthmap','flocking':'flock','ascii-halftone':'ascii','physics-2d':'phys2d','liquid-glass':'liquidglass','holographic-card':'holo','infinite-zoom':'izoom','water-ripple':'waterripple','matrix-rain':'matrix','plasma':'plasmapv',
+ 'flip-card-3d':'flip3d','carousel-3d':'carousel3d','depth-map-photo':'depthmap','flocking':'flock','ascii-halftone':'ascii','physics-2d':'phys2d','liquid-glass':'liquidglass','holographic-card':'holo','infinite-zoom':'izoom','water-ripple':'waterripple','audio-visualizer':'audioviz','matrix-rain':'matrix','plasma':'plasmapv',
'wave-layers':'wavelayers','snow-rain':'snowrain','fireworks':'fireworks',
'topographic-lines':'topo','light-rays':'rays','game-of-life':'life',
'parallax-depth-of-field':'dof','parallax-scrolling':'plx','reverse-scrolling-columns':'revcol',
@@ -2239,6 +2245,7 @@ const PLACES={
'holographic-card':['imgcard'],
'infinite-zoom':['intro','bg'],
'water-ripple':['bg','imgcard'],
+ 'audio-visualizer':['imgcard','bg'],
// 07
'animated-gradient-background':['bg'],
'mesh-gradient':['bg'],
@@ -2421,6 +2428,7 @@ const FIND={
'holographic-card':['card','hover drag','color turn follow'],
'infinite-zoom':['card background page','loop scroll load','grow'],
'water-ripple':['background card','drag click hover','wave'],
+ 'audio-visualizer':['shape background','loop','bounce grow'],
// 07
'animated-gradient-background':['background','loop','color drift'],
'mesh-gradient':['background','loop','color drift morph'],
@@ -2545,6 +2553,7 @@ function pvMarkup(k){
case 'holo': return '<span class="hc anim"><i class="cr"></i><i class="fo anim"></i><i class="gl anim"></i><i class="np"></i><i class="ip"></i></span>';
case 'izoom': return '<i class="g anim"></i><i class="d anim"></i><i class="t anim"></i><i class="l anim"></i><i class="p anim"></i>';
case 'waterripple': return '<i class="a anim"></i><i class="a r2 anim"></i><i class="b anim"></i><i class="b r2 anim"></i>';
+ case 'audioviz': return [[.95,.6,0],[.9,.6,0],[.82,.6,0],[.7,.6,0],[.55,.45,-.1],[.62,.9,-.3],[.5,.3,-.05],[.58,1.2,-.4],[.45,.45,-.2],[.4,.3,-.15],[.5,.6,-.3],[.35,.3,0]].map(([h,d,o])=>'<i class="anim" style="--hi:'+h+';animation-duration:'+d+'s;animation-delay:'+o+'s"></i>').join('');
case 'carousel3d': return '<div class="sc"><div class="tl"><div class="rg anim">'+[0,1,2,3,4,5].map(k=>'<i style="--k:'+k+'"></i>').join('')+'</div></div></div>';
case 'depthmap': return [['sun',-.4],['mt',-.2],['hl',.05],['md',.25],['tr',.45],['gd',.55]].map(([c,k])=>'<i class="'+c+' anim" style="--k:'+k+'"></i>').join('');
case 'flock': return '<span class="fk anim">'+[[0,18,0],[-10,6,-.3],[9,5,-.7],[-20,-5,-1.1],[1,-4,-.5],[17,-8,-.9],[-8,-17,-.2],[10,-20,-1.2],[-1,-29,-.6]].map(function(b){return '<i class="anim" style="--x:'+b[0]+'%;--y:'+b[1]+'%;--d:'+b[2]+'s"></i>';}).join('')+'</span>';
diff --git a/llms.txt b/llms.txt
index 8b2647e3..862166f6 100644
--- a/llms.txt
+++ b/llms.txt
@@ -1,8 +1,8 @@
# Animation Handbook
-> A visual reference of 172 web animation techniques, each with a live demo and a plain-words prompt for building it with an AI assistant.
+> A visual reference of 173 web animation techniques, each with a live demo and a plain-words prompt for building it with an AI assistant.
-Each page plays one technique live and gives a ready-made prompt that describes it in plain words, with no code. Most pages also have a few plain settings, such as speed or direction, and the prompt you copy lists your choices. Each technique's folder on GitHub has a README on how it works, the values that matter and production notes. To give an AI coding assistant all 172 prompts and settings at once, install the Agent Skill: `npx skills add matinmonshizadeh/animation-handbook`.
+Each page plays one technique live and gives a ready-made prompt that describes it in plain words, with no code. Most pages also have a few plain settings, such as speed or direction, and the prompt you copy lists your choices. Each technique's folder on GitHub has a README on how it works, the values that matter and production notes. To give an AI coding assistant all 173 prompts and settings at once, install the Agent Skill: `npx skills add matinmonshizadeh/animation-handbook`.
## Scroll-Based
@@ -170,6 +170,7 @@ Each page plays one technique live and gives a ready-made prompt that describes
- [Holographic Card](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/holographic-card/): A card tilts as you point, and its rainbow foil shimmers. Best for collectibles.
- [Infinite Zoom](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/infinite-zoom/): The view keeps zooming into pictures inside pictures. Best for page intros.
- [Water Ripple](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/water-ripple/): Ripples spread from your finger and bend the picture below. Best for hero images.
+- [Audio Visualizer](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/audio-visualizer/): Bars dance to the music, from bass to treble. Best for music players.
## Ambient & Background
@@ -204,13 +205,13 @@ Each page plays one technique live and gives a ready-made prompt that describes
## Skill files
- [SKILL.md](https://matinmonshizadeh.github.io/animation-handbook/skills/animation-handbook/SKILL.md): how to find a technique, choose its settings for the user's page and build it, with the rules for real pages
-- [references/catalog.md](https://matinmonshizadeh.github.io/animation-handbook/skills/animation-handbook/references/catalog.md): all 172 in one list, with what each does and where it goes, and an index by place
+- [references/catalog.md](https://matinmonshizadeh.github.io/animation-handbook/skills/animation-handbook/references/catalog.md): all 173 in one list, with what each does and where it goes, and an index by place
- [references/01-scroll-based.md](https://matinmonshizadeh.github.io/animation-handbook/skills/animation-handbook/references/01-scroll-based.md): the 27 Scroll-Based entries, each with its prompt and its settings, with the demo's values
- [references/02-entrance-and-exit.md](https://matinmonshizadeh.github.io/animation-handbook/skills/animation-handbook/references/02-entrance-and-exit.md): the 15 Entrance & Exit entries, each with its prompt and its settings, with the demo's values
- [references/03-page-transitions.md](https://matinmonshizadeh.github.io/animation-handbook/skills/animation-handbook/references/03-page-transitions.md): the 17 Page Transitions entries, each with its prompt and its settings, with the demo's values
- [references/04-micro-interactions.md](https://matinmonshizadeh.github.io/animation-handbook/skills/animation-handbook/references/04-micro-interactions.md): the 44 Micro-Interactions entries, each with its prompt and its settings, with the demo's values
- [references/05-text-typography.md](https://matinmonshizadeh.github.io/animation-handbook/skills/animation-handbook/references/05-text-typography.md): the 19 Text & Typography entries, each with its prompt and its settings, with the demo's values
-- [references/06-3d-advanced.md](https://matinmonshizadeh.github.io/animation-handbook/skills/animation-handbook/references/06-3d-advanced.md): the 27 3D & Advanced entries, each with its prompt and its settings, with the demo's values
+- [references/06-3d-advanced.md](https://matinmonshizadeh.github.io/animation-handbook/skills/animation-handbook/references/06-3d-advanced.md): the 28 3D & Advanced entries, each with its prompt and its settings, with the demo's values
- [references/07-ambient-background.md](https://matinmonshizadeh.github.io/animation-handbook/skills/animation-handbook/references/07-ambient-background.md): the 23 Ambient & Background entries, each with its prompt and its settings, with the demo's values
## Optional
diff --git a/og-image.png b/og-image.png
index 7d983467..4759bceb 100644
Binary files a/og-image.png and b/og-image.png differ
diff --git a/sitemap.xml b/sitemap.xml
index c3c7af7b..5feea1c0 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -151,6 +151,7 @@
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/holographic-card/</loc><lastmod>2026-10-15</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/infinite-zoom/</loc><lastmod>2026-10-17</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/water-ripple/</loc><lastmod>2026-10-17</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
+ <url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/audio-visualizer/</loc><lastmod>2026-10-17</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/animated-gradient-background/</loc><lastmod>2026-10-15</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/mesh-gradient/</loc><lastmod>2026-10-15</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/aurora/</loc><lastmod>2026-10-15</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
@@ -162,7 +163,7 @@
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/ambient-ripple/</loc><lastmod>2026-10-17</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/floating-elements/</loc><lastmod>2026-10-15</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/grid-dot-pattern-parallax/</loc><lastmod>2026-10-15</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
- <url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/abstract-geometric-motion/</loc><lastmod>2026-10-15</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
+ <url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/abstract-geometric-motion/</loc><lastmod>2026-10-17</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/particle-constellation/</loc><lastmod>2026-10-15</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/flow-field/</loc><lastmod>2026-10-15</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/synthwave-grid/</loc><lastmod>2026-10-15</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
diff --git a/skills/animation-handbook/SKILL.md b/skills/animation-handbook/SKILL.md
index c719f5e0..3c7dac83 100644
--- a/skills/animation-handbook/SKILL.md
+++ b/skills/animation-handbook/SKILL.md
@@ -1,12 +1,12 @@
---
name: animation-handbook
-description: Builds web animations from Animation Handbook, a set of 172 tested techniques with plain-words build prompts and settings (scroll effects, entrances and exits, page transitions, micro-interactions for buttons and forms, text effects, 3D and WebGL, ambient backgrounds). Use when the user asks to add, pick or improve an animation, transition, hover or click effect, loading state, scroll effect or background motion in a web page or web app, in any framework or plain HTML, CSS and JavaScript.
+description: Builds web animations from Animation Handbook, a set of 173 tested techniques with plain-words build prompts and settings (scroll effects, entrances and exits, page transitions, micro-interactions for buttons and forms, text effects, 3D and WebGL, ambient backgrounds). Use when the user asks to add, pick or improve an animation, transition, hover or click effect, loading state, scroll effect or background motion in a web page or web app, in any framework or plain HTML, CSS and JavaScript.
license: MIT
---
# Animation Handbook
-[Animation Handbook](https://matinmonshizadeh.github.io/animation-handbook/) is a free reference of 172 web animation techniques. Each has a live demo, a few plain settings for most (speed, direction, color and the like) and a prompt that says in plain words how to build it. This skill holds every prompt and every setting with the demo's values.
+[Animation Handbook](https://matinmonshizadeh.github.io/animation-handbook/) is a free reference of 173 web animation techniques. Each has a live demo, a few plain settings for most (speed, direction, color and the like) and a prompt that says in plain words how to build it. This skill holds every prompt and every setting with the demo's values.
## How to use it
@@ -36,13 +36,13 @@ Keep these even where a prompt does not say them, and follow them where a prompt
## Where to look
-- [references/catalog.md](references/catalog.md): all 172 in one list, grouped by category, with an index by place.
+- [references/catalog.md](references/catalog.md): all 173 in one list, grouped by category, with an index by place.
- [references/01-scroll-based.md](references/01-scroll-based.md): Scroll-Based, 27 animations. Animations driven by scroll position — parallax, sticky, scrub, snap, and storytelling.
- [references/02-entrance-and-exit.md](references/02-entrance-and-exit.md): Entrance & Exit, 15 animations. Element-level animations for arriving and departing — fades, slides, reveals, flips, and text staggers.
- [references/03-page-transitions.md](references/03-page-transitions.md): Page Transitions, 17 animations. Full-page transitions between routes or views — crossfades, slides, portals, morphs, and the View Transitions API.
- [references/04-micro-interactions.md](references/04-micro-interactions.md): Micro-Interactions, 44 animations. Short, user-triggered animations — hover, click, focus, loading states, and UI feedback patterns.
- [references/05-text-typography.md](references/05-text-typography.md): Text & Typography, 19 animations. Animations specifically for type — kinetic motion, character-level effects, gradient flows, and word transformations.
-- [references/06-3d-advanced.md](references/06-3d-advanced.md): 3D & Advanced, 27 animations. WebGL, shaders, particles, 3D transforms, simulations, and other heavier effects.
+- [references/06-3d-advanced.md](references/06-3d-advanced.md): 3D & Advanced, 28 animations. WebGL, shaders, particles, 3D transforms, simulations, and other heavier effects.
- [references/07-ambient-background.md](references/07-ambient-background.md): Ambient & Background, 23 animations. Passive, looping effects that hold visual interest without demanding attention — gradients, particles, grain, and glows.
Each live demo address is also the technique's folder in https://github.com/matinmonshizadeh/animation-handbook; read its README (the address followed by README.md) only when the user asks how a technique works.
diff --git a/skills/animation-handbook/references/06-3d-advanced.md b/skills/animation-handbook/references/06-3d-advanced.md
index 07a6dccb..a1a23530 100644
--- a/skills/animation-handbook/references/06-3d-advanced.md
+++ b/skills/animation-handbook/references/06-3d-advanced.md
@@ -1,6 +1,6 @@
# 06 · 3D & Advanced
-WebGL, shaders, particles, 3D transforms, simulations, and other heavier effects. 27 animations from Animation Handbook, in the home page's order. Each entry gives the live demo, how it runs, what it is good for and what to avoid it on, the prompt from its page word for word, and its settings with what each does and the demo's values.
+WebGL, shaders, particles, 3D transforms, simulations, and other heavier effects. 28 animations from Animation Handbook, in the home page's order. Each entry gives the live demo, how it runs, what it is good for and what to avoid it on, the prompt from its page word for word, and its settings with what each does and the demo's values.
## Contents
@@ -31,6 +31,7 @@ WebGL, shaders, particles, 3D transforms, simulations, and other heavier effects
- [Holographic Card](#holographic-card)
- [Infinite Zoom](#infinite-zoom)
- [Water Ripple](#water-ripple)
+- [Audio Visualizer](#audio-visualizer)
## 3D Model Orbit
@@ -592,3 +593,24 @@ Add a water ripple effect to [the picture you want to look as if it lies under w
- How long ripples last: Short · **Medium** · Long. How much height the water loses each step: short is 5%, which fades a pebble's rings within a second; medium 2.2%, about three seconds; long 0.9%, long enough for rings to bounce off the edges and cross.
- Bend: Subtle · **Medium** · Strong. How far the picture under a slope is shifted: subtle is 5 grid points for a full slope, medium 12 and strong 22.
- Light on the waves: **on** · off. Slopes that face the light show a lighter picture, in three steps of brightness; off, only the bending shows.
+
+## Audio Visualizer
+
+Bars dance to the music, from bass to treble. Best for music players.
+
+- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/audio-visualizer/
+- How it runs: moves by itself
+- Good for: Music players · Podcast pages · Radio and DJ sites · Voice notes
+- Avoid on: Pages without sound · Reading pages
+
+**Prompt**
+
+Add an audio visualizer to [your music player, podcast card or hero section]. Connect the playing audio to an analyzer that reports, many times a second, how loud each band of pitches is, and draw the bands on a canvas from bass to treble, in the style the settings choose, each sized by its loudness. Give higher bands wider slices of pitch, as hearing does, so the whole row moves. Let bands jump up at once and sink back as the settings choose. Start sound only when the visitor presses play, never use the microphone without asking, and draw fewer bars on phones. If the visitor has reduced motion turned on, keep the bars still until they press play. Match the settings listed below.
+
+**Settings** (the choice in bold is where the demo starts; each line ends with what the setting does, with the demo's values):
+
+- Style: **Bars** · Wave · Circle. Bars stand in a row from bass to treble; wave draws the sound's shape over a few hundredths of a second instead of its pitches; circle sets the bars around a ring that swells with the bass.
+- Number of bars: Few · Some · **Many** (phones start with Some). Few is 16 bars, some 32 and many 64; phones start at some, and each row of Compare holds half as many bars on phones; a wave has no bars, so it ignores this.
+- How bars fall: Quickly · **Gently** · Slowly. How fast a bar sinks after it jumps: quickly is 2.6 bar heights a second, gently 1.2 and slowly 0.45, like an old stereo; a wave ignores it.
+- Peak marks: **on** · off. A thin mark (a dot in the ring) holds each bar's highest point for 0.4 seconds, then sinks slowly; off, only the bars show; a wave has none.
+- Colors: **Sunset** · Ocean · Neon. The colors from the bottom of each bar to its top: sunset runs from coral to gold, ocean from deep blue to cyan, neon from pink to cyan; See inside lays the colors of the tune's parts over them.
diff --git a/skills/animation-handbook/references/catalog.md b/skills/animation-handbook/references/catalog.md
index fb7124d9..50d0b119 100644
--- a/skills/animation-handbook/references/catalog.md
+++ b/skills/animation-handbook/references/catalog.md
@@ -1,6 +1,6 @@
# Catalog
-All 172 animations of Animation Handbook, in the home page's order and grouped by category. Each line gives the name linked to its live demo, what it does and what it is best for, and its places (the parts of a page it suits, the main one first). The category folder in the address names the file that holds its full entry, with the prompt and the settings.
+All 173 animations of Animation Handbook, in the home page's order and grouped by category. Each line gives the name linked to its live demo, what it does and what it is best for, and its places (the parts of a page it suits, the main one first). The category folder in the address names the file that holds its full entry, with the prompt and the settings.
Contents: [01 · Scroll-Based](#01--scroll-based) · [02 · Entrance & Exit](#02--entrance--exit) · [03 · Page Transitions](#03--page-transitions) · [04 · Micro-Interactions](#04--micro-interactions) · [05 · Text & Typography](#05--text--typography) · [06 · 3D & Advanced](#06--3d--advanced) · [07 · Ambient & Background](#07--ambient--background) · [By place](#by-place)
@@ -153,7 +153,7 @@ Animations specifically for type — kinetic motion, character-level effects, gr
## 06 · 3D & Advanced
-WebGL, shaders, particles, 3D transforms, simulations, and other heavier effects. 27 animations, in [06-3d-advanced.md](06-3d-advanced.md).
+WebGL, shaders, particles, 3D transforms, simulations, and other heavier effects. 28 animations, in [06-3d-advanced.md](06-3d-advanced.md).
- [3D Model Orbit](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/3d-model-orbit/): A lit 3D shape spins, or turns to face your pointer. Best for product views. Places: Images & cards.
- [Scroll-Driven 3D Rotation](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/scroll-driven-3d-rotation/): Scrolling turns a 3D cube from pose to pose. Best for product tours. Places: Scrolling, Images & cards.
@@ -182,6 +182,7 @@ WebGL, shaders, particles, 3D transforms, simulations, and other heavier effects
- [Holographic Card](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/holographic-card/): A card tilts as you point, and its rainbow foil shimmers. Best for collectibles. Places: Images & cards.
- [Infinite Zoom](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/infinite-zoom/): The view keeps zooming into pictures inside pictures. Best for page intros. Places: Page intros, Backgrounds.
- [Water Ripple](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/water-ripple/): Ripples spread from your finger and bend the picture below. Best for hero images. Places: Backgrounds, Images & cards.
+- [Audio Visualizer](https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/audio-visualizer/): Bars dance to the music, from bass to treble. Best for music players. Places: Images & cards, Backgrounds.
## 07 · Ambient & Background
@@ -217,8 +218,8 @@ The home page's places, each with the animations that suit it.
- **Buttons** (22): Hover State Animation, Click / Tap Ripple, Button Press Scale, Magnetic Button, Toggle / Switch Slide, Heart / Like Burst, Success Confetti, Notification Badge Pulse, Tooltip Reveal, Modal Expand, Hamburger Menu Toggle, Theme Toggle Morph, Copy to Clipboard, Star Rating, Segmented Control, Animated Gradient Border, Spotlight Hover Glow, Add-to-Cart Fly, Hold to Confirm, Expanding Search, Button Loading States, Gooey Menu
- **Text** (27): Counter Animation, Text Fill on Scroll, Slide Up Reveal, Split Text Reveal, Letter-by-Letter Stagger, Word-by-Word Reveal, Rolling Numbers, Kinetic Typography, Typewriter Effect, Scramble / Glitch Text, Variable Font Morph, Text Clip-Path Reveal, Marquee / Ticker, Text Morphing, Text Gradient Animation, Outline to Fill, Enter/Exit Typography, Rotate Word Carousel, Glitch Text, Text on a Path, Wavy Text, Highlighter Sweep, Split-Flap Board, Neon Flicker, Handwriting Draw, Text Particles, Chromatic Aberration
-- **Images & cards** (50): Parallax Depth-of-Field, Parallax Scrolling, Reverse-Scrolling Columns, Stacking Cards, Snap Scrolling, Reveal on Scroll, Stagger Reveal, Horizontal Scroll, Zoom Into Image, Scroll Image Sequence, Scroll Velocity Skew, Clip-Path Reveal, Blur In, Flip In, Shatter Effect, Ink Spread Reveal, Shared Element Transition, Blur Transition, Dissolve Transition, FLIP Technique, Page Curl, Cube Transition, Pixelate Transition, Hover State Animation, Skeleton Loader, Modal Expand, Swipe to Dismiss, Animated Gradient Border, Spotlight Hover Glow, Image Trail, Before/After Slider, Magnifier Lens, Card Deck Swipe, 3D Model Orbit, Scroll-Driven 3D Rotation, Parallax 3D Tilt, Glassmorphism Animated, SVG Path Animation, 2.5D / Pseudo-3D, Image Distortion on Hover, Cloth / Soft-Body Simulation, 3D Flip Card, 3D Carousel, Depth-Map Photo, ASCII / Halftone, Liquid Glass, Holographic Card, Water Ripple, Grain / Film Noise Overlay, Light Leak
-- **Backgrounds** (40): Scroll-Driven Background Color, Cursor Follower, Neon Flicker, Canvas Particle Effect, Fluid / Liquid Simulation, Glassmorphism Animated, WebGL Shader Animation, Noise-Based Motion, Ray Marching / SDF Scene, GPGPU Particle System, Volumetric Smoke / 3D Noise, Morphing Blob, Flocking, ASCII / Halftone, 2D Physics, Infinite Zoom, Water Ripple, Animated Gradient Background, Mesh Gradient Animation, Aurora / Northern Lights, Grain / Film Noise Overlay, Scanline Effect, Light Leak, Starfield / Space Particles, Breathing / Pulsing Glow, Ambient Ripple Effect, Floating Elements, Grid / Dot Pattern Parallax, Abstract Geometric Motion, Particle Constellation, Flow Field, Synthwave Grid, Matrix Rain, Plasma Field, Wave Layers, Snow / Rain, Fireworks, Topographic Lines, Light Rays, Game of Life
+- **Images & cards** (51): Parallax Depth-of-Field, Parallax Scrolling, Reverse-Scrolling Columns, Stacking Cards, Snap Scrolling, Reveal on Scroll, Stagger Reveal, Horizontal Scroll, Zoom Into Image, Scroll Image Sequence, Scroll Velocity Skew, Clip-Path Reveal, Blur In, Flip In, Shatter Effect, Ink Spread Reveal, Shared Element Transition, Blur Transition, Dissolve Transition, FLIP Technique, Page Curl, Cube Transition, Pixelate Transition, Hover State Animation, Skeleton Loader, Modal Expand, Swipe to Dismiss, Animated Gradient Border, Spotlight Hover Glow, Image Trail, Before/After Slider, Magnifier Lens, Card Deck Swipe, 3D Model Orbit, Scroll-Driven 3D Rotation, Parallax 3D Tilt, Glassmorphism Animated, SVG Path Animation, 2.5D / Pseudo-3D, Image Distortion on Hover, Cloth / Soft-Body Simulation, 3D Flip Card, 3D Carousel, Depth-Map Photo, ASCII / Halftone, Liquid Glass, Holographic Card, Water Ripple, Audio Visualizer, Grain / Film Noise Overlay, Light Leak
+- **Backgrounds** (41): Scroll-Driven Background Color, Cursor Follower, Neon Flicker, Canvas Particle Effect, Fluid / Liquid Simulation, Glassmorphism Animated, WebGL Shader Animation, Noise-Based Motion, Ray Marching / SDF Scene, GPGPU Particle System, Volumetric Smoke / 3D Noise, Morphing Blob, Flocking, ASCII / Halftone, 2D Physics, Infinite Zoom, Water Ripple, Audio Visualizer, Animated Gradient Background, Mesh Gradient Animation, Aurora / Northern Lights, Grain / Film Noise Overlay, Scanline Effect, Light Leak, Starfield / Space Particles, Breathing / Pulsing Glow, Ambient Ripple Effect, Floating Elements, Grid / Dot Pattern Parallax, Abstract Geometric Motion, Particle Constellation, Flow Field, Synthwave Grid, Matrix Rain, Plasma Field, Wave Layers, Snow / Rain, Fireworks, Topographic Lines, Light Rays, Game of Life
- **Menus & forms** (20): Cover Card to Fixed Header, Scrollspy Navigation, Hide-on-Scroll Header, Slide In, Scale In / Zoom In, Focus Ring Animation, Toggle / Switch Slide, Checkmark Draw, Form Field Morph, Drawer / Panel Slide, Accordion Open/Close, Error Shake, Hamburger Menu Toggle, Star Rating, Segmented Control, Drag to Reorder, Expanding Search, Gooey Menu, Dynamic Island, Liquid Glass
- **Loading & messages** (20): Progress Bar, Slide In, Bounce In, Heart / Like Burst, Success Confetti, Skeleton Loader, Shimmer Effect, Loading Spinner, Progress Animation, Checkmark Draw, Notification Badge Pulse, Error Shake, Copy to Clipboard, Toast Notification, Pull to Refresh, Rolling Numbers, Typing Indicator, Button Loading States, Dynamic Island, Breathing / Pulsing Glow
- **Page intros** (29): Fade In / Fade Out, Slide In, Slide Up Reveal, Scale In / Zoom In, Clip-Path Reveal, Curtain Reveal, Split Text Reveal, Letter-by-Letter Stagger, Word-by-Word Reveal, Blur In, Flip In, Bounce In, Rotate In, Ink Spread Reveal, Image Trail, Kinetic Typography, Typewriter Effect, Text Clip-Path Reveal, Enter/Exit Typography, Split-Flap Board, Handwriting Draw, Text Particles, SVG Path Animation, Depth-Map Photo, 2D Physics, Infinite Zoom, Wave Layers, Fireworks, Light Rays
diff --git a/tests/pages.test.js b/tests/pages.test.js
index 41755e09..d2e0a3d4 100644
--- a/tests/pages.test.js
+++ b/tests/pages.test.js
@@ -534,7 +534,7 @@ test('every guided-steps page and the home page link the same version of the sha
// the mark and presses it there. The home page reads the page without running it, and on a phone the shared script counts the
// marked choice instead of the pressed one, so a card's Copy prompt copies what the page copies on the same screen.
test('a setting that starts lower on phones marks that choice data-hb-phone, and the page script starts there from the mark', () => {
- const PHONE_DEFAULTS = { 'gpgpu-particle-system': ['count-seg', '16,000'], 'cloth-simulation': ['detail-seg', 'Low'] };
+ const PHONE_DEFAULTS = { 'gpgpu-particle-system': ['count-seg', '16,000'], 'cloth-simulation': ['detail-seg', 'Low'], 'audio-visualizer': ['bars-seg', 'Some'] };
for (const slug of Object.keys(PHONE_DEFAULTS)) assert.ok(steps.some(d => d.slug === slug), `${slug} is a guided-steps page`);
for (const d of steps) {
const html = pageOf(d), where = `${d.cat}/${d.slug}`;