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: Infinite Zoom (06.26)

matindcd4f3edd7cc
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index b8d170bd..d154d8bf 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -2,4 +2,4 @@ blank_issues_enabled: true
contact_links:
- name: Browse the live handbook
url: https://matinmonshizadeh.github.io/animation-handbook/
- about: See all 158 techniques running before filing an issue.
+ about: See all 159 techniques running before filing an issue.
diff --git a/README.md b/README.md
index 7cfae9a2..377f31e8 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,14 @@
<div align="center">
-<a href="https://matinmonshizadeh.github.io/animation-handbook/"><img src="og-image.png" alt="Animation Handbook — 158 web animation techniques with live demos" width="820"></a>
+<a href="https://matinmonshizadeh.github.io/animation-handbook/"><img src="og-image.png" alt="Animation Handbook — 159 web animation techniques with live demos" width="820"></a>
# Animation Handbook
-**A visual reference of 158 web animation techniques — every entry is a live, dependency-free demo you can open in the browser and read how it works.**
+**A visual reference of 159 web animation techniques — every entry is a live, dependency-free demo you can open in the browser and read how it works.**
[**Open the live handbook →**](https://matinmonshizadeh.github.io/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=6ea8ff)](https://matinmonshizadeh.github.io/animation-handbook/) [![Stars](https://img.shields.io/github/stars/matinmonshizadeh/animation-handbook?style=flat&color=5fd88a)](https://github.com/matinmonshizadeh/animation-handbook/stargazers) [![License](https://img.shields.io/github/license/matinmonshizadeh/animation-handbook?color=b98cff)](LICENSE) ![Techniques](https://img.shields.io/badge/techniques-158-ff9d5c) ![Dependencies](https://img.shields.io/badge/dependencies-0-ff6f8b) ![Build](https://img.shields.io/badge/build-none-3fd6c4)
+[![Live site](https://img.shields.io/website?url=https%3A%2F%2Fmatinmonshizadeh.github.io%2Fanimation-handbook%2F&label=live%20demo&up_message=online&color=6ea8ff)](https://matinmonshizadeh.github.io/animation-handbook/) [![Stars](https://img.shields.io/github/stars/matinmonshizadeh/animation-handbook?style=flat&color=5fd88a)](https://github.com/matinmonshizadeh/animation-handbook/stargazers) [![License](https://img.shields.io/github/license/matinmonshizadeh/animation-handbook?color=b98cff)](LICENSE) ![Techniques](https://img.shields.io/badge/techniques-159-ff9d5c) ![Dependencies](https://img.shields.io/badge/dependencies-0-ff6f8b) ![Build](https://img.shields.io/badge/build-none-3fd6c4)
</div>
@@ -39,12 +39,12 @@ Everything is plain HTML, CSS, and JavaScript: no build step, no frameworks, no
| 03 | [Page Transitions](#03) | 16 | Full-page transitions between routes or views — crossfades, slides, portals, morphs, and the browser-native API. |
| 04 | [Micro-Interactions](#04) | 38 | Short, user-triggered animations — hover, click, focus, loading states, and UI feedback patterns. |
| 05 | [Text & Typography](#05) | 18 | Animations specifically for type — kinetic motion, character-level effects, gradient flows, and word transformations. |
-| 06 | [3D & Advanced](#06) | 23 | WebGL, shaders, particles, 3D transforms, and the performance-sensitive effects that push the browser's limits. |
+| 06 | [3D & Advanced](#06) | 24 | WebGL, shaders, particles, 3D transforms, and the performance-sensitive effects that push the browser's limits. |
| 07 | [Ambient & Background](#07) | 23 | Passive, looping effects that hold visual interest without demanding attention — gradients, particles, grain, and glows. |
## Full catalog
-All 158 techniques, each linked to its live demo.
+All 159 techniques, each linked to its live demo.
<a id="01"></a>
@@ -215,7 +215,7 @@ All 158 techniques, each linked to its live demo.
<a id="06"></a>
-### 06 · 3D & Advanced · 23 techniques
+### 06 · 3D & Advanced · 24 techniques
<sub>WebGL, shaders, particles, 3D transforms, and the performance-sensitive effects that push the browser's limits.</sub>
@@ -244,6 +244,7 @@ All 158 techniques, each linked to its live demo.
- **[Flocking](animations/06-3d-advanced/flocking/)** — Birds swirl and turn together as one flock. Best for calm backgrounds.
- **[ASCII / Halftone](animations/06-3d-advanced/ascii-halftone/)** — A moving picture is redrawn with letters or dots. Best for retro and tech looks.
- **[2D Physics](animations/06-3d-advanced/physics-2d/)** — Balls drop where you click, bounce and pile up. Best for playful intros.
+- **[Infinite Zoom](animations/06-3d-advanced/infinite-zoom/)** — The view keeps zooming into pictures inside pictures. Best for page intros.
</details>
diff --git a/animations/01-scroll-based/zoom-into-image/README.md b/animations/01-scroll-based/zoom-into-image/README.md
index a015863e..38277b32 100644
--- a/animations/01-scroll-based/zoom-into-image/README.md
+++ b/animations/01-scroll-based/zoom-into-image/README.md
@@ -47,3 +47,4 @@ Clipping rather than scaling is the crucial choice: `clip-path` reveals more of
- [Scrub Animation](../scrub-animation/) — scroll position drives the movement, both ways
- [Cover Card to Fixed Header](../cover-card-to-fixed-header/) — a big cover changes shape as you scroll
- [Parallax Depth-of-Field](../parallax-depth-of-field/) — layers move and blur for depth as you scroll
+- [Infinite Zoom](../../06-3d-advanced/infinite-zoom/) — the view keeps diving into pictures inside pictures on its own
diff --git a/animations/06-3d-advanced/README.md b/animations/06-3d-advanced/README.md
index 4874ecff..627e876a 100644
--- a/animations/06-3d-advanced/README.md
+++ b/animations/06-3d-advanced/README.md
@@ -29,6 +29,7 @@ WebGL, shaders, particles, 3D transforms, and the performance-sensitive effects
| [Flocking](flocking/) | Birds swirl and turn together as one flock. Best for calm backgrounds. |
| [ASCII / Halftone](ascii-halftone/) | A moving picture is redrawn with letters or dots. Best for retro and tech looks. |
| [2D Physics](physics-2d/) | Balls drop where you click, bounce and pile up. Best for playful intros. |
+| [Infinite Zoom](infinite-zoom/) | The view keeps zooming into pictures inside pictures. Best for page intros. |
## Key concepts
diff --git a/animations/06-3d-advanced/infinite-zoom/README.md b/animations/06-3d-advanced/infinite-zoom/README.md
new file mode 100644
index 00000000..d9cfe53d
--- /dev/null
+++ b/animations/06-3d-advanced/infinite-zoom/README.md
@@ -0,0 +1,79 @@
+# Infinite Zoom
+
+## What it is
+An infinite zoom keeps moving into a picture whose middle holds a smaller picture, which holds a smaller one again, so the view seems to dive forever. It is a short loop in disguise: every picture is drawn again at a smaller size inside the frame of the one around it, and the view zooms in by exactly the step between two of them. When the inner picture fills the view it simply takes the outer one's place, so nothing ever jumps.
+
+## When to use it
+- Page intros and hero sections that pull the visitor into the site
+- Stories that go from the big picture to a detail and on into the next chapter
+- Portfolios and galleries where one piece of work opens into the next
+- Music, art and game pages that want an endless, hypnotic background
+
+## How it works
+**Pictures with a window.** Each picture is drawn over the whole box around a window in its middle: 40% of the box's width and height (`R = 0.4`), so the window has the box's own shape. The next picture is the same full drawing scaled down by `R` about the center of the box, which lands it exactly in that window. In the demo the window is a painting's canvas, a drive-in movie screen, a television's screen, a laptop's screen and a photo; each frame is drawn outside the window, never over it.
+
+**One number for the whole zoom.** `p`, from 0 to 1, says how far the view has zoomed from picture `at` toward the next one. Picture `j`, counted from the outside, is drawn at scale `R^(j - p)`: the outer one a little larger than the box (up to 2.5 times), the next one up to the box's size, the one after that 40% of it, and so on, until a picture would be smaller than 3 pixels. They are drawn from the outside in, and each is clipped to its own rectangle less its window, so no picture paints over another and nothing of a picture spills over the frame around it:
+
+```js
+const R = 0.4; // each window holds the next picture at 40% of its size
+function render() {
+ const seen = [];
+ for (let j = 0; j < 9; j++) { // picture j, from the outside in
+ const s = Math.pow(R, j - p);
+ if (s * Math.max(W, H) < 3) break; // too small to see
+ seen.push([s, (at + j) % COUNT]);
+ }
+ seen.forEach(([s, n], j) => {
+ // scaled by s about the center of the box (kx, ky: canvas pixels per box pixel)
+ ctx.setTransform(kx * s, 0, 0, ky * s, kx * W / 2 * (1 - s), ky * H / 2 * (1 - s));
+ ctx.save();
+ ctx.beginPath(); ctx.rect(0, 0, W, H); // its own rectangle,
+ if (j < seen.length - 1) ctx.rect(X, Y, w, h); // less the window the next picture fills
+ ctx.clip('evenodd');
+ if (phone.matches) box(0, 0, W, H, FLAT[n]); // phones: the wall in one flat color
+ else ctx.drawImage(SOFT[n], 0, 0, W, H); // the soft light, drawn once per resize (below)
+ SCENES[n](); // the rest, drawn in box pixels around the window
+ ctx.restore();
+ });
+}
+```
+
+**The swap nobody sees.** At `p = 1` the next picture is drawn at scale `R^0 = 1`: it fills the box at exactly its own size, which is how it is drawn as picture `at` at `p = 0`. So when `p` passes 1, the loop takes 1 off `p` and moves `at` on by one, and the frame before and the frame after are the same picture. Zooming out runs `p` backward, and below 0 the picture around the outer one takes over:
+
+```js
+const dt = lastT === null ? 0 : Math.min(ts - lastT, 50) * (slow ? 1 / 3 : 1);
+p += DIR * dt / 1000 / SECS; // DIR: 1 zooms in, -1 zooms out
+while (p >= 1) { p--; at = (at + 1) % COUNT; } // the next picture fills the box: it is the outer one now
+while (p < 0) { p++; at = (at + COUNT - 1) % COUNT; } // zooming out, the picture around it is
+```
+
+**An even speed.** Because the scale is `R` to the power of `p`, and `p` grows with the time, every picture grows by the same factor each second, so the zoom feels steady. Growing the scale by the same amount each second instead would seem to slow down as the picture got bigger.
+
+**Time, not frames.** The loop draws at most once per 16 ms and moves `p` by the time since the last drawn frame (at most 50 ms, and a third of it in slow motion), so the zoom has the same speed on a 30, 60 or 120 Hz screen. The first frame after a start, Play or a return to a hidden tab moves nothing. Pause cancels the frame, so the picture stops at once. The stars in the drive-in scene twinkle on the same clock.
+
+**Soft light, drawn once.** The shading of each wall, sky or table and the glow of its lamps change slowly across the picture, so they are drawn once per resize into a small canvas a quarter of the box's size, and each frame stretches that canvas over the picture. Copying a picture costs far less than drawing the same gradients every frame.
+
+**Number of scenes.** The chain takes the first one, three or five pictures in turn, `(at + j) % COUNT`. With one, the painting in the gallery holds the gallery itself: a picture that contains itself, known as the Droste effect.
+
+## Key parameters
+| Parameter | Default | Effect |
+|-----------|---------|--------|
+| Speed | Normal | How long each picture takes to grow from its window to the whole box, 2.5 times its size: slow is 7.5 seconds, normal 4.5 and fast 2.5 |
+| Number of scenes | 5 | How many different pictures take turns: one picture holds a copy of itself; three are the gallery, the drive-in and the living room; five add the desk and the photo on a table |
+| Direction | In | In dives into each picture's window; out pulls back, so each picture shrinks into the window of the one around it |
+| Shows the scene edges | off | Outlines the edge of every picture with a dashed line and numbers the ones big enough to read by their place in the chain, so you can see each one grow to the edges of the box and take over |
+
+## Production notes
+- **Your own pictures**: each picture needs its window in the same place, the box's own shape, in its exact middle, or the next picture will not fit it. Artists who make these zooms by hand draw every picture around a copy of the next one, then cut that copy out.
+- **Sharp at full size**: every picture is shown from a speck up to the full box, and the outer one up to 2.5 times larger. Drawn shapes, as in the demo, or SVG stay sharp at every size; photos must be big enough for the full box at the screen's pixel ratio, and should be loaded before the zoom starts.
+- **No frame over the window**: a frame that overlapped the next picture would vanish in one jump at the swap. Keep every frame outside its window.
+- **CSS only**: layers scaled with `transform: scale()` work too (the card for this page on the home page has five, each with its window cut out and growing 2.5 times per step, with an easing that bends each step into the same steady speed), but the browser may draw a layer once at its starting size and enlarge that copy, so it blurs as it grows.
+- **Libraries**: GSAP can tween the zoom value and you draw from it; Three.js does the same with textured planes and a camera that moves toward them. Neither is needed: the whole effect is one number and a loop.
+- **Phones** draw at most 1.5 canvas pixels for every screen pixel and paint each wall in one flat color, without the soft light, which takes about 40% off the work of each frame.
+- **Reduced motion**: show one still frame, the first picture with the pictures inside it, as the demo does; Play still starts the zoom. A steady zoom toward the middle can make some people dizzy, so keep it slow, give it a pause button and do not put long text over it.
+
+## See also
+- [Zoom Into Image](../../01-scroll-based/zoom-into-image/) — scrolling opens a small window until the picture fills the box
+- [Portal / Tunnel Zoom](../../03-page-transitions/portal-zoom/) — the next page opens out of a circle you click
+- [Starfield / Space Particles](../../07-ambient-background/starfield/) — stars stream toward you, another endless dive
+- [2.5D / Pseudo-3D](../2-5d-pseudo-3d/) — flat layers that slide by different amounts to fake depth
diff --git a/animations/06-3d-advanced/infinite-zoom/index.html b/animations/06-3d-advanced/infinite-zoom/index.html
new file mode 100644
index 00000000..52fbaeca
--- /dev/null
+++ b/animations/06-3d-advanced/infinite-zoom/index.html
@@ -0,0 +1,300 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Infinite Zoom — Animation Handbook</title>
+ <meta name="description" content="The view keeps zooming into pictures inside pictures. Best for page intros.">
+ <link rel="canonical" href="https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/infinite-zoom/">
+ <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="Infinite Zoom — Animation Handbook">
+ <meta property="og:description" content="The view keeps zooming into pictures inside pictures. Best for page intros.">
+ <meta property="og:url" content="https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/infinite-zoom/">
+ <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="Infinite Zoom — Animation Handbook">
+ <meta name="twitter:description" content="The view keeps zooming into pictures inside pictures. Best for page intros.">
+ <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": "Infinite Zoom", "name": "Infinite Zoom", "description": "The view keeps zooming into pictures inside pictures. Best for page intros.", "url": "https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/infinite-zoom/", "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, Infinite Zoom"}</script>
+ <style>
+ :root{--ui-accent:#3fd6c4;--edge:#3fd6c4}
+ *,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
+ .stage{position:relative;overflow:hidden;background:#0b0b0d}
+ canvas{display:block;width:100%;height:100%}
+ </style>
+ <link rel="stylesheet" href="../../../assets/css/demo-page.css?v=6">
+ <script src="../../../assets/js/demo-page.js?v=6" 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="../physics-2d/" rel="prev" aria-label="Previous: 2D Physics"><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>2D Physics</span></a></span>
+</nav>
+<main class="hb-page">
+ <header class="hb-head">
+ <p class="hb-cat">06.26 · 3D &amp; Advanced</p>
+ <h1>Infinite Zoom</h1>
+ <p class="hb-lede">The view keeps zooming into pictures inside pictures. Best for page intros.</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 by itself. Pause it to look closely, or turn on slow motion to see each picture take over.</p></div>
+ </div>
+ <div class="stage" id="stage">
+ <canvas id="cvs" role="img" aria-label="A painting in a gallery holds a drive-in movie screen, which holds a television, then a laptop, then a photo on a table, each framed inside the one before, as the view keeps zooming in"></canvas>
+ </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>
+ </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="speed-lbl">Speed</p>
+ <div class="seg" id="speed-seg" role="group" aria-labelledby="speed-lbl">
+ <button type="button" data-secs="7.5" aria-pressed="false">Slow</button>
+ <button type="button" data-secs="4.5" class="on" aria-pressed="true">Normal</button>
+ <button type="button" data-secs="2.5" aria-pressed="false">Fast</button>
+ </div>
+ <p class="hb-hint">How long each picture takes to fill the box.</p>
+ </div>
+ <div class="hb-setting">
+ <p class="hb-setting-name" id="count-lbl">Number of scenes</p>
+ <div class="seg" id="count-seg" role="group" aria-labelledby="count-lbl">
+ <button type="button" data-n="1" aria-pressed="false">1</button>
+ <button type="button" data-n="3" aria-pressed="false">3</button>
+ <button type="button" data-n="5" class="on" aria-pressed="true">5</button>
+ </div>
+ <p class="hb-hint">One scene holds a copy of itself; more scenes take turns.</p>
+ </div>
+ <div class="hb-setting">
+ <p class="hb-setting-name" id="dir-lbl">Direction</p>
+ <div class="seg" id="dir-seg" role="group" aria-labelledby="dir-lbl">
+ <button type="button" data-dir="1" class="on" aria-pressed="true">In</button>
+ <button type="button" data-dir="-1" aria-pressed="false">Out</button>
+ </div>
+ <p class="hb-hint">In dives into each picture; out pulls back to the one around it.</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>Shows the scene edges</span><input class="hb-switch" type="checkbox" role="switch" id="edges-tog" autocomplete="off"></label>
+ <p class="hb-hint">Outlines and numbers each scene, so you can see where the next one waits.</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 infinite zoom to [the section you want it in]. Give each picture, such as [a painting, a screen or a photo], a frame in its middle, the same shape as the view, that holds a smaller copy of the next picture, so the pictures nest inside each other. Move the view steadily into or out of the middle, growing or shrinking every picture by the same factor each second so the speed feels even. Each time a picture exactly fills the view, draw it as the outermost one, so the loop never jumps. Draw only the pictures big enough to see, and keep them sharp at full size. If the visitor has reduced motion turned on, show one still frame. 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>
+ </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>Page intros</li><li>Portfolios and galleries</li><li>Story and game sites</li><li>Music and art pages</li></ul>
+ <h3>Avoid on</h3>
+ <ul class="hb-tags hb-avoid"><li>Long reading pages</li><li>Forms and checkout</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="#top">Back to top ↑</a></footer>
+<script>
+const cvs=document.getElementById('cvs'),main=cvs.getContext('2d');let ctx=main; // ctx: what the helpers draw on (main, or a soft light)
+const stage=document.getElementById('stage'),slowTog=document.getElementById('slow-tog');
+const EDGE=getComputedStyle(document.documentElement).getPropertyValue('--edge').trim();
+// Phones are screens up to 600px wide, or up to 500px tall when held sideways: they draw 1.5 canvas pixels per screen pixel, not 2,
+// and each picture's wall, sky or table in one flat color, without the soft light
+const phone=matchMedia('(max-width:600px),(max-height:500px)');
+const R=.4,TAU=Math.PI*2; // the frame in the middle of each picture holds the next picture at 40% of its size
+let W=0,H=0,u=1,X=0,Y=0,w=0,h=0,dpr=1,kx=1,ky=1,raf=null,lastT=null; // kx, ky: canvas pixels per stage pixel
+let p=0,at=0,clock=0; // p: how far the view has zoomed from picture `at` to the next one (0 to 1); clock: seconds played, for the stars
+let SECS=4.5,COUNT=5,DIR=1,EDGES=false;
+
+// Drawing helpers, in stage pixels. u is 1% of the stage's shorter side; X, Y, w, h are the window in the middle, 40% of the stage.
+const grad=(g,c)=>{c.forEach((s,i)=>g.addColorStop(i/(c.length-1),s));return g;};
+const lin=(x0,y0,x1,y1,...c)=>grad(ctx.createLinearGradient(x0,y0,x1,y1),c);
+function box(x,y,bw,bh,f,r){ctx.fillStyle=f;ctx.beginPath();if(r&&ctx.roundRect)ctx.roundRect(x,y,bw,bh,r);else ctx.rect(x,y,bw,bh);ctx.fill();}
+function oval(x,y,rx,ry,f,a){ctx.fillStyle=f;ctx.beginPath();ctx.ellipse(x,y,rx,ry,a||0,0,TAU);ctx.fill();}
+function poly(f,...q){ctx.fillStyle=f;ctx.beginPath();for(let i=0;i<q.length;i+=2)ctx.lineTo(q[i],q[i+1]);ctx.fill();}
+function line(c,lw,...q){ctx.strokeStyle=c;ctx.lineWidth=lw;ctx.beginPath();for(let i=0;i<q.length;i+=2)ctx.lineTo(q[i],q[i+1]);ctx.stroke();}
+const light=(x,y,r,c)=>box(x-r,y-r,2*r,2*r,grad(ctx.createRadialGradient(x,y,0,x,y,r),[c,c.replace(/[\d.]+\)$/,'0)')]));
+// The frame m pixels around the window; hole() fills the window with a dark color, seen only in the smallest picture drawn
+const frame=(m,f,r)=>box(X-m,Y-m,w+2*m,h+2*m,f,r),hole=()=>box(X,Y,w,h,'#0c0c10');
+
+// Five pictures, each drawn over the whole stage around its window. 1: a painting in a gallery, under a picture light
+function gallery(soft){
+ if(soft){box(0,0,W,H,lin(0,0,0,H,'#1b5563','#0b2a33'));light(W/2,Y,w*.8,'rgba(255,220,160,.3)');return;}
+ box(0,H*.84,W,H*.16,'#08212a');box(0,H*.84,W,.7*u,'#2b6f7c');
+ for(const s of [-1,1]){const x=W/2+s*(w/2+24*u),y=H/2-12*u;
+ box(x-9*u,y+1.5*u,20*u,22*u,'rgba(0,0,0,.3)');box(x-10*u,y,20*u,22*u,'#3a2717');box(x-8.5*u,y+1.5*u,17*u,19*u,s<0?'#efe1c2':'#22304a');
+ oval(x-s*2*u,y+10*u,5*u,5*u,s<0?'#d6623b':'#e8b44a');box(x-8.5*u,y+15*u,17*u,5.5*u,s<0?'#3c6e8f':'#7a4f9a');}
+ box(X-3.3*u,Y-2.5*u,w+9*u,h+9*u,'rgba(0,0,0,.35)');
+ frame(4.5*u,lin(X,Y,X+w,Y+h,'#fbe7a6','#c9962f','#8c5b17','#e9c568'));frame(1.3*u,'#5e3f12');hole();
+ box(W/2-w*.17,Y-7.1*u,w*.34,1.6*u,'#2b2418',.8*u);box(X+w-8*u,Y+h+9*u,8*u,3.6*u,'#efe3c6',.4*u);
+ for(const x of [-.27,.27])box(W/2+w*x-.8*u,H*.88,1.6*u,H*.12,'#06171d');box(W/2-w*.3,H*.88,w*.6,2.4*u,'#06171d',u);
+}
+// 2: a drive-in movie at night: the screen on its posts, twinkling stars, the moon, hills and parked cars
+const STARS=Array.from({length:44},(_,i)=>[(.5+i*.7548777)%1,(.5+i*.5698403)%1*.64,.25+i%3*.18,i]); // spread evenly, with no pattern
+function drivein(soft){
+ if(soft){box(0,0,W,H,lin(0,0,0,H*.86,'#070b24','#1f1850','#5b2c63'));light(W*.86,H*.18,15*u,'rgba(255,236,190,.3)');return;}
+ for(const [sx,sy,r,i] of STARS){ctx.globalAlpha=.6+.4*Math.sin(clock*1.6+i*2.4);oval(sx*W,sy*H,r*u,r*u,'#fff');}ctx.globalAlpha=1;
+ oval(W*.86,H*.18,4.6*u,4.6*u,'#fff2cf');poly('#1a1236',0,H*.86,0,H*.74,W*.18,H*.68,W*.36,H*.76,W*.62,H*.7,W*.82,H*.77,W,H*.71,W,H*.86);
+ box(0,H*.86,W,H*.14,'#0d0a1d');for(const x of [-.32,.3])box(W/2+w*x,Y+h,2.2*u,H,'#221b40');
+ frame(3.4*u,'#2b2350');frame(2*u,'#dcd6ee');hole();
+ poly('rgba(190,200,255,.07)',W/2-1.5*u,H,W/2+1.5*u,H,X+w,Y+h,X,Y+h);
+ for(const c of [.1,.3,.7,.9]){const x=W*c,y=H*.94;
+ box(x-9*u,y-4*u,18*u,5*u,'#231b42',2*u);box(x-5.5*u,y-7.5*u,11*u,4.4*u,'#231b42',2*u);box(x-4*u,y-6.6*u,8*u,2.4*u,'#3d3470',u);
+ for(const s of [-1,1])oval(x+s*7*u,y-1.8*u,1.1*u,.7*u,'#ff4d6d');}
+}
+// 3: a living room in the evening: an old television on legs, a floor lamp and a plant
+function livingroom(soft){
+ if(soft){box(0,0,W,H,lin(0,0,0,H,'#8c4b2f','#55291b'));light(W/2,H/2,w*.95,'rgba(140,190,255,.22)');light(W*.12,H*.4,26*u,'rgba(255,200,120,.38)');return;}
+ for(let x=2*u;x<W;x+=7*u)box(x,0,2.4*u,H*.86,'rgba(255,230,200,.05)');
+ box(0,H*.86,W,H*.14,lin(0,H*.86,0,H,'#3b2216','#22130c'));oval(W/2,H*.95,w*.7,3.4*u,'#7a2e38');
+ box(W*.12-.4*u,H*.4,.8*u,H*.52,'#1d120d');poly('#f3c77e',W*.12-5*u,H*.4,W*.12+5*u,H*.4,W*.12+3*u,H*.4-7*u,W*.12-3*u,H*.4-7*u);
+ for(const a of [-1.1,-.6,-.15,.3,.8])oval(W*.88+Math.sin(a)*6*u,H*.8-Math.cos(a)*7*u,2.2*u,6.5*u,'#3f7a4a',a);
+ poly('#c26b3c',W*.88-4*u,H*.9,W*.88+4*u,H*.9,W*.88+5*u,H*.8,W*.88-5*u,H*.8);
+ line('#2a1a12',1.2*u,X+4*u,Y+h+8*u,X+u,H*.92);line('#2a1a12',1.2*u,X+w-4*u,Y+h+8*u,X+w-u,H*.92);line('#c9c2b8',.5*u,W/2-9*u,Y-17*u,W/2,Y-4*u,W/2+8*u,Y-18*u);
+ box(X-5*u,Y-4*u,w+10*u,h+12*u,lin(0,Y,0,Y+h,'#a06c3f','#6d4425'),2.5*u);frame(1.6*u,'#141418',1.4*u);hole();
+ for(const k of [1,2])oval(X+w-k*4.5*u,Y+h+4.8*u,1.3*u,1.3*u,'#e2cfa3');
+ for(let k=0;k<4;k++)box(X+2*u,Y+h+3*u+k*.9*u,10*u,.4*u,'#4a2c18');
+}
+// 4: a desk at night: a laptop, a desk lamp, notes on the wall, a shelf of books and a mug
+function desk(soft){
+ if(soft){box(0,0,W,H,lin(0,0,0,H,'#1c2c4d','#111a30'));light(X-16*u,Y+h,34*u,'rgba(255,214,150,.3)');return;}
+ for(const [dx,dy,c] of [[-31,-4,'#ffd65c'],[-22,3,'#ff8fab'],[-31,8,'#7fd6c2']])box(X+dx*u,Y+dy*u,7.5*u,7.5*u,c);
+ box(X+w+8*u,Y+h*.35,30*u,1.2*u,'#3a4b70');
+ ['#e46a5e','#f2c14e','#5aa9e6','#9b7fd1','#58c08f','#f08a4b'].forEach((c,k)=>{const bh=(9+k%3*2)*u;box(X+w+9*u+k*3.4*u,Y+h*.35-bh,2.8*u,bh,c);});
+ const top=Y+h+.5*u;box(0,top,W,H-top,lin(0,top,0,H,'#5e4634','#3a2a1f'));
+ line('#cfd5e2',.9*u,X-16*u,Y+h+4*u,X-21*u,Y+h*.35,X-12*u,Y+h*.1);oval(X-16*u,Y+h+4*u,4*u,1.2*u,'#cfd5e2');poly('#cfd5e2',X-12*u,Y+h*.1-u,X-7*u,Y+h*.1+6*u,X-15*u,Y+h*.1+7*u);
+ frame(2.2*u,'#0e1118',1.8*u);hole();oval(W/2,Y-1.1*u,.35*u,.35*u,'#3a4458');
+ poly(lin(0,Y+h+2.2*u,0,Y+h+6*u,'#c9cfdb','#7c8496'),X-2.2*u,Y+h+2.2*u,X+w+2.2*u,Y+h+2.2*u,X+w+7*u,Y+h+6*u,X-7*u,Y+h+6*u);
+ box(X+w+12*u,Y+h+3*u,6*u,7*u,'#e9e4da',.8*u);ctx.strokeStyle='#e9e4da';ctx.lineWidth=u;ctx.beginPath();ctx.arc(X+w+18*u,Y+h+6.5*u,2*u,-1.4,1.4);ctx.stroke();
+}
+// 5: a photo on a wooden table, seen from above, beside other photos, a cup of coffee and a camera
+function table(soft){
+ if(soft){box(0,0,W,H,lin(0,0,W,H,'#7a4d2c','#4b2c17'));return;}
+ for(let k=1;k<7;k++)box(0,H*k/7,W,.35*u,'rgba(30,15,5,.35)');
+ for(const [px,py,a,c] of [[.1,.22,-.35,'#5aa9e6'],[.9,.8,.4,'#e9a23b'],[.88,.18,.25,'#58c08f']]){
+ ctx.save();ctx.translate(W*px,H*py);ctx.rotate(a);box(-11*u,-12*u,22*u,26*u,'#f1ece2',.5*u);box(-9*u,-10*u,18*u,18*u,c);ctx.restore();}
+ const cx=X-17*u,cy=Y+h*.95;oval(cx,cy,8*u,8*u,'#efe9df');oval(cx,cy,6.2*u,6.2*u,'#5a3420');box(cx+7.5*u,cy-1.2*u,4*u,2.4*u,'#efe9df',u);
+ box(X+w+8*u,Y+h*.1,24*u,15*u,'#1d1d22',2*u);oval(X+w+20*u,Y+h*.1+7.5*u,5*u,5*u,'#3a3a44');oval(X+w+20*u,Y+h*.1+7.5*u,3*u,3*u,'#0d0d12');
+ box(X-2.2*u,Y-1.6*u,w+6*u,h+13*u,'rgba(0,0,0,.35)',.6*u);box(X-3*u,Y-3*u,w+6*u,h+13*u,'#f5f1e8',.6*u);hole();
+ line('#3b4f8a',.5*u,...Array.from({length:18},(_,k)=>[X+w*.25+k*w*.03,Y+h+5.5*u+Math.sin(k*1.9)*1.1*u]).flat());
+}
+const SCENES=[gallery,drivein,livingroom,desk,table];
+// Each picture's soft light (the shading of its wall, sky or table and the glow of its lamps) changes slowly across it, so it is drawn
+// once per resize at a quarter of the stage's size and stretched to fit every frame: copying a picture costs far less than a gradient
+const SOFT=SCENES.map(()=>document.createElement('canvas')),FLAT=['#134250','#1b1648','#743b26','#18253f','#643d22'];
+function soften(){
+ SOFT.forEach((c,i)=>{c.width=Math.ceil(W/4);c.height=Math.ceil(H/4);ctx=c.getContext('2d');ctx.scale(c.width/W,c.height/H);SCENES[i](true);});ctx=main;
+}
+
+// One picture of the zoom. Picture `at` fills the view at p = 0 and is drawn R^-p times its size; each picture inside it is drawn
+// R times the size of the one around it, from the outside in, so each fills the window of the one before. At p = 1 the next
+// picture fills the view at exactly its own size, which is where it starts as picture `at`: nothing jumps.
+function render(){
+ const seen=[];for(let j=0;j<9;j++){const s=Math.pow(R,j-p);if(s*Math.max(W,H)<3)break;seen.push([s,(at+j)%COUNT]);} // under 3px: left out
+ seen.forEach(([s,n],j)=>{
+ ctx.setTransform(kx*s,0,0,ky*s,kx*W/2*(1-s),ky*H/2*(1-s));
+ // Each picture is clipped to its own rectangle, less the window the next picture fills: no picture paints over another
+ ctx.save();ctx.beginPath();ctx.rect(0,0,W,H);if(j<seen.length-1)ctx.rect(X,Y,w,h);ctx.clip('evenodd');
+ if(phone.matches)box(0,0,W,H,FLAT[n]);else ctx.drawImage(SOFT[n],0,0,W,H);
+ SCENES[n]();ctx.restore();
+ });
+ ctx.setTransform(kx,0,0,ky,0,0);
+ if(EDGES)for(const [s,n] of seen){ // each picture's edge, dashed over a dark line, with its number in the chain
+ const x=W/2*(1-s),y=H/2*(1-s);ctx.setLineDash([]);ctx.lineWidth=4;ctx.strokeStyle='rgba(0,0,0,.45)';ctx.strokeRect(x,y,W*s,H*s);
+ ctx.setLineDash([7,5]);ctx.lineWidth=2;ctx.strokeStyle=EDGE;ctx.strokeRect(x,y,W*s,H*s);
+ if(H*s>60){box(x+6,y+6,24,22,'rgba(8,10,14,.85)',5);ctx.fillStyle=EDGE;ctx.font='700 13px "Schibsted Grotesk",system-ui,sans-serif';ctx.textAlign='center';ctx.fillText(n+1,x+18,y+22);}
+ }
+}
+
+// loop() keeps exactly one frame requested in raf; Pause cancels it and Play starts one loop again. At most one frame per 16 ms
+// zooms by the time since the last one (at most 50 ms, a third in slow motion); a first frame after a start only takes the time.
+function loop(ts){
+ raf=requestAnimationFrame(loop);
+ if(lastT!==null&&ts-lastT<16)return;
+ const dt=lastT===null?0:Math.min(ts-lastT,50)*(slowTog.checked?1/3:1);
+ lastT=ts;clock+=dt/1000;p+=DIR*dt/1000/SECS;
+ while(p>=1){p--;at=(at+1)%COUNT;} // the next picture now fills the view: it becomes picture `at`
+ while(p<0){p++;at=(at+COUNT-1)%COUNT;} // zooming out, the picture around it does
+ render();
+}
+function start(){if(raf)return;lastT=null;raf=requestAnimationFrame(loop);}
+
+// At the top level, before the deferred shared script runs: it pauses on arrival under reduced motion, and its Play starts the
+// loop. A paused picture stays as it is.
+document.addEventListener('hb:pause',e=>{if(e.detail.paused){cancelAnimationFrame(raf);raf=null;}else start();});
+// A tab that comes back after being hidden has no earlier frame to measure from, so its first frame zooms by nothing
+document.addEventListener('visibilitychange',()=>{lastT=null;});
+
+// Setting the canvas size wipes it, so a real change of the stage's size (or of the phone limit) draws the picture again at once,
+// playing or paused. A resize that leaves the stage as it was (a phone's address bar sliding in or out) does nothing.
+function resize(){
+ const sw=stage.clientWidth,sh=stage.clientHeight,r=Math.min(devicePixelRatio||1,phone.matches?1.5:2);
+ if(sw===W&&sh===H&&r===dpr)return;
+ W=sw;H=sh;dpr=r;u=Math.min(W,H)/100;X=W*(1-R)/2;Y=H*(1-R)/2;w=W*R;h=H*R;
+ cvs.width=Math.round(W*dpr);cvs.height=Math.round(H*dpr);kx=cvs.width/W;ky=cvs.height/H;soften();render(); // the whole canvas, to the last pixel
+}
+
+function choices(id,pick){
+ const buttons=document.querySelectorAll('#'+id+' button');
+ buttons.forEach(b=>b.addEventListener('click',()=>{
+ if(b.classList.contains('on'))return; // pressing the choice already made does nothing
+ buttons.forEach(x=>{x.classList.toggle('on',x===b);x.setAttribute('aria-pressed',String(x===b))});
+ pick(b.dataset);
+ }));
+}
+// Speed and Direction change the zoom from where it is; Number of scenes and the edges show at once, paused too
+choices('speed-seg',d=>{SECS=+d.secs;});
+choices('count-seg',d=>{COUNT=+d.n;at%=COUNT;render();});
+choices('dir-seg',d=>{DIR=+d.dir;});
+document.getElementById('edges-tog').addEventListener('change',e=>{EDGES=e.target.checked;render();});
+
+resize();
+window.addEventListener('resize',resize);
+// A window that crosses the phone size changes how the walls are drawn, even when the stage keeps its size and pixel ratio
+const redo=()=>{W=0;resize();};if(phone.addEventListener)phone.addEventListener('change',redo);else if(phone.addListener)phone.addListener(redo);
+if(!matchMedia('(prefers-reduced-motion:reduce)').matches)start(); // under reduced motion the first picture stays still until Play
+</script>
+</body>
+</html>
diff --git a/docs/launch-kit.md b/docs/launch-kit.md
index dda098f3..0b3cd1ea 100644
--- a/docs/launch-kit.md
+++ b/docs/launch-kit.md
@@ -10,7 +10,7 @@ quality is already there; this is the distribution layer. Work top to bottom.
GitHub → repo **Settings** (or the ⚙️ next to "About" on the repo home page):
**Description:**
-> 158 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step.
+> 159 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step.
**Website:** `https://matinmonshizadeh.github.io/animation-handbook/`
@@ -25,7 +25,7 @@ With the GitHub CLI (`gh`), this is one command:
```bash
gh repo edit matinmonshizadeh/animation-handbook \
- --description "158 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step." \
+ --description "159 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step." \
--homepage "https://matinmonshizadeh.github.io/animation-handbook/" \
--add-topic web-animation,css-animation,animation,frontend,web-development,javascript,motion-design,ui-animation,scroll-animation,microinteractions,webgl,ai-prompts,reference,no-dependencies,github-pages \
--remove-topic awesome
@@ -41,7 +41,7 @@ and share, which drives return visits.
## 2. Verify SEO is live (after pushing)
-- `https://matinmonshizadeh.github.io/animation-handbook/sitemap.xml` → should list 159 URLs
+- `https://matinmonshizadeh.github.io/animation-handbook/sitemap.xml` → should list 160 URLs
- `https://matinmonshizadeh.github.io/animation-handbook/robots.txt` → should load
- Submit the sitemap to **Google Search Console** (add the property, then Sitemaps → submit `sitemap.xml`).
- Test the social card at https://opengraph.xyz — paste the homepage URL, confirm the og-image shows.
@@ -59,14 +59,14 @@ comments yourself in the first hours.
### Show HN (news.ycombinator.com/submit)
**Title:**
-> Show HN: Animation Handbook – 158 web animations, each with a prompt for your AI
+> Show HN: Animation Handbook – 159 web animations, each with a prompt for your AI
**URL:** `https://matinmonshizadeh.github.io/animation-handbook/`
**First comment (post immediately after submitting):**
> I kept re-googling the same animation techniques and landing on either a
> library's marketing page or a CodePen with no explanation. So I built a
-> reference: 158 techniques, from scroll effects and page transitions to
+> reference: 159 techniques, from scroll effects and page transitions to
> micro-interactions, text, 3D, and ambient backgrounds. You find one by where it
> goes on your page (buttons, text, backgrounds, page changes…) or by describing
> it. Each one plays live, has a few plain settings, and gives you a ready-made
@@ -78,10 +78,10 @@ comments yourself in the first hours.
### Reddit — r/webdev (Showoff Saturday) and r/Frontend
**Title:**
-> I built a handbook of 158 web animations — watch each one live, tweak it, and copy a prompt for your AI assistant
+> I built a handbook of 159 web animations — watch each one live, tweak it, and copy a prompt for your AI assistant
**Body:**
-> 158 techniques in 7 categories (scroll, entrance/exit, page transitions,
+> 159 techniques in 7 categories (scroll, entrance/exit, page transitions,
> micro-interactions, text, 3D, ambient). Find one by where it goes on your page or
> by describing it, try a few plain settings, then copy a prompt that describes it in
> plain words for ChatGPT, Claude or Cursor. Each technique is also one standalone
@@ -93,7 +93,7 @@ comments yourself in the first hours.
### dev.to / Hashnode article
-**Title:** `158 web animations you can copy as a prompt for your AI assistant`
+**Title:** `159 web animations you can copy as a prompt for your AI assistant`
**Outline:**
1. The problem — animation knowledge is scattered across libraries and CodePens, and an AI
@@ -108,7 +108,7 @@ comments yourself in the first hours.
### X / Bluesky thread
-> 1/ I built Animation Handbook — 158 web animations you can watch live, tweak, and
+> 1/ I built Animation Handbook — 159 web animations you can watch live, tweak, and
> copy as a prompt for your AI assistant. No dependencies, no build step. 🧵 <docs/demo.gif>
>
> 2/ Find one by where it goes — buttons, text, backgrounds, page changes — or just
@@ -126,7 +126,7 @@ awesome-web-animation) via PR.
### Product Hunt
-**Tagline:** `158 web animations, each with a prompt for your AI assistant`
+**Tagline:** `159 web animations, each with a prompt for your AI assistant`
Schedule for a Tuesday–Thursday 12:01am PT. Line up 5–10 people to comment/upvote early.
---
diff --git a/index.html b/index.html
index f247bf7a..2beaf384 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 — 158 Web Animation Techniques with Live Demos</title>
-<meta name="description" content="A visual reference of 158 web animation techniques — scroll effects, page transitions, micro-interactions, text animation, 3D, and ambient backgrounds. Every entry is a live, dependency-free demo with an explanation of how it works.">
+<title>Animation Handbook — 159 Web Animation Techniques with Live Demos</title>
+<meta name="description" content="A visual reference of 159 web animation techniques — scroll effects, page transitions, micro-interactions, text animation, 3D, and ambient backgrounds. Every entry is a live, dependency-free demo with an explanation of how it works.">
<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="matinmonshizadeh">
<meta name="robots" content="index, follow, max-image-preview:large">
@@ -18,8 +18,8 @@
<!-- Open Graph -->
<meta property="og:type" content="website">
<meta property="og:site_name" content="Animation Handbook">
-<meta property="og:title" content="Animation Handbook — 158 Web Animation Techniques with Live Demos">
-<meta property="og:description" content="A visual reference of 158 web animation techniques. Every entry is a live, dependency-free demo with an explanation of how it works.">
+<meta property="og:title" content="Animation Handbook — 159 Web Animation Techniques with Live Demos">
+<meta property="og:description" content="A visual reference of 159 web animation techniques. Every entry is a live, dependency-free demo with an explanation of how it works.">
<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">
@@ -27,8 +27,8 @@
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image">
-<meta name="twitter:title" content="Animation Handbook — 158 Web Animation Techniques">
-<meta name="twitter:description" content="A visual reference of 158 web animation techniques. Every entry is a live, dependency-free demo you can open in the browser.">
+<meta name="twitter:title" content="Animation Handbook — 159 Web Animation Techniques">
+<meta name="twitter:description" content="A visual reference of 159 web animation techniques. Every entry is a live, dependency-free demo you can open in the browser.">
<meta name="twitter:image" content="https://matinmonshizadeh.github.io/animation-handbook/og-image.png">
<!-- Structured data: parsed by search + AI answer engines -->
@@ -38,7 +38,7 @@
"@type": "WebSite",
"name": "Animation Handbook",
"url": "https://matinmonshizadeh.github.io/animation-handbook/",
- "description": "A visual reference of 158 web animation techniques, each with a live, dependency-free demo and an explanation of how it works.",
+ "description": "A visual reference of 159 web animation techniques, each with a live, dependency-free demo and an explanation of how it works.",
"inLanguage": "en",
"author": { "@type": "Person", "name": "matinmonshizadeh" },
"about": ["web animation", "CSS animation", "motion design", "frontend development"],
@@ -1039,6 +1039,20 @@ button,input{font:inherit;color:inherit}
@keyframes d-ph2{0%,22%{transform:translateY(-620%);animation-timing-function:cubic-bezier(.5,0,1,.6)}34%{transform:translateY(0);animation-timing-function:cubic-bezier(0,.4,.5,1)}37%{transform:translateY(-22%);animation-timing-function:cubic-bezier(.5,0,1,.6)}40%,100%{transform:translateY(0)}}
@keyframes d-ph3{0%,32%{transform:translateY(-620%);animation-timing-function:cubic-bezier(.5,0,1,.6)}44%{transform:translateY(0);animation-timing-function:cubic-bezier(0,.4,.5,1)}47%{transform:translateY(-22%);animation-timing-function:cubic-bezier(.5,0,1,.6)}50%,100%{transform:translateY(0)}}
@keyframes d-phfade{0%,84%{opacity:1}92%,100%{opacity:0}}
+/* Five pictures, each in the window of the one around it at 40% of its size (a gallery's gilt frame, a drive-in screen, a television,
+ a laptop and a photo), zoom in by one picture every 2.4 s. Each layer grows from the smallest past the edges in five steps and then
+ starts again as the smallest; the easing bends every step into the same steady zoom. Each layer has its window cut out, so no two
+ overlap and the order they are drawn in never matters. Its frame (::before) is 3cqh wide on every side, a share of the stage's height. */
+.pv-izoom{background:#0b0b0d;overflow:hidden;container-type:size}
+.pv-izoom i{position:absolute;inset:0;background:var(--b);clip-path:polygon(evenodd,0 0,100% 0,100% 100%,0 100%,0 0,30% 30%,70% 30%,70% 70%,30% 70%,30% 30%);animation:d-izoom 12s cubic-bezier(.33,.2,.67,.49) infinite;animation-delay:calc(var(--k) * -2.4s)}
+.pv-izoom i::before{content:"";position:absolute;inset:calc(30% - 3cqh);border-radius:var(--r,0);background:var(--f)}
+.pv-izoom i::after{content:"";position:absolute;left:0;right:0;bottom:0;height:14%;background:var(--g,transparent)}
+.pv-izoom .g{--k:4;--b:radial-gradient(50% 45% at 50% 22%,rgba(255,220,160,.28),transparent),linear-gradient(#1b5563,#0b2a33);--f:linear-gradient(135deg,#fbe7a6,#c9962f 45%,#8c5b17 70%,#e9c568);--g:#08212a}
+.pv-izoom .d{--k:3;--b:radial-gradient(circle at 86% 18%,#fff2cf 0 3.6cqh,transparent 4cqh),linear-gradient(#070b24,#1f1850 55%,#5b2c63 86%);--f:#dcd6ee;--g:#0d0a1d}
+.pv-izoom .t{--k:2;--b:linear-gradient(#8c4b2f,#55291b);--f:linear-gradient(#a06c3f,#6d4425);--r:2cqh;--g:#2b170f}
+.pv-izoom .l{--k:1;--b:linear-gradient(#1c2c4d,#111a30);--f:#0e1118;--r:1.6cqh;--g:#4e3a2b}
+.pv-izoom .p{--k:0;--b:linear-gradient(135deg,#7a4d2c,#4b2c17);--f:#f5f1e8}
+@keyframes d-izoom{0%{transform:scale(.0256)}20%{transform:scale(.064)}40%{transform:scale(.16)}60%{transform:scale(.4)}80%{transform:scale(1)}100%{transform:scale(2.5)}}
/* ── bespoke: 07 Ambient & Background ── */
.pv-grain2{background:radial-gradient(circle at 50% 40%,#1a1710,#08080a);overflow:hidden}
@@ -1329,7 +1343,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>158 free animations · no coding needed</p>
+ <p class="pill"><span class="pill-dot" aria-hidden="true"></span>159 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">
@@ -1386,8 +1400,8 @@ 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 158 animations</span><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M6 13l6 6 6-6"/></svg></button></div>
- <noscript><p class="noscript">This page shows its animations with JavaScript. All 158 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>
+ <div class="more" id="more"><button type="button" class="bigbtn" id="more-btn"><span id="more-label">Browse all 159 animations</span><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M6 13l6 6 6-6"/></svg></button></div>
+ <noscript><p class="noscript">This page shows its animations with JavaScript. All 159 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">
@@ -1405,7 +1419,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">158 web animations with live demos and copyable prompts.</p>
+ <p class="foot-t">159 web animations with live demos and copyable prompts.</p>
<nav class="nav" aria-label="Footer"><a class="lnk" href="https://github.com/matinmonshizadeh/animation-handbook" target="_blank" rel="noopener noreferrer">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>
@@ -1596,6 +1610,7 @@ const CATS=[
['flocking','Flocking','Birds swirl and turn together as one flock. Best for calm backgrounds.'],
['ascii-halftone','ASCII / Halftone','A moving picture is redrawn with letters or dots. Best for retro and tech looks.'],
['physics-2d','2D Physics','Balls drop where you click, bounce and pile up. Best for playful intros.'],
+ ['infinite-zoom','Infinite Zoom','The view keeps zooming into pictures inside pictures. Best for page intros.'],
]
},
{
@@ -1640,7 +1655,7 @@ const PV={
'rolling-numbers':'rollnum',
'typing-indicator':'typing',
'hold-to-confirm':'holdconf','expanding-search':'xsearch','button-loading-states':'btnload',
- 'flip-card-3d':'flip3d','carousel-3d':'carousel3d','depth-map-photo':'depthmap','flocking':'flock','ascii-halftone':'ascii','physics-2d':'phys2d','matrix-rain':'matrix','plasma':'plasmapv',
+ 'flip-card-3d':'flip3d','carousel-3d':'carousel3d','depth-map-photo':'depthmap','flocking':'flock','ascii-halftone':'ascii','physics-2d':'phys2d','infinite-zoom':'izoom','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',
@@ -1822,6 +1837,7 @@ const PLACES={
'flocking':['bg'],
'ascii-halftone':['imgcard','bg'],
'physics-2d':['intro','bg'],
+ 'infinite-zoom':['intro','bg'],
// 07
'animated-gradient-background':['bg'],
'mesh-gradient':['bg'],
@@ -1878,6 +1894,7 @@ function pvMarkup(k){
case 'neon': return '<span class="sg"><span class="gl">OPEN</span><span class="lt anim">OPEN</span></span>';
case 'handwrite': return '<span class="pp"><svg viewBox="-34 -90 180 100"><line class="rl" x1="-34" x2="146" y1="0" y2="0"/><path class="w anim" pathLength="1" d="M0 0C3 0 6.9-4 10.6-12C14.8-22 24.7-44 28.3-58C31.4-70 30.7-76 27.7-76C24.7-76 22.4-70 21.1-62C18.1-46 12.5-18 8.5 0C11.6-12 18.9-27 25.6-27.5C31.2-28 30.2-19 27.9-11C25.7-3 27.5 0 31 0C34.5 0 39.8-3.5 44-9C48.2-14.5 50.6-21 46.7-21.5C42.8-22 38-16 37.1-9.5C36-2.5 40.5 0 45 0C48 0 51.9-4 55.6-12C59.8-22 69.7-44 73.3-58C76.4-70 75.7-76 72.7-76C69.7-76 67.4-70 66.1-62C63.1-46 57-16 55.5-7C54.9-2 57 0 60 0C63 0 66.9-4 70.6-12C74.8-22 84.7-44 88.3-58C91.4-70 90.7-76 87.7-76C84.7-76 82.4-70 81.1-62C78.1-46 72-16 70.5-7C69.9-2 72 0 75 0C78 0 83.2-10 89.3-22C92.4-27 95.9-29 98.9-29C100.9-29 102.2-28 102.3-26.5C102.2-28 100.9-29 98.9-29C95.9-29 92.4-27 89.3-22C86.7-17 83.6-5 87.3-1.5C91.2 1.5 97.8-6 99.6-14C100.9-20 101.3-24 100.7-26C103.3-28.5 107.8-28.5 111.9-27"/></svg></span>';
case 'sig6': return '<div class="cube anim"><span class="face f1"></span><span class="face f2"></span><span class="face f3"></span><span class="face f4"></span><span class="face f5"></span><span class="face f6"></span></div>';
+ 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 '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>';
@@ -2178,7 +2195,7 @@ let shown=[];
// under the place label or between two states). Nothing here runs without reduced motion.
const STILL={
cover:.1,curtain:.6,kinetic:.25,carousel:.1,typewriter:.55,textclip:.7,svgpath:.7,smoke:.3,leak:.7,
- flash:.41,blurpage:.2,toggle:.7,shake:.8,hideheader:.72,hilite:.7,splitflap:.7,handwrite:.75,circlerev:.25,owipe:.165,pcurl:.44,cubepage:.3,reorder:.4,ascii:.2,phys2d:.6
+ flash:.41,blurpage:.2,toggle:.7,shake:.8,hideheader:.72,hilite:.7,splitflap:.7,handwrite:.75,circlerev:.25,owipe:.165,pcurl:.44,cubepage:.3,reorder:.4,ascii:.2,phys2d:.6,izoom:.02
};
function hold(card){
const anims=card.querySelector('.pv').getAnimations({subtree:true});
diff --git a/sitemap.xml b/sitemap.xml
index 38230db2..e3899b42 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -136,6 +136,7 @@
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/flocking/</loc><lastmod>2026-10-01</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/ascii-halftone/</loc><lastmod>2026-10-01</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/physics-2d/</loc><lastmod>2026-10-01</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-01</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-07-14</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-07-14</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-07-14</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>