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: Ken Burns Effect (07.24), a new Ambient & Background page

Claudeca36037155f3
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index 094317af..b94775b8 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 173 techniques running before filing an issue.
+ about: See all 174 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 23c20c4f..d503e48b 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 173 animations</a>
+ <a class="way" href="/animation-handbook/?view=all#results">Browse all 174 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 38084694..87b2474c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -29,6 +29,8 @@ The main steps of Animation Handbook, newest first, with the number of animation
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.
+- A new animation, Ken Burns Effect (174 in all): photos slowly zoom and pan, then fade into the next, with See inside and
+ Compare from the start.
## 1.0.0 — 2026-10-10
diff --git a/README.md b/README.md
index 2d0b677f..b8f4417f 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 173 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 174 web animation techniques" width="820"></picture></a>
# Animation Handbook
-**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.**
+**A visual reference of 174 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-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)
+[![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-174-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 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.
+Here are 174 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.
@@ -65,11 +65,11 @@ Then ask for an animation in plain words, like "make the cards fade in as they s
| 04 | [Micro-Interactions](#04) | 44 |
| 05 | [Text & Typography](#05) | 19 |
| 06 | [3D & Advanced](#06) | 28 |
-| 07 | [Ambient & Background](#07) | 23 |
+| 07 | [Ambient & Background](#07) | 24 |
## Full catalog
-All 173 techniques, each linked to its live demo.
+All 174 techniques, each linked to its live demo.
Each technique's code and README are in its folder under [animations/](animations/).
@@ -291,11 +291,11 @@ Each technique's code and README are in its folder under [animations/](animation
<a id="07"></a>
-### 07 · Ambient & Background · 23 techniques
+### 07 · Ambient & Background · 24 techniques
<sub>Passive, looping effects that hold visual interest without demanding attention — gradients, particles, grain, and glows.</sub>
-<details><summary>Browse all 23 techniques in Ambient & Background</summary>
+<details><summary>Browse all 24 techniques in Ambient & Background</summary>
- **[Animated Gradient Background](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/animated-gradient-background/)** — Colors slowly drift across a soft gradient background. Best for hero sections.
- **[Mesh Gradient Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/mesh-gradient/)** — Blurred blobs of color drift and melt together. Best for landing pages.
@@ -320,6 +320,7 @@ Each technique's code and README are in its folder under [animations/](animation
- **[Topographic Lines](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/topographic-lines/)** — Lines like those on a hiking map slowly bend and drift. Best for outdoor brands.
- **[Light Rays](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/light-rays/)** — Soft beams of light fall from above and slowly sweep across. Best for hero intros.
- **[Game of Life](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/game-of-life/)** — Cells live and die by their neighbors, and patterns grow. Best for tech sites.
+- **[Ken Burns Effect](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/ken-burns/)** — Photos slowly zoom and pan, then fade into the next. Best for hero slideshows.
</details>
diff --git a/animations/06-3d-advanced/infinite-zoom/README.md b/animations/06-3d-advanced/infinite-zoom/README.md
index d36cf8ad..0e058ff0 100644
--- a/animations/06-3d-advanced/infinite-zoom/README.md
+++ b/animations/06-3d-advanced/infinite-zoom/README.md
@@ -81,3 +81,4 @@ while (p < 0) { p++; at = (at + COUNT - 1) % COUNT; } // zooming out, the pictur
- [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
+- [Ken Burns Effect](../../07-ambient-background/ken-burns/) — photos slowly zoom and pan, then fade into the next
diff --git a/animations/07-ambient-background/README.md b/animations/07-ambient-background/README.md
index 54e62169..f5f90bda 100644
--- a/animations/07-ambient-background/README.md
+++ b/animations/07-ambient-background/README.md
@@ -29,6 +29,7 @@ Passive, looping effects that hold visual interest without demanding attention.
| [Topographic Lines](topographic-lines/) | Lines like those on a hiking map slowly bend and drift. Best for outdoor brands. |
| [Light Rays](light-rays/) | Soft beams of light fall from above and slowly sweep across. Best for hero intros. |
| [Game of Life](game-of-life/) | Cells live and die by their neighbors, and patterns grow. Best for tech sites. |
+| [Ken Burns Effect](ken-burns/) | Photos slowly zoom and pan, then fade into the next. Best for hero slideshows. |
## The ambient mindset
@@ -46,7 +47,7 @@ Passive, looping effects that hold visual interest without demanding attention.
| Approach | Used by |
|----------|---------|
-| Pure CSS keyframes | Animated gradient, mesh gradient, aurora, breathing glow, scanline, wave layers |
+| Pure CSS keyframes | Animated gradient, mesh gradient, aurora, breathing glow, scanline, wave layers, Ken Burns (the script only sets each photo's start and end framing) |
| CSS transition + JS timers | Light leak (random timing) |
| JS moving elements with `transform` | Floating elements, grid parallax (pointer events and a slow drift) |
| Canvas 2D | Grain (or an SVG noise filter), starfield, ambient ripple, abstract geometric, particle constellation, flow field, synthwave grid, matrix rain, plasma, snow and rain, fireworks, topographic lines, light rays, game of life |
diff --git a/animations/07-ambient-background/game-of-life/index.html b/animations/07-ambient-background/game-of-life/index.html
index 09ebb554..d39a0aad 100644
--- a/animations/07-ambient-background/game-of-life/index.html
+++ b/animations/07-ambient-background/game-of-life/index.html
@@ -33,7 +33,7 @@
<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="../light-rays/" rel="prev" aria-label="Previous: Light Rays"><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>Light Rays</span></a></span>
+ <span class="hb-pager"><a href="../light-rays/" rel="prev" aria-label="Previous: Light Rays"><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>Light Rays</span></a><a href="../ken-burns/" rel="next" aria-label="Next: Ken Burns Effect"><span><span class="hb-dir">Next: </span>Ken Burns Effect</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/ken-burns/README.md b/animations/07-ambient-background/ken-burns/README.md
new file mode 100644
index 00000000..b57c7d7d
--- /dev/null
+++ b/animations/07-ambient-background/ken-burns/README.md
@@ -0,0 +1,54 @@
+# Ken Burns Effect
+
+[Live demo](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/ken-burns/)
+
+## What it is
+The Ken Burns effect brings still photos to life by slowly zooming and panning across them, the way a documentary camera moves over a printed photograph. Each photo drifts toward something worth looking at, and the next one fades in before the move ends, so the picture never stops moving. It is named after the filmmaker who made the technique famous in his documentaries.
+
+## When to use it
+- Hero slideshows on travel, hotel and property sites
+- Story and about pages that walk through a few photos
+- Event and wedding pages with a handful of strong pictures
+- Slow backgrounds behind a heading, where a still photo would feel flat
+
+## How it works
+Each photo is drawn larger than its frame (here one and a half times, the strongest zoom any setting uses) and is only ever scaled down from there, so it stays sharp. One CSS keyframe timeline per photo moves it from a start framing to an end framing with transforms only; the two framings are custom properties that the script works out from the settings:
+
+```css
+.slide { animation: kb-fade calc(var(--T) * 3) linear infinite; animation-delay: var(--d); }
+.photo { width: calc(100% * var(--Z)); height: calc(100% * var(--Z)); transform-origin: 0 0;
+ animation: kb-move calc(var(--T) * 3) linear infinite; animation-delay: var(--d); }
+@keyframes kb-move { 0% { transform: var(--from); } 38.1%, 100% { transform: var(--to); } }
+@keyframes kb-fade { 0% { opacity: 0; z-index: 2; } 4.76% { opacity: 1; } 33.33% { z-index: 2; } 33.34% { z-index: 1; }
+ 38.1% { opacity: 1; } 38.11%, 100% { opacity: 0; z-index: 1; } }
+```
+
+Three slides share one cycle three photos long, each starting a photo's time after the one before. A slide fades in on top of the previous one for a seventh of its time, shows, then stays underneath while the next one fades in over it, and is hidden until its turn comes again; its photo keeps moving the whole time it can be seen. A framing is a zoom and the point of the photo that sits in the middle of the frame. That point is kept far enough from the photo's edges that the photo always covers the frame, and because the transform moves in a straight line between two framings that both cover it, every moment in between covers it too:
+
+```js
+const fit = (z, [x, y]) => { const h = .5 / z; return { z, x: Math.min(1 - h, Math.max(h, x)), y: Math.min(1 - h, Math.max(h, y)) }; };
+const photoT = f => `translate(${(.5 - f.x * f.z) / ZMAX * 100}%, ${(.5 - f.y * f.z) / ZMAX * 100}%) scale(${f.z / ZMAX})`;
+```
+
+Zooming in starts near the photo's middle and ends closer on its point of interest; zooming out does the reverse. Pause and Slow motion simply hold or slow every CSS animation in the box. Under reduced motion each photo holds the end of its move and the photos only fade from one to the next.
+
+## Key parameters
+| Parameter | Default | Effect |
+|-----------|---------|--------|
+| Which way it zooms | Both | In zooms every photo in, toward its point of interest; out starts close and pulls back; both zooms the first and third photos in and the second out |
+| How much it moves | Medium | Subtle zooms from 1.04 to 1.16 times and drifts less than half of the way toward the point of interest; medium zooms from 1.06 to 1.3 times and drifts three quarters of the way; strong zooms from 1.08 to 1.5 times and drifts all the way |
+| Time on each photo | Medium | Short is 5 seconds, medium 7 seconds and long 10 seconds; each fade takes a seventh of that, about a second at medium |
+| Shows a caption | off | On, each photo's name sits in the lower left corner and stays still while the photo moves |
+
+## Production notes
+- **Draw big, scale down.** A browser draws a layer once and then scales it; scaling it up past the size it was drawn at makes it soft. Give the photo the size it reaches at the strongest zoom and scale it down from there, or use a picture with enough pixels for the closest framing.
+- **Never let an edge show.** Keep the zoom above one and the framing's center at least half a frame away from the photo's edges, at both ends of the move.
+- **Keep text still.** Put headings and captions in a layer of their own above the moving photo, never inside it, so they stay sharp and easy to read.
+- **One timeline, many photos.** Driving every photo from the same cycle with its own delay keeps the fades and moves in step with no script running each frame; changing the time only changes one custom property.
+- **Reduced motion.** Hold each photo still and change photos with a slow fade.
+- **Library equivalents.** GSAP: `gsap.fromTo(photo, { scale: 1.06, xPercent: 0 }, { scale: 1.3, xPercent: -8, duration: 8, ease: "none" })` in a timeline that crossfades the slides. Framer Motion: animate `scale`, `x` and `y` on the photo with `transition={{ duration: 8, ease: "linear" }}` and wrap the slides in `AnimatePresence`.
+
+## See also
+- [Aurora / Northern Lights](../aurora/) — a calm loop made of CSS keyframes
+- [Infinite Zoom](../../06-3d-advanced/infinite-zoom/) — an endless dive into pictures inside pictures
+- [Zoom Into Image](../../01-scroll-based/zoom-into-image/) — a picture that opens up as you scroll
diff --git a/animations/07-ambient-background/ken-burns/index.html b/animations/07-ambient-background/ken-burns/index.html
new file mode 100644
index 00000000..d00473c9
--- /dev/null
+++ b/animations/07-ambient-background/ken-burns/index.html
@@ -0,0 +1,323 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Ken Burns Effect — Animation Handbook</title>
+ <meta name="description" content="Photos slowly zoom and pan, then fade into the next. Best for hero slideshows.">
+ <link rel="canonical" href="https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/ken-burns/">
+ <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="Ken Burns Effect — Animation Handbook">
+ <meta property="og:description" content="Photos slowly zoom and pan, then fade into the next. Best for hero slideshows.">
+ <meta property="og:url" content="https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/ken-burns/">
+ <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="Ken Burns Effect — Animation Handbook">
+ <meta name="twitter:description" content="Photos slowly zoom and pan, then fade into the next. Best for hero slideshows.">
+ <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": "Ken Burns Effect", "name": "Ken Burns Effect", "description": "Photos slowly zoom and pan, then fade into the next. Best for hero slideshows.", "url": "https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/ken-burns/", "inLanguage": "en", "articleSection": "Ambient & Background", "isPartOf": {"@type": "WebSite", "name": "Animation Handbook", "url": "https://matinmonshizadeh.github.io/animation-handbook/"}, "author": {"@type": "Person", "name": "matinmonshizadeh"}, "keywords": "web animation, CSS animation, Ambient & Background, Ken Burns Effect"}</script>
+ <style>
+ :root{--ui-accent:#ffce5a}
+ *,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
+ /* --T: the time on each photo; --Z: the strongest zoom, the size each photo is drawn at so it is only ever scaled down */
+ .stage{position:relative;overflow:hidden;background:#07080b;--T:7s;--Z:1.5}
+ /* A reel of three slides. Each slide runs one timeline of three photos' length: it fades in over the one before (on top,
+ z-index 2) for a seventh of its time, shows, lets the next fade in over it (z-index 1) and is hidden until its turn.
+ Its photo moves from --from to --to over the whole time it shows, so the motion never stops. */
+ .reel{position:absolute;inset:0;overflow:hidden;isolation:isolate}
+ .slide{position:absolute;inset:0;opacity:0;animation:kb-fade calc(var(--T)*3) linear infinite;animation-delay:var(--d)}
+ .s1{--d:calc(var(--T)*-.15)}.s2{--d:calc(var(--T)*.85)}.s3{--d:calc(var(--T)*1.85)}
+ .photo{position:absolute;left:0;top:0;width:calc(100%*var(--Z));height:calc(100%*var(--Z));transform-origin:0 0;
+ animation:kb-move calc(var(--T)*3) linear infinite;animation-delay:var(--d)}
+ .photo svg,.fit svg{display:block;width:100%;height:100%}
+ @keyframes kb-fade{0%{opacity:0;z-index:2}4.76%{opacity:1}33.33%{z-index:2}33.34%{z-index:1}38.1%{opacity:1}38.11%,100%{opacity:0;z-index:1}}
+ @keyframes kb-move{0%{transform:var(--from)}38.1%,100%{transform:var(--to)}}
+ .cap{display:none;position:absolute;z-index:2;left:14px;bottom:12px;max-width:calc(100% - 28px);padding:6px 12px;border-radius:8px;background:rgba(7,8,11,.62);
+ color:#fff;font:600 clamp(13px,1.6vw,16px)/1.3 var(--hb-font)}
+ .stage.caps .cap{display:block}
+ /* See inside and Compare. Labels are plain words on a dark backing. */
+ .fit,.in-part,.half{display:none}
+ .kb-lbl{position:absolute;z-index:3;padding:3px 8px;border-radius:6px;background:rgba(7,8,11,.9);color:#f4f4f2;
+ font:600 13px/1.25 var(--hb-font);white-space:nowrap;pointer-events:none}
+ /* See inside: the whole photo held still and dimmed, and over it the frame the visitor sees, gliding from the dashed start
+ frame to the dashed end frame along the arrow. The frame's timeline is the photo's turned inside out, from the same
+ numbers (--ffrom, --fto). The moving parts stay rendered in every mode (hidden, not removed), so they keep time. */
+ .stage[data-hb-mode="inside"] .photo{visibility:hidden}
+ .stage[data-hb-mode="inside"] .fit{display:block;position:absolute;inset:0}
+ .in-part{display:block;visibility:hidden;position:absolute;left:0;top:0;width:100%;height:100%;transform-origin:0 0;pointer-events:none}
+ .stage[data-hb-mode="inside"] .in-part{visibility:visible}
+ .frame{outline:3px solid #fff;box-shadow:0 0 0 3000px rgba(5,6,9,.6);animation:kb-frame calc(var(--T)*3) linear infinite;animation-delay:var(--d)}
+ .fs,.fe{outline:2px dashed rgba(255,255,255,.9);outline-offset:-1px}
+ .fs{transform:var(--ffrom)}.fe{transform:var(--fto)}
+ .fl{animation:kb-fl calc(var(--T)*3) linear infinite;animation-delay:var(--d)}
+ .fl .tags{position:absolute;inset:0}
+ .fl .kb-lbl{left:0;top:14px;transform:translateX(-50%)}
+ .tags{animation:kb-tags calc(var(--T)*3) linear infinite;animation-delay:var(--d)}
+ .le{transform:translateX(-100%)}
+ .arrow{overflow:visible}
+ .arrow path{fill:none;stroke:var(--ui-accent);stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
+ @keyframes kb-frame{0%{transform:var(--ffrom)}38.1%,100%{transform:var(--fto)}}
+ @keyframes kb-fl{0%{transform:var(--lfrom)}38.1%,100%{transform:var(--lto)}}
+ /* A slide's labels show only while it is the photo on top, never while the next fades in over it */
+ @keyframes kb-tags{0%,4.76%{opacity:0}4.77%,38.1%{opacity:1}38.11%,100%{opacity:0}}
+ /* Compare: on the left a copy whose photos never move, only fade; on the right the reel itself. The copy stays rendered,
+ unseen, in the other modes, so its fades keep time with the reel's. */
+ .copy{visibility:hidden}
+ .copy .photo{animation:none;transform:var(--from)}
+ .stage[data-hb-mode="compare"] .copy{visibility:visible;right:50%;border-right:2px solid #07080b}
+ .stage[data-hb-mode="compare"] .reel:not(.copy){left:50%}
+ .stage[data-hb-mode="compare"] .half{display:block}
+ .half{top:10px}.half.first{left:10px}.half.second{left:calc(50% + 10px)}
+ @media(max-width:360px){
+ .stage[data-hb-mode="compare"] .copy{right:0;bottom:50%;border-right:0;border-bottom:2px solid #07080b}
+ .stage[data-hb-mode="compare"] .reel:not(.copy){left:0;top:50%}
+ .half.second{left:10px;top:calc(50% + 10px)}
+ }
+ /* Under reduced motion each photo holds the end of its move and the photos only fade; the frame waits at the end too. The
+ loop starts paused with the first photo shown a second and a half before the next fades in, so Play soon shows a fade. */
+ @media(prefers-reduced-motion:reduce){
+ .s1{--d:calc(var(--T)*-1 + 1.5s)}.s2{--d:1.5s}.s3{--d:calc(var(--T) + 1.5s)}
+ .photo{animation:none;transform:var(--to)}
+ .frame{animation:none;transform:var(--fto)}
+ .fl{animation:none;transform:var(--lto)}
+ }
+ </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="../game-of-life/" rel="prev" aria-label="Previous: Game of Life"><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>Game of Life</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">07.24 · Ambient &amp; Background</p>
+ <h1>Ken Burns Effect</h1>
+ <p class="hb-lede">Photos slowly zoom and pan, then fade into the next. Best for hero slideshows.</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, or turn on slow motion to follow each drift.</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" id="stage" role="img" aria-label="Three drawn photos, each slowly zooming and drifting, then fading into the next"></div>
+ <div class="hb-player">
+ <button class="hb-play" type="button" id="btn-pause" data-hb-pause="css" 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="css" autocomplete="off"><span>Slow motion</span></label>
+ </div>
+ <div class="hb-mode-notes" aria-live="polite">
+ <p data-hb-for="inside" hidden>Inside, the whole photo stays still and the bright frame is what the visitor sees: it glides from the dashed start frame to the dashed end frame, then the next photo fades in.</p>
+ <p data-hb-for="compare" hidden>Still photos only fade from one to the next, like a plain slideshow. Zoom and pan drifts and zooms each photo as it fades, so still pictures feel alive.</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="zoom-lbl">Which way it zooms</p>
+ <div class="seg" id="zoom-seg" role="group" aria-labelledby="zoom-lbl">
+ <button type="button" data-zoom="in" aria-pressed="false">In</button>
+ <button type="button" data-zoom="out" aria-pressed="false">Out</button>
+ <button type="button" data-zoom="both" class="on" aria-pressed="true">Both</button>
+ </div>
+ <p class="hb-hint">Both changes direction from photo to photo.</p>
+ </div>
+ <div class="hb-setting">
+ <p class="hb-setting-name" id="move-lbl">How much it moves</p>
+ <div class="seg" id="move-seg" role="group" aria-labelledby="move-lbl">
+ <button type="button" data-move="subtle" aria-pressed="false">Subtle</button>
+ <button type="button" data-move="medium" class="on" aria-pressed="true">Medium</button>
+ <button type="button" data-move="strong" aria-pressed="false">Strong</button>
+ </div>
+ <p class="hb-hint">Subtle feels calm; strong feels like film.</p>
+ </div>
+ <div class="hb-setting">
+ <p class="hb-setting-name" id="time-lbl">Time on each photo</p>
+ <div class="seg" id="time-seg" role="group" aria-labelledby="time-lbl">
+ <button type="button" data-time="5" aria-pressed="false">Short</button>
+ <button type="button" data-time="7" class="on" aria-pressed="true">Medium</button>
+ <button type="button" data-time="10" aria-pressed="false">Long</button>
+ </div>
+ <p class="hb-hint">Longer is calmer.</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 a caption</span><input class="hb-switch" type="checkbox" role="switch" id="cap-tog" autocomplete="off"></label>
+ <p class="hb-hint">The caption stays still while the photo moves.</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 a Ken Burns effect to [your hero photo or slideshow]. Slowly zoom and pan each photo, the way a documentary camera moves over a still print, and crossfade to the next photo before its move ends, so the motion never stops. Give each photo its own start and end framing that drifts toward a point of interest, at an even, unhurried pace. Keep the photo larger than its frame at every moment so no edge ever shows, move it with transforms only, and keep any text on top still and readable. If the visitor has reduced motion turned on, show each photo still and change photos with a slow fade. 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>Hero photos</li><li>Slideshows</li><li>Travel and property sites</li><li>Story pages</li></ul>
+ <h3>Avoid on</h3>
+ <ul class="hb-tags hb-avoid"><li>Product photos people inspect</li><li>Pictures of text</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 stage=document.getElementById('stage');
+ const ZMAX=1.5; // the strongest zoom: each photo is drawn this much larger than the box and only ever scaled down from there
+ // Three drawn photos (1600 by 1000, cropped to fill the box), each with where its move starts and its point of interest, as
+ // shares of the photo's width and height. id keeps the gradients of each copy apart.
+ const PHOTOS=[
+ {name:'Ashfall Ridge at dawn',start:[.38,.62],poi:[.69,.48],svg:id=>`<defs><linearGradient id="a${id}" x2="0" y2="1"><stop offset="0" stop-color="#1b2a4a"/><stop offset=".45" stop-color="#8a5a86"/><stop offset=".62" stop-color="#f29a62"/><stop offset=".7" stop-color="#ffd38a"/></linearGradient><linearGradient id="b${id}" x2="0" y2="1"><stop offset="0" stop-color="#f3a46c"/><stop offset="1" stop-color="#2b2b44"/></linearGradient></defs>
+ <rect width="1600" height="760" fill="url(#a${id})"/><circle cx="1100" cy="505" r="190" fill="#ffe6a8" opacity=".25"/><circle cx="1100" cy="505" r="74" fill="#fff4cf"/>
+ <path fill="#8f7397" d="M0 640L180 520 330 590 520 450 700 560 860 470 1010 560 1200 430 1380 540 1600 470V760H0Z"/>
+ <path fill="#4c4466" d="M0 700L240 600 420 660 640 560 820 650 1040 590 1260 660 1440 600 1600 640V780H0Z"/>
+ <rect y="760" width="1600" height="240" fill="url(#b${id})"/><g fill="#ffe2a6" opacity=".75"><rect x="1010" y="790" width="180" height="6" rx="3"/><rect x="1040" y="820" width="120" height="5" rx="2.5"/><rect x="1068" y="848" width="64" height="4" rx="2"/></g>
+ <path fill="#23233a" d="M0 780H1600V830Q1200 800 900 840T0 820Z"/><path fill="#1b1b2e" d="M120 790l26-90 26 90zM190 790l20-66 20 66zM1380 790l24-80 24 80zM1440 790l18-58 18 58z"/>`},
+ {name:'Lantern Cove at dusk',start:[.34,.58],poi:[.76,.44],svg:id=>`<defs><linearGradient id="a${id}" x2="0" y2="1"><stop offset="0" stop-color="#271b48"/><stop offset=".5" stop-color="#b5527a"/><stop offset=".72" stop-color="#f7a55b"/></linearGradient><linearGradient id="b${id}" x2="0" y2="1"><stop offset="0" stop-color="#3b4b7a"/><stop offset="1" stop-color="#101a33"/></linearGradient></defs>
+ <rect width="1600" height="720" fill="url(#a${id})"/><rect y="700" width="1600" height="300" fill="url(#b${id})"/>
+ <path fill="#2a2440" d="M1060 760Q1140 640 1280 650T1500 760Z"/><path fill="#f1ece4" d="M1196 660L1214 420H1262L1280 660Z"/><path fill="#c8463f" d="M1206 590H1272L1268 540H1210ZM1213 490H1264L1262 455H1215Z"/>
+ <rect x="1206" y="392" width="64" height="30" fill="#2a2440"/><circle cx="1238" cy="400" r="18" fill="#ffe7a0"/><circle cx="1238" cy="400" r="70" fill="#ffd27a" opacity=".22"/>
+ <path fill="#1d1830" d="M0 600H90V560L130 530 170 560V600H230V540H330V610H420V580L470 550 520 580V700H0Z"/>
+ <g fill="#ffd27a"><rect x="40" y="620" width="14" height="18"/><rect x="150" y="575" width="12" height="16"/><rect x="270" y="560" width="14" height="18"/><rect x="460" y="600" width="12" height="16"/></g>
+ <path fill="#1d1830" d="M560 760H700L680 785H580ZM620 760V690L660 752Z"/><path fill="#ffd9a0" opacity=".55" d="M1180 720h120v6h-120zM1200 750h80v5h-80zM1218 780h44v4h-44z"/>`},
+ {name:'Quellmarrow Road under the stars',start:[.56,.66],poi:[.5,.4],svg:id=>{let st='';for(let i=0;i<70;i++){const x=(i*397)%1600,y=(i*173)%560,r=(i%5?1.6:2.8);st+=`<circle cx="${x}" cy="${y}" r="${r}"/>`}
+ return `<defs><linearGradient id="a${id}" x2="0" y2="1"><stop offset="0" stop-color="#050914"/><stop offset=".6" stop-color="#16285a"/><stop offset="1" stop-color="#4a3468"/></linearGradient></defs>
+ <rect width="1600" height="640" fill="url(#a${id})"/><g fill="#f6f2ff" opacity=".85">${st}</g><circle cx="1220" cy="190" r="48" fill="#fff6d8"/><circle cx="1244" cy="176" r="44" fill="#0a1124"/>
+ <path fill="#3a2a4a" d="M0 640L120 560H300L340 600H560L600 580H760L800 640Z"/><path fill="#30223e" d="M980 640L1040 540H1240L1290 600H1420L1470 560H1600V640Z"/>
+ <rect y="630" width="1600" height="370" fill="#241a2c"/><path fill="#14101a" d="M520 1000L792 632H808L1080 1000Z"/>
+ <path fill="#ffd27a" d="M798 650h4l3 30h-10zM795 720h10l5 60h-20zM790 840h20l8 100h-36z"/>`}}
+ ];
+ // How far each photo zooms (its zoom at the start and the end of a zoom in) and how far it drifts toward its point of interest
+ const MOVES={subtle:{z:[1.04,1.16],k:.45},medium:{z:[1.06,1.3],k:.75},strong:{z:[1.08,1.5],k:1}};
+ let zoom='both',move='medium';
+ const LABELS={normal:'Three drawn photos, each slowly zooming and drifting, then fading into the next',
+ inside:'The whole photo held still, with a bright frame gliding from where the view starts to where it ends',
+ compare:'Two slideshows of the same photos: still photos that only fade, and photos that zoom and drift'};
+ // Both reels are made in one go, so their timelines start together: the reel, with the frame, dashed frames, arrow and labels of
+ // See inside in each slide, and Compare's copy, whose photos never move (no ids of its own, out of reach of the keyboard).
+ const slideOf=(k,id,inside)=>`<div class="slide s${k+1}"><div class="photo"><svg viewBox="0 0 1600 1000" preserveAspectRatio="xMidYMid slice">${PHOTOS[k].svg(id)}</svg></div>`+
+ `<p class="cap">${PHOTOS[k].name}</p>`+(inside?`<div class="fit"><svg viewBox="0 0 1600 1000" preserveAspectRatio="xMidYMid slice">${PHOTOS[k].svg('f'+id)}</svg></div>`+
+ `<i class="in-part fs"></i><i class="in-part fe"></i><svg class="in-part arrow"><path/></svg><i class="in-part frame"></i>`+
+ `<div class="in-part tags"><span class="kb-lbl ls" data-hb-caption>Start</span><span class="kb-lbl le" data-hb-caption>End</span></div>`+
+ `<div class="in-part fl"><div class="tags"><span class="kb-lbl" data-hb-caption>Frame · what the visitor sees</span></div></div>`:'')+`</div>`;
+ stage.innerHTML=`<div class="reel copy" inert aria-hidden="true">${PHOTOS.map((_,k)=>slideOf(k,'c'+k,false)).join('')}</div>`+
+ `<div class="reel">${PHOTOS.map((_,k)=>slideOf(k,k,true)).join('')}</div>`+
+ `<p class="kb-lbl half first" data-hb-caption>Still photos</p><p class="kb-lbl half second" data-hb-caption>Zoom and pan</p>`;
+ const slides=[...stage.querySelectorAll('.reel:not(.copy) .slide')],copies=[...stage.querySelectorAll('.copy .slide')];
+ // A framing: the zoom z and the point (x, y) of the photo at the middle of the box, kept far enough from the photo's edges that
+ // the photo covers the box. The photo's transform shows that framing; the frame's is the same framing turned inside out: the
+ // part of the whole photo that the box shows. Both are straight lines between two framings, so every moment between two that
+ // cover the box covers it too.
+ const fit=(z,[x,y])=>{const h=.5/z;return{z,x:Math.min(1-h,Math.max(h,x)),y:Math.min(1-h,Math.max(h,y))}};
+ const pct=v=>(v*100).toFixed(3)+'%';
+ const photoT=f=>`translate(${pct((.5-f.x*f.z)/ZMAX)},${pct((.5-f.y*f.z)/ZMAX)}) scale(${(f.z/ZMAX).toFixed(4)})`;
+ const frameT=f=>`translate(${pct(f.x-.5/f.z)},${pct(f.y-.5/f.z)}) scale(${(1/f.z).toFixed(4)})`;
+ const centerT=f=>`translate(${pct(f.x)},${pct(f.y)})`;
+ // Each photo zooms in (or out, or every other one with Both) and drifts from its start toward its point of interest; zooming out
+ // starts close on that point and pulls back
+ function framings(k){
+ const m=MOVES[move],p=PHOTOS[k],into=zoom==='in'||(zoom==='both'&&k!==1);
+ const near=[p.start[0]+(p.poi[0]-p.start[0])*m.k,p.start[1]+(p.poi[1]-p.start[1])*m.k];
+ return into?[fit(m.z[0],p.start),fit(m.z[1],near)]:[fit(m.z[1],near),fit(m.z[0],p.start)];
+ }
+ function apply(){
+ slides.forEach((el,k)=>{
+ const [a,b]=framings(k);
+ for(const s of [el,copies[k]]){s.style.setProperty('--from',photoT(a));s.style.setProperty('--to',photoT(b))}
+ el.style.setProperty('--ffrom',frameT(a));el.style.setProperty('--fto',frameT(b));
+ el.style.setProperty('--lfrom',centerT(a));el.style.setProperty('--lto',centerT(b));
+ // Start sits inside the start frame's top left corner and End inside the end frame's top right one; the moving frame's own
+ // label rides just below its middle, so none of them meets another or the caption (the box's lower left corner)
+ const ls=el.querySelector('.ls'),le=el.querySelector('.le');
+ ls.style.left=`calc(${pct(a.x-.5/a.z)} + 8px)`;ls.style.top=`calc(${pct(a.y-.5/a.z)} + 8px)`;
+ le.style.left=`calc(${pct(b.x+.5/b.z)} - 8px)`;le.style.top=`calc(${pct(b.y-.5/b.z)} + 8px)`;
+ el.ab=[a,b];
+ });
+ drawArrows();
+ }
+ // The arrow from the middle of the start frame to the middle of the end frame, drawn in the box's own pixels
+ function drawArrows(){
+ const W=stage.clientWidth,H=stage.clientHeight;
+ slides.forEach(el=>{
+ const [a,b]=el.ab,svg=el.querySelector('.arrow'),x1=a.x*W,y1=a.y*H,x2=b.x*W,y2=b.y*H,ang=Math.atan2(y2-y1,x2-x1),h=10;
+ svg.setAttribute('viewBox',`0 0 ${W} ${H}`);
+ svg.firstChild.setAttribute('d',Math.hypot(x2-x1,y2-y1)<4?'':`M${x1} ${y1}L${x2} ${y2}M${x2-h*Math.cos(ang-.5)} ${y2-h*Math.sin(ang-.5)}L${x2} ${y2}L${x2-h*Math.cos(ang+.5)} ${y2-h*Math.sin(ang+.5)}`);
+ });
+ }
+ // The mode switch: the styles show the mode at once and every timeline keeps running (or stays paused); the picture is renamed
+ document.addEventListener('hb:mode',e=>{stage.setAttribute('aria-label',LABELS[e.detail.mode])});
+ // The notes say what the box shows: the markup's words, or under reduced motion a still while the loop is paused and, while it
+ // plays, photos that only fade. Registered at the top level: the shared script sends hb:pause at once under reduced motion.
+ const said={inside:document.querySelector('[data-hb-for="inside"]').textContent,compare:document.querySelector('[data-hb-for="compare"]').textContent};
+ const REDUCED={still:{inside:'Shown still, at the end of the move: the bright frame is the part the visitor sees, and the dashed frames show where the view starts and ends.',
+ compare:'Shown still: Still photos keeps the first view of the photo, while Zoom and pan has drifted and zoomed to the end of its move.'},
+ playing:{inside:'Inside, the bright frame is the part the visitor sees, held at the end of its move, with dashed frames where it starts and ends. Under reduced motion the photos only fade.',
+ compare:'Still photos keeps the first view of each photo, while Zoom and pan shows the end of each move. Under reduced motion both only fade from one photo to the next.'}};
+ let paused=false;
+ function notes(){
+ const reduced=matchMedia('(prefers-reduced-motion: reduce)').matches;
+ for(const k of ['inside','compare'])document.querySelector(`[data-hb-for="${k}"]`).textContent=reduced?REDUCED[paused?'still':'playing'][k]:said[k];
+ }
+ document.addEventListener('hb:pause',e=>{paused=e.detail.paused;notes()});
+ notes();
+ 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);
+ }));
+ }
+ choices('zoom-seg',d=>{zoom=d.zoom;apply()});
+ choices('move-seg',d=>{move=d.move;apply()});
+ choices('time-seg',d=>{stage.style.setProperty('--T',d.time+'s')});
+ document.getElementById('cap-tog').addEventListener('change',e=>stage.classList.toggle('caps',e.target.checked));
+ new ResizeObserver(drawArrows).observe(stage);
+ apply();
+</script>
+</body>
+</html>
diff --git a/index.html b/index.html
index 217c5838..023f6236 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 — 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.">
+<title>Animation Handbook — 174 Web Animation Techniques with Live Demos</title>
+<meta name="description" content="A free visual reference of 174 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 — 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:title" content="Animation Handbook — 174 Web Animation Techniques with Live Demos">
+<meta property="og:description" content="A free visual reference of 174 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 — 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:title" content="Animation Handbook — 174 Web Animation Techniques with Live Demos">
+<meta name="twitter:description" content="A free visual reference of 174 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 173 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 174 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"],
@@ -1390,6 +1390,12 @@ button,input{font:inherit;color:inherit}
@keyframes d-lifef{0%{opacity:1}25%,100%{opacity:0}}
@keyframes d-lifeb{0%{opacity:1}50%,100%{opacity:0}}
+.pv-kenburns{background:#07080b;overflow:hidden}
+.pv-kenburns i{position:absolute;inset:-12%;opacity:0;animation:kenburns-pv 10s linear infinite}
+.pv-kenburns .p1{background:radial-gradient(circle at 68% 48%,#fff4cf 0 4%,#ffe6a855 7%,#0000 15%),linear-gradient(172deg,#0000 58%,#4c4466 58.5% 70%,#0000 70.5%),linear-gradient(#1b2a4a,#8a5a86 40%,#f29a62 58%,#ffd38a 64%,#2b2b44 65%);--a:translate(4%,3%) scale(1);--b:translate(-5%,-2%) scale(1.16)}
+.pv-kenburns .p2{background:radial-gradient(circle at 74% 40%,#ffe7a0 0 2.5%,#ffd27a44 5%,#0000 11%),linear-gradient(90deg,#0000 71%,#f1ece4 71.5% 75%,#0000 75.5%),linear-gradient(#271b48,#b5527a 45%,#f7a55b 64%,#3b4b7a 65%,#101a33);animation-delay:-5s;--a:translate(-4%,-2%) scale(1.16);--b:translate(3%,2%) scale(1)}
+@keyframes kenburns-pv{0%{opacity:0;transform:var(--a)}8%,50%{opacity:1}58%,100%{opacity:0;transform:var(--b)}}
+
/* ── bespoke: added demos ── */
.pv-magnet{background:#08090c;display:grid;place-items:center;position:relative}
.pv-magnet .btn{padding:9px 20px;border-radius:6px;border:1px solid var(--accent);color:var(--accent);font-family:var(--text);font-size:11px;animation:magbtn 3.6s var(--ease) infinite}
@@ -1708,7 +1714,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>173 free animations · no coding needed</p>
+ <p class="pill"><span class="pill-dot" aria-hidden="true"></span>174 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">
@@ -1773,14 +1779,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 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="more" id="more"><button type="button" class="bigbtn" id="more-btn"><span id="more-label">Browse all 174 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 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>
+ <noscript><p class="noscript">This page shows its animations with JavaScript. All 174 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">
@@ -1798,7 +1804,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">173 web animations with live demos and copyable prompts.</p>
+ <p class="foot-t">174 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>
@@ -2034,6 +2040,7 @@ const CATS=[
['topographic-lines','Topographic Lines','Lines like those on a hiking map slowly bend and drift. Best for outdoor brands.'],
['light-rays','Light Rays','Soft beams of light fall from above and slowly sweep across. Best for hero intros.'],
['game-of-life','Game of Life','Cells live and die by their neighbors, and patterns grow. Best for tech sites.'],
+ ['ken-burns','Ken Burns Effect','Photos slowly zoom and pan, then fade into the next. Best for hero slideshows.'],
]
}
];
@@ -2051,7 +2058,7 @@ const PV={
'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','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',
+ 'topographic-lines':'topo','light-rays':'rays','game-of-life':'life','ken-burns':'kenburns',
'parallax-depth-of-field':'dof','parallax-scrolling':'plx','reverse-scrolling-columns':'revcol',
'cover-card-to-fixed-header':'cover','fly-in-fly-out-contact-list':'flylist','stacking-cards':'stack',
'scroll-trigger':'trigger','scrub-animation':'scrub','pin-animation':'pin','snap-scrolling':'snap',
@@ -2269,7 +2276,8 @@ const PLACES={
'fireworks':['bg','intro'],
'topographic-lines':['bg'],
'light-rays':['bg','intro'],
- 'game-of-life':['bg']
+ 'game-of-life':['bg'],
+ 'ken-burns':['imgcard','bg','intro']
};
// What moved, when and how: the finder's answers for each card, the main one first.
const FIND={
@@ -2452,7 +2460,8 @@ const FIND={
'fireworks':['particles background','loop load click','pieces drift fade'],
'topographic-lines':['shape background','loop','morph wave drift'],
'light-rays':['background','loop','color drift fade'],
- 'game-of-life':['particles background shape','loop click drag','morph grow glitch']
+ 'game-of-life':['particles background shape','loop click drag','morph grow glitch'],
+ 'ken-burns':['card background','loop load','grow slide fade']
};
// The finder's three questions in order (spec, section 2): each answer's key (in the address and in FIND), its words (which name
// it) and its picture: a still icon in the site's 24px line style for What and When, the class of a small moving picture for How
@@ -2578,6 +2587,7 @@ function pvMarkup(k){
let d='';for(let i=1;i<16;i++)d+='M'+i+' 0V10';for(let i=1;i<10;i++)d+='M0 '+i+'H16';
return '<svg viewBox="0 0 16 10"><path class="gridlines" d="'+d+'"/>'+glider(1,-4,0)+glider(-4,-2,-8.4)+blinker(14,5)+
[[13,0],[14,0],[12,1],[15,1],[13,2],[14,2],[1,7],[2,7],[1,8],[2,8]].map(cell).join('')+'</svg>';}
+ case 'kenburns': return '<i class="p1 anim"></i><i class="p2 anim"></i>';
case 'aurora': return '<span class="band b1 anim"></span><span class="band b2 anim"></span><span class="band b3 anim"></span>';
case 'mesh': return '<span class="m m1 anim"></span><span class="m m2 anim"></span><span class="m m3 anim"></span>';
case 'glow': return '<span class="core anim"></span><span class="ring anim"></span>';
diff --git a/llms.txt b/llms.txt
index 862166f6..1f91a2b7 100644
--- a/llms.txt
+++ b/llms.txt
@@ -1,8 +1,8 @@
# Animation Handbook
-> 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.
+> A visual reference of 174 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 173 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 174 prompts and settings at once, install the Agent Skill: `npx skills add matinmonshizadeh/animation-handbook`.
## Scroll-Based
@@ -197,6 +197,7 @@ Each page plays one technique live and gives a ready-made prompt that describes
- [Topographic Lines](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/topographic-lines/): Lines like those on a hiking map slowly bend and drift. Best for outdoor brands.
- [Light Rays](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/light-rays/): Soft beams of light fall from above and slowly sweep across. Best for hero intros.
- [Game of Life](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/game-of-life/): Cells live and die by their neighbors, and patterns grow. Best for tech sites.
+- [Ken Burns Effect](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/ken-burns/): Photos slowly zoom and pan, then fade into the next. Best for hero slideshows.
## Famous effects
@@ -205,14 +206,14 @@ 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 173 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 174 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 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
+- [references/07-ambient-background.md](https://matinmonshizadeh.github.io/animation-handbook/skills/animation-handbook/references/07-ambient-background.md): the 24 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 4759bceb..d6605379 100644
Binary files a/og-image.png and b/og-image.png differ
diff --git a/sitemap.xml b/sitemap.xml
index 5feea1c0..7d729dba 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
- <url><loc>https://matinmonshizadeh.github.io/animation-handbook/</loc><lastmod>2026-10-17</lastmod><changefreq>weekly</changefreq><priority>1.0</priority></url>
+ <url><loc>https://matinmonshizadeh.github.io/animation-handbook/</loc><lastmod>2026-10-18</lastmod><changefreq>weekly</changefreq><priority>1.0</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/famous/</loc><lastmod>2026-10-15</lastmod><changefreq>monthly</changefreq><priority>0.8</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/parallax-depth-of-field/</loc><lastmod>2026-10-15</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/01-scroll-based/parallax-scrolling/</loc><lastmod>2026-10-15</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
@@ -149,7 +149,7 @@
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/physics-2d/</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/liquid-glass/</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/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/infinite-zoom/</loc><lastmod>2026-10-18</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>
@@ -174,5 +174,6 @@
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/fireworks/</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/topographic-lines/</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/light-rays/</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/game-of-life/</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/game-of-life/</loc><lastmod>2026-10-18</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
+ <url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/ken-burns/</loc><lastmod>2026-10-18</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
</urlset>
diff --git a/skills/animation-handbook/SKILL.md b/skills/animation-handbook/SKILL.md
index 3c7dac83..1738c8f3 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 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.
+description: Builds web animations from Animation Handbook, a set of 174 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 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.
+[Animation Handbook](https://matinmonshizadeh.github.io/animation-handbook/) is a free reference of 174 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 173 in one list, grouped by category, with an index by place.
+- [references/catalog.md](references/catalog.md): all 174 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, 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.
+- [references/07-ambient-background.md](references/07-ambient-background.md): Ambient & Background, 24 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/07-ambient-background.md b/skills/animation-handbook/references/07-ambient-background.md
index e5033b76..a8103f8e 100644
--- a/skills/animation-handbook/references/07-ambient-background.md
+++ b/skills/animation-handbook/references/07-ambient-background.md
@@ -1,6 +1,6 @@
# 07 · Ambient & Background
-Passive, looping effects that hold visual interest without demanding attention — gradients, particles, grain, and glows. 23 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.
+Passive, looping effects that hold visual interest without demanding attention — gradients, particles, grain, and glows. 24 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
@@ -27,6 +27,7 @@ Passive, looping effects that hold visual interest without demanding attention
- [Topographic Lines](#topographic-lines)
- [Light Rays](#light-rays)
- [Game of Life](#game-of-life)
+- [Ken Burns Effect](#ken-burns-effect)
## Animated Gradient Background
@@ -517,3 +518,23 @@ Add a Game of Life background to [the section you want it behind]. Split a canva
- Color: **Mint** · Amber · Sky blue · Pink. Mint, amber, sky blue or pink cells.
- Fading trails: **on** · off. A cell that dies fades out over about half a second instead of vanishing at once.
- Grid lines: on · **off**. Faint lines show the squares the cells live in.
+
+## Ken Burns Effect
+
+Photos slowly zoom and pan, then fade into the next. Best for hero slideshows.
+
+- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/ken-burns/
+- How it runs: moves by itself
+- Good for: Hero photos · Slideshows · Travel and property sites · Story pages
+- Avoid on: Product photos people inspect · Pictures of text
+
+**Prompt**
+
+Add a Ken Burns effect to [your hero photo or slideshow]. Slowly zoom and pan each photo, the way a documentary camera moves over a still print, and crossfade to the next photo before its move ends, so the motion never stops. Give each photo its own start and end framing that drifts toward a point of interest, at an even, unhurried pace. Keep the photo larger than its frame at every moment so no edge ever shows, move it with transforms only, and keep any text on top still and readable. If the visitor has reduced motion turned on, show each photo still and change photos with a slow fade. 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):
+
+- Which way it zooms: In · Out · **Both**. In zooms every photo in, toward its point of interest; out starts close and pulls back; both zooms the first and third photos in and the second out.
+- How much it moves: Subtle · **Medium** · Strong. Subtle zooms from 1.04 to 1.16 times and drifts less than half of the way toward the point of interest; medium zooms from 1.06 to 1.3 times and drifts three quarters of the way; strong zooms from 1.08 to 1.5 times and drifts all the way.
+- Time on each photo: Short · **Medium** · Long. Short is 5 seconds, medium 7 seconds and long 10 seconds; each fade takes a seventh of that, about a second at medium.
+- Shows a caption: on · **off**. On, each photo's name sits in the lower left corner and stays still while the photo moves.
diff --git a/skills/animation-handbook/references/catalog.md b/skills/animation-handbook/references/catalog.md
index 50d0b119..4bd4a6ac 100644
--- a/skills/animation-handbook/references/catalog.md
+++ b/skills/animation-handbook/references/catalog.md
@@ -1,6 +1,6 @@
# Catalog
-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.
+All 174 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)
@@ -186,7 +186,7 @@ WebGL, shaders, particles, 3D transforms, simulations, and other heavier effects
## 07 · Ambient & Background
-Passive, looping effects that hold visual interest without demanding attention — gradients, particles, grain, and glows. 23 animations, in [07-ambient-background.md](07-ambient-background.md).
+Passive, looping effects that hold visual interest without demanding attention — gradients, particles, grain, and glows. 24 animations, in [07-ambient-background.md](07-ambient-background.md).
- [Animated Gradient Background](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/animated-gradient-background/): Colors slowly drift across a soft gradient background. Best for hero sections. Places: Backgrounds.
- [Mesh Gradient Animation](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/mesh-gradient/): Blurred blobs of color drift and melt together. Best for landing pages. Places: Backgrounds.
@@ -211,6 +211,7 @@ Passive, looping effects that hold visual interest without demanding attention
- [Topographic Lines](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/topographic-lines/): Lines like those on a hiking map slowly bend and drift. Best for outdoor brands. Places: Backgrounds.
- [Light Rays](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/light-rays/): Soft beams of light fall from above and slowly sweep across. Best for hero intros. Places: Backgrounds, Page intros.
- [Game of Life](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/game-of-life/): Cells live and die by their neighbors, and patterns grow. Best for tech sites. Places: Backgrounds.
+- [Ken Burns Effect](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/ken-burns/): Photos slowly zoom and pan, then fade into the next. Best for hero slideshows. Places: Images & cards, Backgrounds, Page intros.
## By place
@@ -218,10 +219,10 @@ 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** (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
+- **Images & cards** (52): 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, Ken Burns Effect
+- **Backgrounds** (42): 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, Ken Burns Effect
- **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
+- **Page intros** (30): 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, Ken Burns Effect
- **Scrolling** (28): Parallax Depth-of-Field, Parallax Scrolling, Reverse-Scrolling Columns, Cover Card to Fixed Header, Fly-in Fly-out Contact List, Stacking Cards, Scroll-Triggered Animation, Scrub Animation, Pin Animation, Snap Scrolling, Scrollytelling, Reveal on Scroll, Stagger Reveal, Horizontal Scroll, Sticky Section, Counter Animation, Progress Bar, Section Wipe, Zoom Into Image, Scroll Image Sequence, Smooth (Inertia) Scroll, Text Fill on Scroll, Scroll Velocity Skew, SVG Line Draw on Scroll, Scrollspy Navigation, Scroll-Driven Background Color, Hide-on-Scroll Header, Scroll-Driven 3D Rotation
- **Page changes** (18): Shatter Effect, View Transitions API, Shared Element Transition, Morph Transition, Crossfade Transition, Slide Transition, Zoom Transition, Flash / Light Leak Transition, Blur Transition, Elastic Transition, Portal / Tunnel Zoom, Dissolve Transition, FLIP Technique, Circle Reveal, Overlay Wipe, Page Curl, Cube Transition, Pixelate Transition