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.
HTML ai-promptsanimationcss-animationsfrontendgithub-pagesjavascriptmicrointeractionsmotion-designno-dependenciesreferencescroll-animationui-animationweb-animationweb-developmentwebgl
feat: Fire Effect (07.25), a new Ambient & Background page
Claudee1bc6dfd56e2
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.ymlindex b94775b8..a0dbc39b 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 handbookurl: https://matinmonshizadeh.github.io/animation-handbook/- about: See all 174 techniques running before filing an issue.+ about: See all 175 techniques running before filing an issue.- name: Ask a question or share an ideaurl: https://github.com/matinmonshizadeh/animation-handbook/discussionsabout: Questions, ideas and things you made with the handbook go to Discussions.diff --git a/404.html b/404.htmlindex d503e48b..90e141ea 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 174 animations</a>+ <a class="way" href="/animation-handbook/?view=all#results">Browse all 175 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.mdindex 87b2474c..797c9dc7 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -31,6 +31,8 @@ The main steps of Animation Handbook, newest first, with the number of animationpressed, 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 andCompare from the start.+- A new animation, Fire Effect (175 in all): flames flicker and rise as heat climbs and cools, with See inside and Compare+ from the start.## 1.0.0 — 2026-10-10diff --git a/README.md b/README.mdindex b8f4417f..9c0c44fb 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 174 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 175 web animation techniques" width="820"></picture></a># Animation Handbook-**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.**+**A visual reference of 175 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```-[](https://matinmonshizadeh.github.io/animation-handbook/) [](https://github.com/matinmonshizadeh/animation-handbook) [](LICENSE) [](#full-catalog) [](#design-principles) [](#design-principles)+[](https://matinmonshizadeh.github.io/animation-handbook/) [](https://github.com/matinmonshizadeh/animation-handbook) [](LICENSE) [](#full-catalog) [](#design-principles) [](#design-principles)</div>@@ -22,7 +22,7 @@ npx skills add matinmonshizadeh/animation-handbook## What this is-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.+Here are 175 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) | 24 |+| 07 | [Ambient & Background](#07) | 25 |## Full catalog-All 174 techniques, each linked to its live demo.+All 175 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 · 24 techniques+### 07 · Ambient & Background · 25 techniques<sub>Passive, looping effects that hold visual interest without demanding attention — gradients, particles, grain, and glows.</sub>-<details><summary>Browse all 24 techniques in Ambient & Background</summary>+<details><summary>Browse all 25 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.@@ -321,6 +321,7 @@ Each technique's code and README are in its folder under [animations/](animation- **[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.+- **[Fire Effect](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/fire-effect/)** — Flames flicker and rise as heat climbs and cools. Best for game and event pages.</details>diff --git a/animations/07-ambient-background/README.md b/animations/07-ambient-background/README.mdindex f5f90bda..2af694a4 100644--- a/animations/07-ambient-background/README.md+++ b/animations/07-ambient-background/README.md@@ -30,6 +30,7 @@ Passive, looping effects that hold visual interest without demanding attention.| [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. |+| [Fire Effect](fire-effect/) | Flames flicker and rise as heat climbs and cools. Best for game and event pages. |## The ambient mindset@@ -50,7 +51,7 @@ Passive, looping effects that hold visual interest without demanding attention.| 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 |+| 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, fire effect |## See also- [06 — 3D & Advanced](../06-3d-advanced/) — GPU-intensive effects; WebGL shaders and particlesdiff --git a/animations/07-ambient-background/fire-effect/README.md b/animations/07-ambient-background/fire-effect/README.mdnew file mode 100644index 00000000..839d24d3--- /dev/null+++ b/animations/07-ambient-background/fire-effect/README.md@@ -0,0 +1,58 @@+# Fire Effect++[Live demo](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/fire-effect/)++## What it is+A fire effect fills the bottom of a dark area with flames that flicker, rise and die out, with sparks drifting up. It is made from a small grid of heat values: the bottom row is always as hot as it gets, heat climbs one row at a time with a little sideways wobble, and it cools on the way up, so the hot base turns into tongues of flame. It is the classic fire of early computer games, drawn soft.++## When to use it+- Game sites and launch pages for games+- Sale, countdown and event banners that want urgency+- Night, festival and campfire themes+- Short intros where a burst of energy fits the brand++## How it works+The fire is a grid of numbers between 0 (cold) and 1 (hottest), about one cell per five pixels of the box. The bottom row sits just below the box and is set to full heat every step (only its middle, for a campfire). Every other cell takes the heat of the cell below it, written straight up half the time and one cell to the left or the right the rest (more often toward the wind) and, half the time, a little cooler. So heat moves up a row each step, runs out about where the flame height says, and leaves hotter streaks where it happened to cool less:++```js+for (let x = 0; x < cols; x++) heat[(rows - 1) * cols + x] = base(x); // the hidden row: always full heat+const cool = 2 / ((rows - 1) * HEIGHT[height]); // the average loss per row+for (let y = 1; y < rows; y++) for (let x = 0; x < cols; x++) {+ const r = rand(), dx = (r < .25 ? -1 : r < .75 ? 0 : 1) + (wind && rand() < .5 ? wind : 0); // left, stay, stay, right+ const nx = Math.min(cols - 1, Math.max(0, x + dx));+ heat[(y - 1) * cols + nx] = Math.max(0, heat[y * cols + x] - (rand() < .5 ? 0 : cool));+}+```++Each heat value, blended with its two side neighbors to soften the grain, picks one of 256 colors from the palette, dark when cool and near white when hot. The colors are written into a small canvas with one pixel per cell, and that canvas is the picture: its CSS size is the box's, so the browser stretches it smoothly, which is what makes the flames soft instead of blocky, and costs the script nothing:++```js+for (let y = 0; y < rows - 1; y++) for (let x = 0, i = y * cols; x < cols; x++, i++)+ pixels[i] = palette[Math.min(255, (heat[i - (x > 0)] + 2 * heat[i] + heat[i + (x < cols - 1)]) * 63.75 | 0)];+small.getContext('2d').putImageData(image, 0, 0); // small: a canvas element sized 100% of the box in CSS+```++The grid takes fixed steps of a 60th of a second from the time that has passed (at most two a frame), so the fire burns at the same speed on a 60 Hz and a 120 Hz screen; slow motion counts a third of the time. Sparks are drawn into the same small canvas as soft dots that rise from the hot cells, sway and fade, moved by the time itself. A new fire is run 200 steps from a fixed seed before it is first drawn, so it starts full; under reduced motion it waits paused on that full fire.++## Key parameters+| Parameter | Default | Effect |+|-----------|---------|--------|+| Flame height | Medium | Where the heat runs out, as a share of the box's height: low is about a third, medium about half and tall about four fifths; taller flames lose less heat per row |+| Fire shape | Along the edge | Along the edge heats the whole bottom row, so flames burn across the box; campfire heats only its middle third, fading to the sides, so the flames lean in and meet in a point |+| Colors | Orange | The palette from cool to hot: orange runs from dark red to yellow and white, blue from deep navy to pale blue, green from dark green to pale yellow |+| Wind | None | Left or right moves half of the heat one extra cell to that side each step, so the flames lean that way |+| Sparks | on | About 24 sparks a second rise from the flames and fade within one to two and a half seconds (10 a second on phones) |++## Production notes+- **Keep the grid small.** A grid of about 160 cells across is plenty when it is stretched with smoothing; a cell per pixel costs twenty-five times as much for flames that look the same. The demo uses at most 96 across on phones and half the cells in each half of Compare.+- **Fixed steps.** A grid that moves one row per frame burns twice as fast on a 120 Hz screen. Step it at a fixed rate from an accumulator, and cap the steps per frame so a slow device slows down instead of falling behind.+- **One small canvas, stretched by the browser.** Write the colors with `putImageData` into a canvas of one pixel per cell and give the canvas the box's CSS size: the browser scales it on its own, far cheaper than drawing a rectangle per cell or scaling it up with `drawImage` every frame.+- **Pause out of view.** A fire on a page section that has scrolled away still costs every frame: stop the loop with an `IntersectionObserver` and when the tab is hidden.+- **Reduced motion.** Show still flames; let the visitor start them with a play control.+- **Libraries and shaders.** The same fire is a few lines of a WebGL fragment shader with a noise function (for example in Three.js or PixiJS), which suits a full-screen fire; for a small banner, a canvas grid like this one is lighter. Lottie or a short looping video are the usual choices when the fire must look painted.++## See also+- [Game of Life](../game-of-life/) — a grid of cells that steps by simple rules+- [Cloth / Soft-Body Simulation](../../06-3d-advanced/cloth-simulation/) — fixed steps at the same rate on every screen+- [Volumetric Smoke / 3D Noise](../../06-3d-advanced/volumetric-smoke/) — smoke that drifts and curls+- [Fireworks](../fireworks/) — sparks that rise, burst and fadediff --git a/animations/07-ambient-background/fire-effect/index.html b/animations/07-ambient-background/fire-effect/index.htmlnew file mode 100644index 00000000..c711452f--- /dev/null+++ b/animations/07-ambient-background/fire-effect/index.html@@ -0,0 +1,365 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>Fire Effect — Animation Handbook</title>+ <meta name="description" content="Flames flicker and rise as heat climbs and cools. Best for game and event pages.">+ <link rel="canonical" href="https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/fire-effect/">+ <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="Fire Effect — Animation Handbook">+ <meta property="og:description" content="Flames flicker and rise as heat climbs and cools. Best for game and event pages.">+ <meta property="og:url" content="https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/fire-effect/">+ <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="Fire Effect — Animation Handbook">+ <meta name="twitter:description" content="Flames flicker and rise as heat climbs and cools. Best for game and event pages.">+ <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": "Fire Effect", "name": "Fire Effect", "description": "Flames flicker and rise as heat climbs and cools. Best for game and event pages.", "url": "https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/fire-effect/", "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, Fire Effect"}</script>+ <style>+ :root{--ui-accent:#ffce5a}+ *,*::before,*::after{box-sizing:border-box;margin:0;padding:0}+ .stage{position:relative;overflow:hidden;background:#070608}+ /* Each fire is a small canvas of one pixel per heat cell, stretched over its part of the box by the browser (smoothly, so the+ flames look soft); See inside draws on a canvas of the box's own size */+ .fire,#cvs{position:absolute;display:block;width:100%;height:100%;left:0;top:0}+ .fire.half,#cvs,.divide{display:none}+ .stage[data-hb-mode="inside"] .fire,.stage[data-hb-mode="compare"] .fire.whole{display:none}+ .stage[data-hb-mode="inside"] #cvs,.stage[data-hb-mode="compare"] .fire.half{display:block}+ .divide{position:absolute;left:calc(50% - 1px);top:0;width:2px;height:100%;background:#000}+ .stage[data-hb-mode="compare"] .divide{display:block}+ /* See inside and Compare: plain words over the picture */+ .fx-lbl{display:none;position:absolute;padding:3px 8px;border-radius:6px;background:rgba(7,6,8,.88);color:#f4f4f2;+ font:600 13px/1.25 var(--hb-font);white-space:nowrap;pointer-events:none}+ .stage[data-hb-mode="inside"] .in,.stage[data-hb-mode="compare"] .half{display:block}+ .in.what{left:10px;top:10px;white-space:normal;max-width:min(60%,330px)}+ .half{top:10px}.half.first{left:10px}.half.second{left:calc(50% + 10px)}+ @media(max-width:360px){.half.second{left:10px;top:calc(50% + 10px)}.divide{left:0;top:calc(50% - 1px);width:100%;height:2px}}+ </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="../ken-burns/" rel="prev" aria-label="Previous: Ken Burns Effect"><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>Ken Burns Effect</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.25 · Ambient & Background</p>+ <h1>Fire Effect</h1>+ <p class="hb-lede">Flames flicker and rise as heat climbs and cools. Best for game and event pages.</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 watch the heat rise.</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" role="img" aria-label="Flames flickering along the bottom of a dark box, with sparks drifting up">+ <canvas id="cvs" aria-hidden="true"></canvas><i class="divide" aria-hidden="true"></i>+ <p class="fx-lbl in what" aria-hidden="true" data-hb-caption>Each square holds one heat value: white is hottest</p>+ <p class="fx-lbl in" id="l-base" aria-hidden="true" data-hb-caption>Always full heat</p>+ <p class="fx-lbl in" id="l-up" aria-hidden="true" data-hb-caption>Heat moves up a row each step</p>+ <p class="fx-lbl in" id="l-cool" aria-hidden="true" data-hb-caption>It cools as it rises</p>+ <p class="fx-lbl half first" aria-hidden="true" data-hb-caption>Flickers in place</p>+ <p class="fx-lbl half second" aria-hidden="true" data-hb-caption>Heat rises</p>+ </div>+ <div class="hb-player">+ <button class="hb-play" type="button" id="btn-pause" data-hb-pause data-state="playing"><svg class="hb-ic hb-i-pause" viewBox="0 0 24 24" aria-hidden="true"><rect x="6" y="4" width="4" height="16" rx="1"/><rect x="14" y="4" width="4" height="16" rx="1"/></svg><svg class="hb-ic hb-i-play" viewBox="0 0 24 24" aria-hidden="true"><path d="M6 3l14 9-14 9z"/></svg><span class="hb-pause-label">Pause</span></button>+ <label class="hb-toggle"><input class="hb-switch" type="checkbox" role="switch" id="slow-tog" data-hb-slowmo autocomplete="off"><span>Slow motion</span></label>+ </div>+ <div class="hb-mode-notes" aria-live="polite">+ <p data-hb-for="inside" hidden>Inside, each square is one heat value, white the hottest: the hidden bottom row is always hot, heat moves up a row each step with a little sideways wobble, and it cools as it rises.</p>+ <p data-hb-for="compare" hidden>Flickers in place gives each spot new random heat every step, so it looks like static. Heat rises lifts heat from below and cools it on the way up, so it forms flames.</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="height-lbl">Flame height</p>+ <div class="seg" id="height-seg" role="group" aria-labelledby="height-lbl">+ <button type="button" data-h="low" aria-pressed="false">Low</button>+ <button type="button" data-h="medium" class="on" aria-pressed="true">Medium</button>+ <button type="button" data-h="tall" aria-pressed="false">Tall</button>+ </div>+ <p class="hb-hint">Tall flames cool more slowly as they rise.</p>+ </div>+ <div class="hb-setting">+ <p class="hb-setting-name" id="shape-lbl">Fire shape</p>+ <div class="seg" id="shape-seg" role="group" aria-labelledby="shape-lbl">+ <button type="button" data-shape="edge" class="on" aria-pressed="true">Along the edge</button>+ <button type="button" data-shape="camp" aria-pressed="false">Campfire</button>+ </div>+ <p class="hb-hint">Campfire heats only the middle, so the flames meet in a point.</p>+ </div>+ <div class="hb-setting">+ <p class="hb-setting-name" id="color-lbl">Colors</p>+ <div class="swatches" id="color-sw" role="group" aria-labelledby="color-lbl">+ <button type="button" class="on" aria-pressed="true" aria-label="Orange" data-col="orange" style="background:#f5781a"></button>+ <button type="button" aria-pressed="false" aria-label="Blue" data-col="blue" style="background:#2a8cf0"></button>+ <button type="button" aria-pressed="false" aria-label="Green" data-col="green" style="background:#50c828"></button>+ </div>+ <p class="hb-hint">The color of the heat.</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">+ <p class="hb-setting-name" id="wind-lbl">Wind</p>+ <div class="seg" id="wind-seg" role="group" aria-labelledby="wind-lbl">+ <button type="button" data-w="0" class="on" aria-pressed="true">None</button>+ <button type="button" data-w="-1" aria-pressed="false">Left</button>+ <button type="button" data-w="1" aria-pressed="false">Right</button>+ </div>+ <p class="hb-hint">Leans the flames to one side.</p>+ </div>+ <div class="hb-setting">+ <label class="hb-switch-row"><span>Sparks</span><input class="hb-switch" type="checkbox" role="switch" id="spark-tog" checked autocomplete="off"></label>+ <p class="hb-hint">Small sparks drift up from the flames.</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 fire effect to [the dark section or edge you want to set alight]. Keep a small grid of heat values whose bottom row always holds full heat. Many times a second, give each cell the heat of a cell just below it, nudged sideways and cooled a little at random, so heat rises, flickers and dies out. Color each cell by its heat with the palette the settings choose, dark when cool and brightest when hot, and draw the grid on a small canvas stretched over the area so the flames look soft. Step the grid at a fixed rate on every screen, coarser on phones. If the visitor has reduced motion turned on, show still flames. 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>Game sites</li><li>Sale and event banners</li><li>Night and festival themes</li></ul>+ <h3>Avoid on</h3>+ <ul class="hb-tags hb-avoid"><li>Reading pages</li><li>Light themes</li></ul>+ </div>+ </section>++ <section class="hb-related" aria-labelledby="hb-related-title" hidden>+ <h2 id="hb-related-title">Similar animations</h2>+ <div class="hb-rel-list"></div>+ </section>+</main>+<footer class="hb-foot"><span>Animation Handbook</span><a href="https://github.com/matinmonshizadeh/animation-handbook" target="_blank" rel="noopener">Source on GitHub</a><a href="#top">Back to top ↑</a></footer>+<script>+ const cvs=document.getElementById('cvs'),ctx=cvs.getContext('2d'),stage=cvs.parentElement,divide=stage.querySelector('.divide');+ const slowTog=document.getElementById('slow-tog'),sparkTog=document.getElementById('spark-tog');+ const reduceMQ=matchMedia('(prefers-reduced-motion: reduce)'),phone=matchMedia('(max-width:600px),(max-height:500px)');+ const narrow=matchMedia('(max-width:360px)'); // where the Compare halves stack, as the labels do+ const FRAME=1000/60,SEED=11,WARM=200; // one step is a 60th of a second; a new fire is run 200 steps from a fixed seed, so it starts full+ const HEIGHT={low:.32,medium:.52,tall:.78}; // the share of the box the flames reach+ const PALETTES={orange:[[7,6,8],[96,10,6],[196,44,10],[245,120,26],[255,204,80],[255,250,226]],+ blue:[[7,6,8],[8,14,70],[24,60,180],[42,140,240],[150,222,255],[238,250,255]],+ green:[[7,6,8],[6,44,14],[24,124,34],[80,200,40],[196,250,120],[246,255,224]]};+ const LABELS={normal:'Flames flickering along the bottom of a dark box, with sparks drifting up',+ inside:'The fire as a grid of gray squares, one heat value each, with the always-hot bottom row, rising arrows and a bar that cools upward',+ compare:'Two fires side by side: random flicker that stays in place, and heat that rises into flames'};+ let height='medium',shape='edge',color='orange',wind=0,mode='normal',paused=false;+ let W=0,H=0,raf=0,lastT=null,acc=0,lut=null,main=null,pair=null;+ // A seeded random sequence (32 random bits a call), so a new fire is the same fire every time; rand() gives 0 to 1+ function rng(s){let x=s|0||1;return()=>{x^=x<<13;x^=x>>>17;x^=x<<5;return x>>>0}}+ // The palette as 256 colors, from cool (dark) to hot (near white), as the pixels of an ImageData want them+ function makeLut(){+ const stops=PALETTES[color],out=new Uint32Array(256);+ for(let i=0;i<256;i++){const p=i/255*(stops.length-1),k=Math.min(stops.length-2,Math.floor(p)),f=p-k,a=stops[k],b=stops[k+1];+ out[i]=255<<24|Math.round(a[2]+(b[2]-a[2])*f)<<16|Math.round(a[1]+(b[1]-a[1])*f)<<8|Math.round(a[0]+(b[0]-a[0])*f)}+ return out;+ }+ // One fire in a rectangle of the box (in shares of its size): cols × rows heat values, the last row hidden below the box, drawn+ // on a small canvas of one pixel per cell that the browser stretches over the rectangle. flicker: the common mistake, new random+ // heat in place every step.+ function Fire(rect,cols,flicker,seed,half){+ const cell=rect.w*W/cols,rows=Math.max(8,Math.round(rect.h*H/cell))+1,small=document.createElement('canvas'),bits=rng(seed);+ small.width=cols;small.height=rows-1;small.className='fire '+(half?'half':'whole');small.setAttribute('aria-hidden','true');+ Object.assign(small.style,{left:rect.x*100+'%',top:rect.y*100+'%',width:rect.w*100+'%',height:rect.h*100+'%'});+ divide.before(small);+ return {cols,rows,flicker,half,h:new Float32Array(cols*rows),bits,rand:()=>bits()/4294967296,sparks:[],sctx:small.getContext('2d'),img:new ImageData(cols,rows-1)};+ }+ const base=(f,x)=>shape==='edge'?1:Math.max(0,1-Math.abs(x+.5-f.cols/2)/(f.cols*.16));+ // One step: the hidden bottom row gets full heat (only its middle for a campfire); every other cell takes the heat of the cell+ // below it, written one cell to the side at random (and more often toward the wind), and half the time a little cooler, so heat+ // moves up a row each step, runs out at the chosen height and leaves hotter streaks where it happened to cool less+ function step(f){+ const {cols:c,rows:r,h,rand,bits}=f;+ if(f.flicker){const hh=HEIGHT[height];for(let y=0;y<r-1;y++){const k=Math.pow(Math.max(0,(y/(r-2)-1+hh)/hh),2.2);for(let x=0;x<c;x++)h[y*c+x]=rand()*k*base(f,x)}return}+ for(let x=0;x<c;x++)h[(r-1)*c+x]=base(f,x);+ const cool=2/((r-1)*HEIGHT[height]);+ // one draw of random bits a cell: two for the sideways step (left, stay, stay, right), one for cooling, one for the wind+ for(let y=1;y<r;y++)for(let x=0,i=y*c;x<c;x++,i++){+ const n=bits(),q=n&3;let nx=x+(q===3?0:q-1)+(wind&&n&16?wind:0);+ nx=nx<0?0:nx>=c?c-1:nx;+ const v=h[i]-(n&8?cool:0);+ h[i-c-x+nx]=v>0?v:0;+ }+ }+ // Sparks rise from the hot cells and fade, moved by the time that passed (s seconds); fewer on phones and in each Compare half+ function sparks(f,s){+ const {rand}=f,rate=(phone.matches?10:24)*(f.half?.5:1);+ if(sparkTog.checked&&rand()<rate*s){let x=rand()*f.cols;if(base(f,Math.floor(x))<.5)x=f.cols/2+(rand()-.5)*f.cols*.2;+ f.sparks.push({x:x/f.cols,y:1-HEIGHT[height]*(.25+rand()*.45),vy:.18+rand()*.22,ph:rand()*6.28,life:1.2+rand()*1.2,age:0})}+ for(const p of f.sparks){p.age+=s;p.y-=p.vy*s;p.x+=Math.sin(p.ph+p.age*3)*.02*s+wind*.03*s}+ f.sparks=f.sparks.filter(p=>p.age<p.life&&p.y>0);+ }+ // A new fire for every rectangle of the current mode, run WARM steps from its seed, so it is full from the first frame+ function build(){+ stage.querySelectorAll('.fire').forEach(c=>c.remove());+ const stack=narrow.matches,max=phone.matches?96:160;+ // about one cell per five pixels, at most 160 across (96 on phones); a Compare half covers half the box, so half the cells+ const make=(rect,flicker,seed,half)=>{const f=Fire(rect,Math.max(16,Math.min(max,Math.round(rect.w*W/5))),flicker,seed,half);+ for(let i=0;i<WARM;i++){step(f);sparks(f,FRAME/1000)}return f};+ main=make({x:0,y:0,w:1,h:1},false,SEED,false);+ const halves=stack?[{x:0,y:0,w:1,h:.5},{x:0,y:.5,w:1,h:.5}]:[{x:0,y:0,w:.5,h:1},{x:.5,y:0,w:.5,h:1}];+ pair=halves.map((rect,i)=>make(rect,i===0,SEED+i,true));+ }+ // A fire's picture: its heat as colors, then its sparks as soft dots (a cell wide, at their own place between cells)+ function paint(f){+ const {cols:c,rows:r,h,img,sctx}=f,px=new Uint32Array(img.data.buffer);+ // each pixel blends a cell with its two side neighbors, which softens the grain across and keeps the streaks that rise+ for(let y=0;y<r-1;y++)for(let x=0,i=y*c;x<c;x++,i++)px[i]=lut[Math.min(255,(h[i-(x>0)]+2*h[i]+h[i+(x<c-1)])*63.75|0)];+ sctx.putImageData(img,0,0);+ sctx.fillStyle=`rgb(${PALETTES[color][5].join()})`;+ for(const p of f.sparks){sctx.globalAlpha=1-p.age/p.life;sctx.fillRect(p.x*c-.5,p.y*(r-1)-.5,1,1)}+ sctx.globalAlpha=1;+ }+ // See inside: the same fire as big squares in grays (one heat value each, white the hottest), its hidden bottom row shown and+ // white, rising arrows with a sideways wobble (toward the wind), and at the side a bar in the fire's colors that cools upward+ // The squares are one pixel each on a small canvas, drawn up with smoothing off, and the gaps between them one path on top+ const grid=document.createElement('canvas'),gctx=grid.getContext('2d');let gimg=null;+ function paintInside(){+ const f=main,{cols:c,rows:r,h}=f,B=phone.matches?6:5,bc=Math.ceil(c/B),s=W/bc,br=Math.ceil(H/s);+ if(!gimg||gimg.width!==bc||gimg.height!==br){grid.width=bc;grid.height=br;gimg=gctx.createImageData(bc,br)}+ const px=new Uint32Array(gimg.data.buffer);+ for(let j=0;j<br;j++)for(let i=0;i<bc;i++){const y=r-1-j*B,g=Math.round(18+(y<0?0:h[y*c+Math.min(c-1,i*B+(B>>1))])*237);px[(br-1-j)*bc+i]=0xff000000|g<<16|g<<8|g}+ gctx.putImageData(gimg,0,0);ctx.imageSmoothingEnabled=false;ctx.drawImage(grid,0,H-br*s,W,br*s);+ ctx.strokeStyle='#111014';ctx.lineWidth=2;ctx.beginPath();+ for(let i=0;i<=bc;i++){ctx.moveTo(i*s,0);ctx.lineTo(i*s,H)}+ for(let j=0;j<=br;j++){ctx.moveTo(0,H-j*s);ctx.lineTo(W,H-j*s)}+ ctx.stroke();+ for(const p of f.sparks){ctx.fillStyle='#fff';ctx.fillRect(p.x*W-1.5,p.y*H-1.5,3,3)}+ const top=H*(1-HEIGHT[height]),d=wind*s*.5,segs=phone.matches?2:3,y0=H-1.5*s,at=layout(s,top,d,segs,y0);+ ctx.lineCap='round';ctx.lineJoin='round';+ for(const x of at)for(const [w,col] of [[6,'#111014'],[2.5,'#ffce5a']]){ctx.strokeStyle=col;ctx.lineWidth=w;ctx.beginPath();+ ctx.moveTo(x,y0);for(let k=1;k<=segs;k++)ctx.lineTo(x+d+(k<segs?(k%2?-.5:.5)*s:0),y0-k*s);+ const tx=x+d,ty=y0-segs*s;ctx.moveTo(tx-6,ty+7);ctx.lineTo(tx,ty);ctx.lineTo(tx+6,ty+7);ctx.stroke()}+ const bar=ctx.createLinearGradient(0,H-s,0,top),st=PALETTES[color];+ st.forEach((col,i)=>bar.addColorStop(1-i/(st.length-1),`rgb(${col.join()})`));+ ctx.fillStyle='#111014';ctx.fillRect(W-30,top-2,18,H-s-top+4);ctx.fillStyle=bar;ctx.fillRect(W-28,top,14,H-s-top);+ }+ // Where See inside's labels and arrows go, worked out again only when the box or a setting moves them. The always-hot row's label+ // sits just above it, or, for a campfire, in it beside its hot middle; the arrows share the width the labels leave (over a+ // campfire's middle); "Heat moves up" sits over their tips and "It cools" beside the bar's top, lifted over the other if they meet+ let laidOut='',arrowsAt=[];+ function layout(s,top,d,segs,y0){+ const lb=document.getElementById('l-base'),lu=document.getElementById('l-up'),lc=document.getElementById('l-cool'),what=stage.querySelector('.in.what');+ const key=[W,H,s,shape,height,wind,segs,what.offsetHeight,lu.offsetWidth].join();if(key===laidOut)return arrowsAt;laidOut=key; // the sizes: once the font loads+ const R=el=>({l:el.offsetLeft,t:el.offsetTop,r:el.offsetLeft+el.offsetWidth,b:el.offsetTop+el.offsetHeight});+ const camp=shape==='camp',hot0=W*.34,hot1=W*.66,reach=.5*s+Math.abs(d)+8;+ // beside a campfire's middle on a narrow box the label takes two lines, so it stays off the hot squares+ lb.style.whiteSpace=camp?'normal':'';lb.style.maxWidth=camp?Math.max(80,hot0-18)+'px':'';+ if(camp)place(lb,hot0-6-lb.offsetWidth,Math.min(H-s+(s-lb.offsetHeight)/2,H-lb.offsetHeight-4));else place(lb,12,H-s-lb.offsetHeight-6);+ const a0=camp?hot0+reach*.5:R(lb).r+reach,a1=camp?hot1-reach*.5:W-36-reach;let n=camp?(phone.matches?1:2):(phone.matches?2:3);+ while(n>1&&(a1-a0)/n<1.1*s+Math.abs(d))n--; // fewer arrows where they would cross+ arrowsAt=Array.from({length:n},(_,i)=>a0+(a1-a0)*(i+.5)/n);+ const tipY=y0-segs*s-4,below=R(what).b+6,mid=arrowsAt.reduce((a,b)=>a+b,0)/n+d;+ place(lu,Math.min(mid-lu.offsetWidth/2,W-36-lu.offsetWidth),Math.max(below,tipY-lu.offsetHeight-6)); // never over the bar+ const U=R(lu),cx=W-36-lc.offsetWidth;let cy=Math.min(top+4,tipY-lc.offsetHeight-6);+ if(cx<U.r&&cx+lc.offsetWidth>U.l)cy=Math.min(cy,U.t-lc.offsetHeight-6);+ if(cx<R(what).r)cy=Math.max(cy,below);+ place(lc,cx,cy);+ return arrowsAt;+ }+ const place=(el,x,y)=>{el.style.left=Math.max(6,Math.min(W-el.offsetWidth-6,x))+'px';el.style.top=Math.max(6,Math.min(H-el.offsetHeight-6,y))+'px'};+ function draw(){+ if(mode==='inside')paintInside();+ else (mode==='compare'?pair:[main]).forEach(paint);+ }+ // The loop takes fixed steps of a 60th of a second from the time that passed (a third of it in slow motion), at most two a+ // frame, and draws every frame, as the sparks move by the time itself. Compare steps its own two fires, so Normal's waits as it was.+ function loop(ts){+ raf=requestAnimationFrame(loop);+ if(lastT===null){lastT=ts;return}+ const dt=Math.min(ts-lastT,50)*(slowTog.checked?1/3:1);lastT=ts;acc+=dt;+ const fires=mode==='compare'?pair:[main];let n=0;+ while(acc>=FRAME-1&&n<2){fires.forEach(step);acc-=FRAME;n++}+ if(acc>FRAME)acc=0;+ fires.forEach(f=>sparks(f,dt/1000));+ draw();+ }+ function start(){if(raf||paused)return;lastT=null;acc=0;raf=requestAnimationFrame(loop)}+ // Registered at the top level: under reduced motion the shared script pauses the loop at once, and the full fire stays still+ document.addEventListener('hb:pause',e=>{paused=e.detail.paused;notes();if(paused){cancelAnimationFrame(raf);raf=0}else start()});+ document.addEventListener('visibilitychange',()=>{lastT=null;acc=0});+ // The mode switch draws the mode at once, playing or paused; each mode keeps its own fire, so Normal comes back as it was+ document.addEventListener('hb:mode',e=>{mode=e.detail.mode;stage.setAttribute('aria-label',LABELS[mode]);if(W)draw()});+ // A real change of the box's size builds new fires for it (a phone's address bar sliding leaves it as it was); the box is watched+ // itself, so its size once the page's styles have loaded counts too+ function resize(){+ const w=stage.clientWidth,h=stage.clientHeight;if(!w||!h||(w===W&&h===H))return;W=w;H=h;+ const dpr=Math.min(devicePixelRatio||1,2);cvs.width=W*dpr;cvs.height=H*dpr;ctx.setTransform(dpr,0,0,dpr,0,0);+ build();draw();+ }+ // A setting changes the fire as it plays; while paused it builds the fire again with the new setting, so the change shows+ function changed(rebuild){if(paused&&rebuild)build();if(W)draw()}+ function choices(id,pick,rebuild){+ 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);changed(rebuild);+ }));+ }+ choices('height-seg',d=>{height=d.h},true);+ choices('shape-seg',d=>{shape=d.shape},true);+ choices('color-sw',d=>{color=d.col;lut=makeLut()},false);+ choices('wind-seg',d=>{wind=+d.w},true);+ // Sparks switched off go at once from every fire, so none are left to fade in a view not shown yet+ sparkTog.addEventListener('change',()=>{if(!sparkTog.checked&&main)[main,...pair].forEach(f=>{f.sparks=[]});changed(true)});+ // Under reduced motion the loop starts paused on a full fire, and the notes say so while it is paused; playing, the fire burns+ // as it does without reduced motion, and the markup's words hold+ const said={inside:document.querySelector('[data-hb-for="inside"]').textContent,compare:document.querySelector('[data-hb-for="compare"]').textContent};+ const STILL={inside:'Shown still: each square is one heat value, white the hottest; the hidden bottom row is always hot, heat moves up a row each step, and it cools as it rises. Press Play to watch.',+ compare:'Shown still: Flickers in place gives each spot new random heat every step, like static; Heat rises lifts heat from below and cools it, so it forms flames. Press Play to watch.'};+ function notes(){const still=reduceMQ.matches&&paused;for(const k of ['inside','compare'])document.querySelector(`[data-hb-for="${k}"]`).textContent=still?STILL[k]:said[k]}+ notes();+ reduceMQ.addEventListener('change',notes); // the device's setting changed after load: the shared script pauses only when it turns on+ lut=makeLut();+ resize();+ new ResizeObserver(resize).observe(stage);+ if(!reduceMQ.matches)start(); // under reduced motion the shared script pauses it at once: no step may come first, so the still is the seeded one+</script>+</body>+</html>diff --git a/animations/07-ambient-background/fireworks/README.md b/animations/07-ambient-background/fireworks/README.mdindex ccbf641a..7bd85c4e 100644--- a/animations/07-ambient-background/fireworks/README.md+++ b/animations/07-ambient-background/fireworks/README.md@@ -71,3 +71,4 @@ At Rarely and Sometimes the sky between bursts ends up clean. At Often, where bu- [Snow / Rain](../snow-rain/) — particles over the same kind of dark scene, falling instead of bursting- [Flow Field](../flow-field/) — particles that leave fading trails with the same see-through cover- [Starfield / Space Particles](../starfield/) — short trails from a cover that is the same on every screen+- [Fire Effect](../fire-effect/) — flames from a grid of heat, with sparks that rise and fadediff --git a/animations/07-ambient-background/ken-burns/index.html b/animations/07-ambient-background/ken-burns/index.htmlindex dda9358b..83c63c6f 100644--- a/animations/07-ambient-background/ken-burns/index.html+++ b/animations/07-ambient-background/ken-burns/index.html@@ -98,7 +98,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="../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>+ <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><a href="../fire-effect/" rel="next" aria-label="Next: Fire Effect"><span><span class="hb-dir">Next: </span>Fire 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/index.html b/index.htmlindex bee2ce8b..87c2deee 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 — 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.">+<title>Animation Handbook — 175 Web Animation Techniques with Live Demos</title>+<meta name="description" content="A free visual reference of 175 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 — 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:title" content="Animation Handbook — 175 Web Animation Techniques with Live Demos">+<meta property="og:description" content="A free visual reference of 175 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 — 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:title" content="Animation Handbook — 175 Web Animation Techniques with Live Demos">+<meta name="twitter:description" content="A free visual reference of 175 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 174 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 175 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"],@@ -1396,6 +1396,15 @@ button,input{font:inherit;color:inherit}.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;background-size:100% 100%,100% 22%,100% 100%;background-position:0 0,0 54%,0 0;background-repeat:no-repeat;--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)}}+.pv-fire{background:radial-gradient(70% 40% at 50% 100%,#5a1a0866,#0000),#070608;overflow:hidden;container-type:size}+.pv-fire i{position:absolute;bottom:-4%;width:30%;height:66%;border-radius:50% 50% 46% 46%/88% 88% 12% 12%;transform-origin:50% 100%;+ background:radial-gradient(48% 100% at 50% 100%,#fffbe0 0 14%,#ffd250 32%,#f5781a 56%,#c42c0a 78%,#0000 96%);mix-blend-mode:screen;animation:fire-tongue 1.6s ease-in-out infinite alternate}+.pv-fire .t1{left:6%;height:52%}.pv-fire .t2{left:26%;animation-delay:-.5s}.pv-fire .t3{left:46%;height:72%;animation-delay:-1s}.pv-fire .t4{left:66%;height:56%;animation-delay:-1.3s}+.pv-fire b{position:absolute;bottom:24%;width:1.4%;aspect-ratio:1;border-radius:50%;background:#ffd250;opacity:0;animation:fire-spark 2.4s linear infinite}+.pv-fire .k1{left:22%}.pv-fire .k2{left:47%;animation-delay:-.8s}.pv-fire .k3{left:71%;animation-delay:-1.6s}+@keyframes fire-tongue{0%{transform:scaleY(.86) skewX(-4deg)}100%{transform:scaleY(1.08) skewX(5deg)}}+@keyframes fire-spark{0%{opacity:0;transform:translate(0,0)}15%{opacity:1}100%{opacity:0;transform:translate(1.5cqw,-58cqh)}}+/* ── 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}@@ -1714,7 +1723,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>174 free animations · no coding needed</p>+ <p class="pill"><span class="pill-dot" aria-hidden="true"></span>175 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">@@ -1779,14 +1788,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 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="more" id="more"><button type="button" class="bigbtn" id="more-btn"><span id="more-label">Browse all 175 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 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/<category>/<name>/</code>.</p></noscript>+ <noscript><p class="noscript">This page shows its animations with JavaScript. All 175 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/<category>/<name>/</code>.</p></noscript></section><section class="how" id="how" aria-labelledby="how-title">@@ -1804,7 +1813,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">174 web animations with live demos and copyable prompts.</p>+ <p class="foot-t">175 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>@@ -2041,6 +2050,7 @@ const CATS=[['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.'],+ ['fire-effect','Fire Effect','Flames flicker and rise as heat climbs and cools. Best for game and event pages.'],]}];@@ -2058,7 +2068,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','ken-burns':'kenburns',+ 'topographic-lines':'topo','light-rays':'rays','game-of-life':'life','ken-burns':'kenburns','fire-effect':'fire','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',@@ -2277,7 +2287,8 @@ const PLACES={'topographic-lines':['bg'],'light-rays':['bg','intro'],'game-of-life':['bg'],- 'ken-burns':['imgcard','bg','intro']+ 'ken-burns':['imgcard','bg','intro'],+ 'fire-effect':['bg','intro']};// What moved, when and how: the finder's answers for each card, the main one first.const FIND={@@ -2461,7 +2472,8 @@ const FIND={'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'],- 'ken-burns':['card background','loop load','grow slide fade']+ 'ken-burns':['card background','loop load','grow slide fade'],+ 'fire-effect':['background','loop','glitch color drift']};// 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@@ -2588,6 +2600,7 @@ function pvMarkup(k){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 'fire': return [1,2,3,4].map(k=>'<i class="t'+k+' anim"></i>').join('')+[1,2,3].map(k=>'<b class="k'+k+' anim"></b>').join('');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.txtindex 1f91a2b7..f1e1dead 100644--- a/llms.txt+++ b/llms.txt@@ -1,8 +1,8 @@# Animation Handbook-> 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.+> A visual reference of 175 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 174 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 175 prompts and settings at once, install the Agent Skill: `npx skills add matinmonshizadeh/animation-handbook`.## Scroll-Based@@ -198,6 +198,7 @@ Each page plays one technique live and gives a ready-made prompt that describes- [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.+- [Fire Effect](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/fire-effect/): Flames flicker and rise as heat climbs and cools. Best for game and event pages.## Famous effects@@ -206,14 +207,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 174 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 175 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 24 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 25 Ambient & Background entries, each with its prompt and its settings, with the demo's values## Optionaldiff --git a/og-image.png b/og-image.pngindex d6605379..271cc27f 100644Binary files a/og-image.png and b/og-image.png differdiff --git a/sitemap.xml b/sitemap.xmlindex 7d729dba..44358740 100644--- a/sitemap.xml+++ b/sitemap.xml@@ -171,9 +171,10 @@<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/plasma/</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/wave-layers/</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/snow-rain/</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/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/fireworks/</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/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-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>+ <url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/fire-effect/</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.mdindex 1738c8f3..4e550636 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 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.+description: Builds web animations from Animation Handbook, a set of 175 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 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.+[Animation Handbook](https://matinmonshizadeh.github.io/animation-handbook/) is a free reference of 175 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 174 in one list, grouped by category, with an index by place.+- [references/catalog.md](references/catalog.md): all 175 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, 24 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, 25 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.mdindex a8103f8e..81ff32cd 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. 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.+Passive, looping effects that hold visual interest without demanding attention — gradients, particles, grain, and glows. 25 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@@ -28,6 +28,7 @@ Passive, looping effects that hold visual interest without demanding attention- [Light Rays](#light-rays)- [Game of Life](#game-of-life)- [Ken Burns Effect](#ken-burns-effect)+- [Fire Effect](#fire-effect)## Animated Gradient Background@@ -538,3 +539,24 @@ Add a Ken Burns effect to [your hero photo or slideshow]. Slowly zoom and pan ea- 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.++## Fire Effect++Flames flicker and rise as heat climbs and cools. Best for game and event pages.++- Live demo: https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/fire-effect/+- How it runs: moves by itself+- Good for: Game sites · Sale and event banners · Night and festival themes+- Avoid on: Reading pages · Light themes++**Prompt**++Add a fire effect to [the dark section or edge you want to set alight]. Keep a small grid of heat values whose bottom row always holds full heat. Many times a second, give each cell the heat of a cell just below it, nudged sideways and cooled a little at random, so heat rises, flickers and dies out. Color each cell by its heat with the palette the settings choose, dark when cool and brightest when hot, and draw the grid on a small canvas stretched over the area so the flames look soft. Step the grid at a fixed rate on every screen, coarser on phones. If the visitor has reduced motion turned on, show still flames. 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):++- Flame height: Low · **Medium** · Tall. Where the heat runs out, as a share of the box's height: low is about a third, medium about half and tall about four fifths; taller flames lose less heat per row.+- Fire shape: **Along the edge** · Campfire. Along the edge heats the whole bottom row, so flames burn across the box; campfire heats only its middle third, fading to the sides, so the flames lean in and meet in a point.+- Colors: **Orange** · Blue · Green. The palette from cool to hot: orange runs from dark red to yellow and white, blue from deep navy to pale blue, green from dark green to pale yellow.+- Wind: **None** · Left · Right. Left or right moves half of the heat one extra cell to that side each step, so the flames lean that way.+- Sparks: **on** · off. About 24 sparks a second rise from the flames and fade within one to two and a half seconds (10 a second on phones).diff --git a/skills/animation-handbook/references/catalog.md b/skills/animation-handbook/references/catalog.mdindex 4bd4a6ac..f4bae37e 100644--- a/skills/animation-handbook/references/catalog.md+++ b/skills/animation-handbook/references/catalog.md@@ -1,6 +1,6 @@# Catalog-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.+All 175 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. 24 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. 25 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.@@ -212,6 +212,7 @@ Passive, looping effects that hold visual interest without demanding attention- [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.+- [Fire Effect](https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/fire-effect/): Flames flicker and rise as heat climbs and cools. Best for game and event pages. Places: Backgrounds, Page intros.## By place@@ -220,9 +221,9 @@ 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** (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+- **Backgrounds** (43): 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, Fire 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** (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+- **Page intros** (31): 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, Fire 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