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: Text Particles (05.19)
matin6b908a82dd4b
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.ymlindex b8d170bd..d154d8bf 100644--- a/.github/ISSUE_TEMPLATE/config.yml+++ b/.github/ISSUE_TEMPLATE/config.yml@@ -2,4 +2,4 @@ blank_issues_enabled: truecontact_links:- name: Browse the live handbookurl: https://matinmonshizadeh.github.io/animation-handbook/- about: See all 158 techniques running before filing an issue.+ about: See all 159 techniques running before filing an issue.diff --git a/README.md b/README.mdindex 7cfae9a2..8b213725 100644--- a/README.md+++ b/README.md@@ -1,14 +1,14 @@<div align="center">-<a href="https://matinmonshizadeh.github.io/animation-handbook/"><img src="og-image.png" alt="Animation Handbook — 158 web animation techniques with live demos" width="820"></a>+<a href="https://matinmonshizadeh.github.io/animation-handbook/"><img src="og-image.png" alt="Animation Handbook — 159 web animation techniques with live demos" width="820"></a># Animation Handbook-**A visual reference of 158 web animation techniques — every entry is a live, dependency-free demo you can open in the browser and read how it works.**+**A visual reference of 159 web animation techniques — every entry is a live, dependency-free demo you can open in the browser and read how it works.**[**Open the live handbook →**](https://matinmonshizadeh.github.io/animation-handbook/)-[](https://matinmonshizadeh.github.io/animation-handbook/) [](https://github.com/matinmonshizadeh/animation-handbook/stargazers) [](LICENSE)   +[](https://matinmonshizadeh.github.io/animation-handbook/) [](https://github.com/matinmonshizadeh/animation-handbook/stargazers) [](LICENSE)   </div>@@ -38,13 +38,13 @@ Everything is plain HTML, CSS, and JavaScript: no build step, no frameworks, no| 02 | [Entrance & Exit](#02) | 13 | Element-level animations for arriving and departing — fades, slides, reveals, flips, and text staggers. || 03 | [Page Transitions](#03) | 16 | Full-page transitions between routes or views — crossfades, slides, portals, morphs, and the browser-native API. || 04 | [Micro-Interactions](#04) | 38 | Short, user-triggered animations — hover, click, focus, loading states, and UI feedback patterns. |-| 05 | [Text & Typography](#05) | 18 | Animations specifically for type — kinetic motion, character-level effects, gradient flows, and word transformations. |+| 05 | [Text & Typography](#05) | 19 | Animations specifically for type — kinetic motion, character-level effects, gradient flows, and word transformations. || 06 | [3D & Advanced](#06) | 23 | WebGL, shaders, particles, 3D transforms, and the performance-sensitive effects that push the browser's limits. || 07 | [Ambient & Background](#07) | 23 | Passive, looping effects that hold visual interest without demanding attention — gradients, particles, grain, and glows. |## Full catalog-All 158 techniques, each linked to its live demo.+All 159 techniques, each linked to its live demo.<a id="01"></a>@@ -186,7 +186,7 @@ All 158 techniques, each linked to its live demo.<a id="05"></a>-### 05 · Text & Typography · 18 techniques+### 05 · Text & Typography · 19 techniques<sub>Animations specifically for type — kinetic motion, character-level effects, gradient flows, and word transformations.</sub>@@ -210,6 +210,7 @@ All 158 techniques, each linked to its live demo.- **[Split-Flap Board](animations/05-text-typography/split-flap-board/)** — Tiles flip through the letters to spell a word, like an airport board. Best for hero titles.- **[Neon Flicker](animations/05-text-typography/neon-flicker/)** — Glowing letters sputter now and then, like a worn neon sign. Best for night themes.- **[Handwriting Draw](animations/05-text-typography/handwriting-draw/)** — A word writes itself stroke by stroke, as if by a pen. Best for greetings and signatures.+- **[Text Particles](animations/05-text-typography/text-particles/)** — A word of dots scatters from your pointer and springs back. Best for intros.</details>diff --git a/animations/05-text-typography/README.md b/animations/05-text-typography/README.mdindex 67582bcf..c4617c20 100644--- a/animations/05-text-typography/README.md+++ b/animations/05-text-typography/README.md@@ -24,6 +24,7 @@ Animations specifically for type — where the letterforms themselves are the co| [Split-Flap Board](split-flap-board/) | Tiles flip through the letters to spell a word, like an airport board. Best for hero titles. || [Neon Flicker](neon-flicker/) | Glowing letters sputter now and then, like a worn neon sign. Best for night themes. || [Handwriting Draw](handwriting-draw/) | A word writes itself stroke by stroke, as if by a pen. Best for greetings and signatures. |+| [Text Particles](text-particles/) | A word of dots scatters from your pointer and springs back. Best for intros. |## Key principlesdiff --git a/animations/05-text-typography/handwriting-draw/index.html b/animations/05-text-typography/handwriting-draw/index.htmlindex cac33b5a..1303616d 100644--- a/animations/05-text-typography/handwriting-draw/index.html+++ b/animations/05-text-typography/handwriting-draw/index.html@@ -42,7 +42,7 @@<body class="hb" data-hb-kind="once" data-hb-autoplay><nav class="hb-bar" aria-label="Animation Handbook"><a class="hb-home" href="../../../"><svg class="hb-mark" viewBox="0 0 32 32" aria-hidden="true"><g class="g"><circle cx="11.16" cy="20.84" r="6.1"/><circle cx="15.12" cy="16.88" r="6.1"/><circle cx="18.51" cy="13.49" r="6.1"/></g><circle class="b" cx="21.2" cy="10.8" r="6.6"/></svg><span>Animation Handbook</span></a>- <span class="hb-pager"><a href="../neon-flicker/" rel="prev" aria-label="Previous: Neon Flicker"><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>Neon Flicker</span></a></span>+ <span class="hb-pager"><a href="../neon-flicker/" rel="prev" aria-label="Previous: Neon Flicker"><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>Neon Flicker</span></a><a href="../text-particles/" rel="next" aria-label="Next: Text Particles"><span><span class="hb-dir">Next: </span>Text Particles</span><svg class="hb-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></a></span></nav><main class="hb-page"><header class="hb-head">diff --git a/animations/05-text-typography/text-particles/README.md b/animations/05-text-typography/text-particles/README.mdnew file mode 100644index 00000000..5b79abfd--- /dev/null+++ b/animations/05-text-typography/text-particles/README.md@@ -0,0 +1,62 @@+# Text Particles++## What it is+Text particles draw a word as many small dots instead of solid letters. Each dot remembers its place in the word: the pointer pushes the nearby dots away and a spring pulls each one back, so the letters open up wherever you point and close again behind you.++## When to use it+- Hero titles and landing page headlines that reward the first hover+- Page intros and splash screens, where a visitor can play with a name before reading on+- Studio, portfolio and product names on a dark background+- Event and launch pages where one short word carries the page++## How it works+The word is drawn once, in white, on a hidden canvas the size of the stage, in the site font and as large as fits. `getImageData` reads the pixels back, and a dot is kept wherever a letter covers a point of a grid whose rows are offset by half a step, so the dots pack like a honeycomb. The grid is walked in half-step columns, so the dots come out in order from left to right:++```js+g.font = '900 ' + fs + 'px "Schibsted Grotesk"';+g.fillText(text, left, baseline);+const data = g.getImageData(bx, by, bw, bh).data, dy = gap * .866;+for (let c = 0, x = bx + gap / 2; x < bx + bw; c++, x += gap / 2)+ for (let y = by + gap / 2 + (c & 1) * dy; y < by + bh; y += 2 * dy)+ if (data[(((y | 0) - by) * bw + (x | 0) - bx) * 4 + 3] > 128) homes.push(x, y);+```++Every dot then has a home, a position and a speed. One step of 1/60 s pushes the dots inside the pointer's reach `R` away from it, harder the closer they are, while a spring pulls each dot home and it keeps only part of its speed:++```js+const P = 2.4 * K * R; // the push grows with the spring and the reach+let ax = (hx - x) * K, ay = (hy - y) * K; // the spring toward home+const dx = x - p.x, dy = y - p.y, d = Math.hypot(dx, dy);+if (d < R) { const f = (1 - d / R) * P / d; ax += dx * f; ay += dy * f; }+vx = (vx + ax) * D; vy = (vy + ay) * D; // D: the share of its speed a dot keeps+x += vx; y += vy;+```++Because the push grows with the spring `K`, a pointer that holds still opens a gap of the same size, about 0.7 of the reach, at every return speed; `K` and `D` only set how quickly the dots come back. A spring changes with the length of its step, so the frame loop adds up the time that has passed (a third of it in slow motion), takes one fixed step per 60th of a second and draws each dot between its last two steps. The motion is then the same on a 60 Hz and a 120 Hz screen, and slow motion stays smooth. Once the pointer has gone and every dot is within a third of a pixel of home, the dots are put home and the loop stops, so a word at rest costs nothing.++The palette is spread across the word as 32 colors, and each dot takes the color at its home, so it keeps its color as it flies. The dots come out from left to right, so the dots of one color follow each other: each color is one path of circles, filled once. A dot that is away from home is drawn again on top with the `lighter` blend, a little larger and brighter the further it was pushed, so it glows in its own color. Phones draw each dot as a small square of the same area with `fillRect`, which costs far less to paint than a path of circles. A new word or dot size samples the word again, and each new dot starts where an old one stands (both taken from left to right), so the dots flow into the new letters. Show me moves a pretend pointer through the word along a wavy path, drawn as a small light with a ring for its reach.++## Key parameters+| Parameter | Default | Effect |+|-----------|---------|--------|+| Dot size | Medium | How far apart the dots sit: small is 3 px, medium 4.2 and large 6, scaled with the word between 0.75 and 1.25 times; each dot is about three quarters of that step wide. Phones keep at most 2,000 dots, larger screens 6,000 |+| How far they scatter | Medium | The pointer's reach: short is 0.28 of the font size, medium 0.42 and far 0.65, counting the font as at least 120 px; a still pointer opens a gap about 0.7 of the reach wide |+| Colors | Sunset | The colors across the word, in 32 steps: Sunset runs from pink to gold, Cool from teal to purple, Rainbow through seven colors and White from white to pale gray; the glow behind the word matches |+| How fast they come back | Normal | The spring and the share of its speed a dot keeps each step: slow is 0.022 and 0.87, normal 0.045 and 0.82, fast 0.09 and 0.76. A dot pushed 100 px away is home in about 1.4, 1 or 0.8 seconds, after swinging about a sixth of the way past it |+| Your text | HELLO | The word, up to 10 letters, drawn as large as fits 86% of the stage's width and 42% of its height; an emptied field goes back to HELLO |++## Production notes+- **Wait for the font**: canvas text is drawn in whatever font is ready, so sampling before a web font loads gives the fallback letters. Call `document.fonts.load()` for the weight and the text first; the demo waits up to 1.5 seconds, and if the font arrives later the dots flow into it.+- **The dot count is the cost**: every frame moves and paints every dot, so keep it to a few thousand, group the circles into a few paths rather than one fill each, and stop the loop at rest. Painting many small circles is the slow part on a phone, which is why the demo draws squares there. For tens of thousands of dots, move them on the graphics chip with WebGL points instead (see GPGPU Particle System).+- **Fixed steps**: scaling one spring step by the frame time makes the spring stiffer or looser on faster screens. Take fixed steps from an accumulator and interpolate the drawing, as the demo does.+- **Sharp dots**: size the canvas backing store by `devicePixelRatio` (the demo caps it at 2) and keep the positions in CSS pixels with `setTransform`.+- **Touch**: `touch-action: none` on the canvas lets a finger drag through the word without scrolling the page. Keep the canvas from filling a phone screen, so the page can still be scrolled past it.+- **Accessibility**: a canvas is not text. Give it `role="img"` and an `aria-label` that holds the word, and keep a real heading in the page for screen readers and search engines.+- **Reduced motion**: the demo leaves every dot at home and only brightens the dots near the pointer.+- **Libraries**: tsParticles has a canvas mask plugin that places its particles inside text; PixiJS (a ParticleContainer) and three.js (Points) draw many thousands of dots with WebGL. GSAP can tween the dots to new homes when the word changes, while the push and the spring are simplest in your own frame loop.++## See also+- [Canvas Particle Effect](../../06-3d-advanced/canvas-particle-effect/) — dots drift, link up and dodge your pointer+- [Image Distortion on Hover](../../06-3d-advanced/image-distortion-hover/) — a picture bends and ripples around your pointer+- [Scramble / Glitch Text](../scramble-text/) — random symbols lock into the real text+- [GPGPU Particle System](../../06-3d-advanced/gpgpu-particle-system/) — tens of thousands of particles on the graphics chipdiff --git a/animations/05-text-typography/text-particles/index.html b/animations/05-text-typography/text-particles/index.htmlnew file mode 100644index 00000000..0e3e37c9--- /dev/null+++ b/animations/05-text-typography/text-particles/index.html@@ -0,0 +1,313 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>Text Particles — Animation Handbook</title>+ <meta name="description" content="A word of dots scatters from your pointer and springs back. Best for intros.">+ <link rel="canonical" href="https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/text-particles/">+ <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="Text Particles — Animation Handbook">+ <meta property="og:description" content="A word of dots scatters from your pointer and springs back. Best for intros.">+ <meta property="og:url" content="https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/text-particles/">+ <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="Text Particles — Animation Handbook">+ <meta name="twitter:description" content="A word of dots scatters from your pointer and springs back. Best for intros.">+ <meta name="twitter:image" content="https://matinmonshizadeh.github.io/animation-handbook/og-image.png">+ <script type="application/ld+json">{"@context": "https://schema.org", "@type": "TechArticle", "headline": "Text Particles", "name": "Text Particles", "description": "A word of dots scatters from your pointer and springs back. Best for intros.", "url": "https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/text-particles/", "inLanguage": "en", "articleSection": "Text & Typography", "isPartOf": {"@type": "WebSite", "name": "Animation Handbook", "url": "https://matinmonshizadeh.github.io/animation-handbook/"}, "author": {"@type": "Person", "name": "matinmonshizadeh"}, "keywords": "web animation, CSS animation, Text & Typography, Text Particles"}</script>+ <style>+ :root{--ui-accent:#ff6f8b}+ *,*::before,*::after{box-sizing:border-box;margin:0;padding:0}+ /* A dark stage with a soft glow of the word's colors behind it (still: only the dots move) */+ .stage{position:relative;overflow:hidden;background:radial-gradient(ellipse 60% 46% at 50% 50%,color-mix(in srgb,var(--glow,#ff6f8b) 14%,transparent),transparent 72%),#0b0b0d}+ /* touch-action none: a finger dragged over the word pushes the dots instead of scrolling the page */+ canvas{display:block;width:100%;height:100%;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}+ </style>+ <link rel="stylesheet" href="../../../assets/css/demo-page.css?v=6">+ <script src="../../../assets/js/demo-page.js?v=6" defer></script>+</head>+<body class="hb" data-hb-kind="do" data-hb-autoplay>+<nav class="hb-bar" aria-label="Animation Handbook">+ <a class="hb-home" href="../../../"><svg class="hb-mark" viewBox="0 0 32 32" aria-hidden="true"><g class="g"><circle cx="11.16" cy="20.84" r="6.1"/><circle cx="15.12" cy="16.88" r="6.1"/><circle cx="18.51" cy="13.49" r="6.1"/></g><circle class="b" cx="21.2" cy="10.8" r="6.6"/></svg><span>Animation Handbook</span></a>+ <span class="hb-pager"><a href="../handwriting-draw/" rel="prev" aria-label="Previous: Handwriting Draw"><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>Handwriting Draw</span></a></span>+</nav>+<main class="hb-page">+ <header class="hb-head">+ <p class="hb-cat">05.19 · Text & Typography</p>+ <h1>Text Particles</h1>+ <p class="hb-lede">A word of dots scatters from your pointer and springs back. Best for intros.</p>+ </header>++ <section class="hb-step hb-watch" aria-labelledby="hb-watch-title">+ <div class="hb-step-head">+ <span class="hb-num" aria-hidden="true">1</span>+ <div><h2 id="hb-watch-title">Hover it</h2><p>Move your pointer through the word, drag a finger across it, or press Show me.</p></div>+ </div>+ <div class="stage" id="stage">+ <canvas id="cvs" role="img" aria-label="The word HELLO, made of small dots"></canvas>+ </div>+ <div class="hb-player">+ <button class="hb-play" type="button" id="btn-demo" data-hb-demo><svg class="hb-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z"/></svg>Show me</button>+ <label class="hb-toggle"><input class="hb-switch" type="checkbox" role="switch" id="slow-tog" data-hb-slowmo autocomplete="off"><span>Slow motion</span></label>+ </div>+ </section>++ <section class="hb-step hb-try" aria-labelledby="hb-try-title">+ <div class="hb-step-head">+ <span class="hb-num" aria-hidden="true">2</span>+ <div><h2 id="hb-try-title">Try it</h2><p>Change a setting, then try it again or press Show me.</p></div>+ </div>+ <div class="hb-settings">+ <div class="hb-setting">+ <p class="hb-setting-name" id="size-lbl">Dot size</p>+ <div class="seg" id="size-seg" role="group" aria-labelledby="size-lbl">+ <button type="button" data-k="3" aria-pressed="false">Small</button>+ <button type="button" data-k="4.2" class="on" aria-pressed="true">Medium</button>+ <button type="button" data-k="6" aria-pressed="false">Large</button>+ </div>+ <p class="hb-hint">Smaller dots sit closer together, so the letters look finer.</p>+ </div>+ <div class="hb-setting">+ <p class="hb-setting-name" id="far-lbl">How far they scatter</p>+ <div class="seg" id="far-seg" role="group" aria-labelledby="far-lbl">+ <button type="button" data-k=".28" aria-pressed="false">Short</button>+ <button type="button" data-k=".42" class="on" aria-pressed="true">Medium</button>+ <button type="button" data-k=".65" aria-pressed="false">Far</button>+ </div>+ <p class="hb-hint">How wide a gap the pointer opens in the word.</p>+ </div>+ <div class="hb-setting">+ <p class="hb-setting-name" id="pal-lbl">Colors</p>+ <div class="seg" id="pal-seg" role="group" aria-labelledby="pal-lbl">+ <button type="button" data-pal="sunset" class="on" aria-pressed="true">Sunset</button>+ <button type="button" data-pal="cool" aria-pressed="false">Cool</button>+ <button type="button" data-pal="rainbow" aria-pressed="false">Rainbow</button>+ <button type="button" data-pal="white" aria-pressed="false">White</button>+ </div>+ <p class="hb-hint">The colors across the word, from left to right.</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="back-lbl">How fast they come back</p>+ <div class="seg" id="back-seg" role="group" aria-labelledby="back-lbl">+ <button type="button" data-b="slow" aria-pressed="false">Slow</button>+ <button type="button" data-b="normal" class="on" aria-pressed="true">Normal</button>+ <button type="button" data-b="fast" aria-pressed="false">Fast</button>+ </div>+ <p class="hb-hint">How quickly the dots spring back into the letters.</p>+ </div>+ <div class="hb-setting">+ <label class="hb-setting-name" for="text-inp">Your text</label>+ <input class="hb-text" type="text" id="text-inp" value="HELLO" maxlength="10" autocomplete="off">+ <p class="hb-hint">Short words work best, up to 10 letters.</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 text particle effect to [the word or short title you want to animate]. Sample the word's pixels from a hidden canvas on an even grid, placing a dot wherever a letter covers it. Push the dots near the pointer away, so they glow as they fly, and tie each to its home with a spring, so it flies back with a slight wobble once the pointer moves on. Run one frame loop that moves by elapsed time, stop it once every dot is home, and draw fewer dots on phones. On touch screens, a dragged finger pushes the dots the same way. With reduced motion turned on, keep the dots still and only light up those near the pointer. Match the settings listed below.</p>+ <div class="hb-chips-box" hidden>+ <p class="hb-chips-title">Your settings</p>+ <ul class="hb-chips"></ul>+ </div>+ <div class="hb-copy-row">+ <button class="hb-copy" type="button"><svg class="hb-ic hb-i-copy" viewBox="0 0 24 24" aria-hidden="true"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg><svg class="hb-ic hb-i-done" viewBox="0 0 24 24" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg><span class="hb-copy-label" aria-live="polite">Copy prompt</span></button>+ <p class="hb-hint">Replace the words in brackets with your own element. Your settings are added at the end.</p>+ </div>+ </div>+ </section>++ <section class="hb-about" aria-labelledby="hb-what-title">+ <div class="hb-what">+ <h2 id="hb-what-title">What it is</h2>+ <div class="hb-what-text"><p>The full explanation is in <a href="README.md">README.md</a>.</p></div>+ </div>+ <div class="hb-fit">+ <h2>Good for</h2>+ <ul class="hb-tags hb-good"><li>Hero titles</li><li>Page intros</li><li>Portfolios</li><li>Launch pages</li></ul>+ <h3>Avoid on</h3>+ <ul class="hb-tags hb-avoid"><li>Long text</li><li>Small 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="#top">Back to top ↑</a></footer>+<script>+ const stage=document.getElementById('stage'),cvs=document.getElementById('cvs'),ctx=cvs.getContext('2d'),txtIn=document.getElementById('text-inp');+ const slowTog=document.getElementById('slow-tog'),reduce=matchMedia('(prefers-reduced-motion: reduce)'),PHONE=matchMedia('(max-width:600px),(max-height:500px)');+ const FONT='"Schibsted Grotesk",system-ui,-apple-system,"Segoe UI",sans-serif',F100='900 100px "Schibsted Grotesk"',FRAME=1000/60,TAU=Math.PI*2;+ // Each palette: its colors from left to right across the word, and the glow behind it+ const PAL={sunset:[['#ff6f8b','#ff9d5c','#ffce5a'],'#ff6f8b'],cool:[['#3fd6c4','#6ea8ff','#b98cff'],'#6ea8ff'],+ rainbow:[['#ff6f8b','#ff9d5c','#ffce5a','#5fd88a','#3fd6c4','#6ea8ff','#b98cff'],'#b98cff'],white:[['#ffffff','#d4d4dc'],'#ffffff']};+ // How fast they come back: the spring (the share of the way home added to a dot's speed each step) and the speed a dot keeps+ const BACK={slow:[.022,.87],normal:[.045,.82],fast:[.09,.76]};+ let text='HELLO',gapK=4.2,far=.42,pal='sunset',back='normal',W=0,H=0,fs=0,box={l:0,r:0,t:0,b:0},R=60,rad=1.6,cols=[],sq=false,N=0;+ let hx,hy,x,y,px,py,vx,vy,bk,L1,L2,L3,user=null,touchId=null,run=null,ptr=null,mark=null,markA=0,lightAt=null,glow=0;+ let raf=0,lastT=null,acc=0,still=true,ready=false,wantShow=false;+ // The word is drawn on a hidden canvas the size of the stage (as large as fits 86% of its width and 42% of its height) and a dot+ // is kept wherever a letter covers a point of an offset grid, column by column, so the dots run left to right. At most 2,000 on phones.+ function sample(){+ if(!W||!H)return [];+ const off=document.createElement('canvas');off.width=W;off.height=H;+ const g=off.getContext('2d',{willReadFrequently:true}),ink=m=>[m.actualBoundingBoxLeft+m.actualBoundingBoxRight,m.actualBoundingBoxAscent+m.actualBoundingBoxDescent];+ const fit=s=>{g.font='900 '+s+'px '+FONT;g.letterSpacing=s*.04+'px';return g.measureText(text)},[w,h]=ink(fit(100));+ if(!(w>0&&h>0))return [];+ fs=Math.min(100*W*.86/w,100*H*.42/h);+ const m=fit(fs),[iw,ih]=ink(m);+ box={l:(W-iw)/2,r:(W+iw)/2,t:(H-ih)/2,b:(H+ih)/2};+ g.fillStyle='#fff';g.fillText(text,box.l+m.actualBoundingBoxLeft,box.t+m.actualBoundingBoxAscent);+ const bx=Math.max(0,Math.floor(box.l)-2),by=Math.max(0,Math.floor(box.t)-2),bw=Math.min(W,Math.ceil(box.r)+2)-bx,bh=Math.min(H,Math.ceil(box.b)+2)-by;+ const data=g.getImageData(bx,by,bw,bh).data,cap=PHONE.matches?2000:6000,grid=gap=>{const out=[],dy=gap*.866;+ for(let c=0,xx=bx+gap/2;xx<bx+bw;c++,xx+=gap/2)for(let yy=by+gap/2+(c&1)*dy;yy<by+bh;yy+=2*dy)+ if(data[(((yy|0)-by)*bw+(xx|0)-bx)*4+3]>128)out.push(xx,yy);+ return out};+ let gap=gapK*Math.min(1.25,Math.max(.75,fs/180)),pts=grid(gap);+ if(pts.length/2>cap){gap*=Math.sqrt(pts.length/2/cap)*1.02;pts=grid(gap);}+ rad=gap*.38;return pts;+ }+ // New homes for the dots. With fly, each new dot starts where an old one is (in the same left-to-right order), so they flow into the new letters.+ function rebuild(fly){+ const pts=sample(),n=pts.length/2,o={N,x,y,vx,vy};+ N=n;[hx,hy,x,y,px,py,vx,vy]=Array.from({length:8},()=>new Float32Array(n));[L1,L2,L3]=[0,0,0].map(()=>new Int32Array(n));bk=new Uint8Array(n);+ for(let j=0;j<n;j++){+ const k=fly&&o.N?Math.floor(j*o.N/n):-1;+ hx[j]=pts[2*j];hy[j]=pts[2*j+1];bk[j]=Math.min(31,Math.max(0,(hx[j]-box.l)/(box.r-box.l)*32|0));x[j]=px[j]=k<0?hx[j]:o.x[k];y[j]=py[j]=k<0?hy[j]:o.y[k];+ if(k>=0){vx[j]=o.vx[k];vy[j]=o.vy[k];}+ }+ R=far*Math.max(fs,120);paint();cvs.setAttribute('aria-label','The word '+text+', made of small dots');+ // Canvas text uses whatever font is ready: once the site font has loaded for these letters, the dots flow into it+ if(document.fonts&&!document.fonts.check(F100,text))document.fonts.load(F100,text).then(()=>{if(document.fonts.check(F100,text))rebuild(!reduce.matches)},()=>{});+ still=!(fly&&o.N)&&!user;+ if(still)draw(1);else wake();+ }+ // The palette as 32 colors from left to right; each dot takes the one at its home, so it keeps its color as it flies+ function paint(){const [stops,glowCol]=PAL[pal],rgb=stops.map(c=>[1,3,5].map(i=>parseInt(c.slice(i,i+2),16)));+ cols=Array.from({length:32},(_,k)=>{const t=k/31*(rgb.length-1),i=Math.min(rgb.length-2,t|0),f=t-i;return 'rgb('+rgb[i].map((v,j)=>Math.round(v+(rgb[i+1][j]-v)*f))+')';});+ stage.style.setProperty('--glow',glowCol);}+ // One step is 1/60 s. Inside the pointer's reach R a dot is pushed away, harder the closer it is; a spring pulls it home and it keeps+ // part of its speed. The push grows with the spring and the reach, so the gap it opens is the same share of R at every return speed.+ function step(){+ const [K,D]=BACK[back],P=2.4*K*R,R2=R*R,p=ptr;let maxE=0,maxV=0;+ for(let i=0;i<N;i++){+ px[i]=x[i];py[i]=y[i];+ let ax=(hx[i]-x[i])*K,ay=(hy[i]-y[i])*K;+ if(p){const dx=x[i]-p.x,dy=y[i]-p.y,d2=dx*dx+dy*dy;if(d2<R2&&d2>.01){const d=Math.sqrt(d2),f=(1-d/R)*P/d;ax+=dx*f;ay+=dy*f;}}+ vx[i]=(vx[i]+ax)*D;vy[i]=(vy[i]+ay)*D;x[i]+=vx[i];y[i]+=vy[i];+ maxE=Math.max(maxE,Math.abs(x[i]-hx[i])+Math.abs(y[i]-hy[i]));maxV=Math.max(maxV,Math.abs(vx[i])+Math.abs(vy[i]));+ }+ // With no pointer, dots within a third of a pixel of home are put there and the loop stops; under a still pointer, once they stop+ if(!p&&maxE<.3&&maxV<.05){home();still=true;}else still=!!p&&maxV<.02;+ }+ function home(){x.set(hx);y.set(hy);px.set(hx);py.set(hy);vx.fill(0);vy.fill(0);}+ const ease=(v,to,k,t)=>{const n=v+(to-v)*(1-Math.pow(1-k,t/FRAME));return Math.abs(to-n)<.01?to:n};+ // The loop runs only while something moves. It adds up the time (a third of it in slow motion), takes one step per 60th of a second+ // and draws the dots between their last two steps, so slow motion stays smooth; a first frame counts as one 60th.+ function frame(ts){+ const t=(lastT===null?FRAME:Math.min(ts-lastT,50))*(slowTog.checked?1/3:1),red=reduce.matches;lastT=ts;+ if(run){run.t+=t;mark=run.at(Math.min(run.t,run.dur));if(run.t>=run.dur)run=null;}+ ptr=run?mark:user;if(ptr)lightAt=ptr;+ markA=ease(markA,run?1:0,.25,t);glow=ease(glow,ptr?1:0,.2,t);+ if(!red){acc+=t;for(let n=0;acc>=FRAME-1&&n<3;n++){step();acc-=FRAME;}}+ draw(red?1:Math.min(1,Math.max(0,acc/FRAME)));+ raf=run||markA||(red?glow%1:!still)?requestAnimationFrame(frame):0;+ if(!raf){lastT=null;acc=0;}+ }+ function wake(){if(!raf&&N){lastT=null;acc=0;raf=requestAnimationFrame(frame);}}+ document.addEventListener('visibilitychange',()=>{lastT=null;acc=0;});+ // A dot away from home is drawn again, larger and added to itself, so it glows (under reduced motion: the dots near the pointer).+ function draw(a){+ ctx.clearRect(0,0,W,H);sq=PHONE.matches;+ const red=reduce.matches,l=lightAt,R2=R*R,far2=R*.6;let n1=0,n2=0,n3=0;+ for(let i=0;i<N;i++){+ let v=0;+ if(!red)v=(Math.abs(px[i]+(x[i]-px[i])*a-hx[i])+Math.abs(py[i]+(y[i]-py[i])*a-hy[i]))/far2;+ else if(glow&&l){const dx=hx[i]-l.x,dy=hy[i]-l.y,d2=dx*dx+dy*dy;if(d2<R2)v=(1-Math.sqrt(d2)/R)*glow;}+ if(v>.62)L3[n3++]=i;else if(v>.32)L2[n2++]=i;else if(v>.1)L1[n1++]=i;+ }+ dots(null,N,rad,a);+ ctx.globalCompositeOperation='lighter';+ ctx.globalAlpha=.3;dots(L1,n1,rad*1.09,a);ctx.globalAlpha=.55;dots(L2,n2,rad*1.18,a);ctx.globalAlpha=.85;dots(L3,n3,rad*1.27,a);+ ctx.globalCompositeOperation='source-over';ctx.globalAlpha=1;+ if(!markA||!mark)return; // a run's pretend pointer: a small light, and a ring for its reach+ ctx.globalAlpha=markA;ctx.lineWidth=1.5;ctx.strokeStyle='rgba(255,255,255,.3)';ctx.beginPath();ctx.arc(mark.x,mark.y,R,0,TAU);ctx.stroke();+ const g=ctx.createRadialGradient(mark.x,mark.y,0,mark.x,mark.y,14);+ g.addColorStop(0,'#fff');g.addColorStop(.35,'rgba(255,255,255,.9)');g.addColorStop(1,'rgba(255,255,255,0)');+ ctx.fillStyle=g;ctx.beginPath();ctx.arc(mark.x,mark.y,14,0,TAU);ctx.fill();ctx.globalAlpha=1;+ }+ // Dots of one color are one path, filled once (they run left to right, so each color comes once); phones draw cheaper squares+ function dots(list,n,s,a){let c=-1;+ for(let k=0;k<n;k++){+ const i=list?list[k]:k,X=px[i]+(x[i]-px[i])*a,Y=py[i]+(y[i]-py[i])*a;+ if(bk[i]!==c){if(c>=0&&!sq)ctx.fill();c=bk[i];ctx.fillStyle=cols[c];ctx.beginPath();}+ if(sq)ctx.fillRect(X-s*.89,Y-s*.89,s*1.77,s*1.77);else{ctx.moveTo(X+s,Y);ctx.arc(X,Y,s,0,TAU);}+ }+ if(c>=0&&!sq)ctx.fill();+ }+ // A mouse or a pen in the air pushes the dots as it moves over the word, a finger where it touches; the visitor's own pointer ends a run+ function aimAt(e){const b=cvs.getBoundingClientRect();user={x:e.clientX-b.left,y:e.clientY-b.top};wake();}+ cvs.addEventListener('pointermove',e=>{if(e.pointerType==='touch'&&e.pointerId!==touchId)return;if(e.isTrusted)run=null;aimAt(e);});+ cvs.addEventListener('pointerleave',e=>{if(e.pointerType!=='touch'){user=null;wake();}});+ cvs.addEventListener('pointerdown',e=>{if(e.pointerType==='touch'){touchId=e.pointerId;try{cvs.setPointerCapture(touchId)}catch(_){}}aimAt(e);});+ ['pointerup','pointercancel'].forEach(type=>cvs.addEventListener(type,e=>{if(e.pointerId===touchId){touchId=null;user=null;wake();}}));+ // The visitor pressed, typed, scrolled or touched inside the stage: the run stops and the dots go home, or follow the visitor+ document.addEventListener('hb:input',()=>{if(run){run=null;wake();}});+ // Show me: a pretend pointer sweeps through the word in 2.6 s, rising and falling; under reduced motion it rests on the middle for 1.4 s+ const middle=()=>({x:(box.l+box.r)/2,y:(box.t+box.b)/2});+ function showMe(){+ if(!N){wantShow=true;return;}+ run=reduce.matches?{t:0,dur:1400,at:middle}:{t:0,dur:2600,at:t=>{+ const s=t/2600,e=s<.5?2*s*s:1-2*(1-s)*(1-s),x0=box.l-R*.2,x1=box.r+R*.2;+ return {x:x0+(x1-x0)*e,y:(box.t+box.b)/2-(box.b-box.t)*.3*Math.sin(TAU*1.5*e)};+ }};+ wake();+ }+ document.getElementById('btn-demo').addEventListener('click',showMe);+ // A new reach or return speed shows at once: the pretend pointer touches the middle of the word for a moment+ function poke(){if(!run&&N){run={t:0,dur:reduce.matches?900:400,at:middle};wake();}}+ function choices(id,pick){+ const buttons=document.querySelectorAll('#'+id+' button');+ buttons.forEach(b=>b.addEventListener('click',()=>{+ if(b.classList.contains('on'))return; // pressing the choice already made does nothing+ buttons.forEach(o=>{o.classList.toggle('on',o===b);o.setAttribute('aria-pressed',String(o===b))});+ pick(b.dataset);+ }));+ }+ choices('size-seg',d=>{gapK=+d.k;if(ready)rebuild(!reduce.matches);});+ choices('far-seg',d=>{far=+d.k;R=far*Math.max(fs,120);poke();});+ choices('pal-seg',d=>{pal=d.pal;paint();if(!raf)draw(1);});+ choices('back-seg',d=>{back=d.b;poke();});+ // The word is the typed text with single spaces and none at its ends, or HELLO; an emptied field goes back to HELLO when left+ txtIn.addEventListener('input',()=>{const t=txtIn.value.replace(/\s+/g,' ').trim()||'HELLO';if(t!==text){text=t;if(ready)rebuild(!reduce.matches);}});+ txtIn.addEventListener('change',()=>{if(!txtIn.value.trim()){txtIn.value='HELLO';txtIn.dispatchEvent(new Event('input',{bubbles:true}));}});+ // The canvas works in CSS pixels, its backing store scaled by the pixel ratio (at most 2); a new stage size samples the word again+ function layout(){const w=stage.clientWidth,h=stage.clientHeight,dpr=Math.min(window.devicePixelRatio||1,2);+ if(!w||!h||(w===W&&h===H))return false;+ W=w;H=h;cvs.width=Math.round(W*dpr);cvs.height=Math.round(H*dpr);ctx.setTransform(dpr,0,0,dpr,0,0);return true;}+ // The first word waits for the site font (at most 1.5 s), so it does not form in a fallback font first+ function begin(){if(ready)return;ready=true;layout();rebuild(false);if(wantShow){wantShow=false;showMe();}}+ if(document.fonts&&document.fonts.load){document.fonts.load(F100,text).then(begin,begin);setTimeout(begin,1500);}else begin();+ new ResizeObserver(()=>{if(ready&&layout())rebuild(false);}).observe(stage);+ // Reduced motion switched on while the dots move: they are put home at once+ const onReduce=()=>{if(reduce.matches&&N){home();still=true;}run=null;wake();};+ if(reduce.addEventListener)reduce.addEventListener('change',onReduce);else if(reduce.addListener)reduce.addListener(onReduce);+</script>+</body>+</html>diff --git a/animations/06-3d-advanced/canvas-particle-effect/README.md b/animations/06-3d-advanced/canvas-particle-effect/README.mdindex 9c390c0b..02785645 100644--- a/animations/06-3d-advanced/canvas-particle-effect/README.md+++ b/animations/06-3d-advanced/canvas-particle-effect/README.md@@ -105,3 +105,4 @@ Stroking each link on its own costs one draw call per line, thousands a frame; g- [Noise-Based Motion](../noise-based-motion/) — dots moved by smooth noise instead of physics- [Particle Constellation](../../07-ambient-background/particle-constellation/) — calmer linked dots, as a background- [Flocking](../flocking/) — dots that follow their neighbors and swirl as one flock+- [Text Particles](../../05-text-typography/text-particles/) — dots that spell a word scatter from the pointer and spring backdiff --git a/docs/launch-kit.md b/docs/launch-kit.mdindex dda098f3..0b3cd1ea 100644--- a/docs/launch-kit.md+++ b/docs/launch-kit.md@@ -10,7 +10,7 @@ quality is already there; this is the distribution layer. Work top to bottom.GitHub → repo **Settings** (or the ⚙️ next to "About" on the repo home page):**Description:**-> 158 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step.+> 159 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step.**Website:** `https://matinmonshizadeh.github.io/animation-handbook/`@@ -25,7 +25,7 @@ With the GitHub CLI (`gh`), this is one command:```bashgh repo edit matinmonshizadeh/animation-handbook \- --description "158 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step." \+ --description "159 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step." \--homepage "https://matinmonshizadeh.github.io/animation-handbook/" \--add-topic web-animation,css-animation,animation,frontend,web-development,javascript,motion-design,ui-animation,scroll-animation,microinteractions,webgl,ai-prompts,reference,no-dependencies,github-pages \--remove-topic awesome@@ -41,7 +41,7 @@ and share, which drives return visits.## 2. Verify SEO is live (after pushing)-- `https://matinmonshizadeh.github.io/animation-handbook/sitemap.xml` → should list 159 URLs+- `https://matinmonshizadeh.github.io/animation-handbook/sitemap.xml` → should list 160 URLs- `https://matinmonshizadeh.github.io/animation-handbook/robots.txt` → should load- Submit the sitemap to **Google Search Console** (add the property, then Sitemaps → submit `sitemap.xml`).- Test the social card at https://opengraph.xyz — paste the homepage URL, confirm the og-image shows.@@ -59,14 +59,14 @@ comments yourself in the first hours.### Show HN (news.ycombinator.com/submit)**Title:**-> Show HN: Animation Handbook – 158 web animations, each with a prompt for your AI+> Show HN: Animation Handbook – 159 web animations, each with a prompt for your AI**URL:** `https://matinmonshizadeh.github.io/animation-handbook/`**First comment (post immediately after submitting):**> I kept re-googling the same animation techniques and landing on either a> library's marketing page or a CodePen with no explanation. So I built a-> reference: 158 techniques, from scroll effects and page transitions to+> reference: 159 techniques, from scroll effects and page transitions to> micro-interactions, text, 3D, and ambient backgrounds. You find one by where it> goes on your page (buttons, text, backgrounds, page changes…) or by describing> it. Each one plays live, has a few plain settings, and gives you a ready-made@@ -78,10 +78,10 @@ comments yourself in the first hours.### Reddit — r/webdev (Showoff Saturday) and r/Frontend**Title:**-> I built a handbook of 158 web animations — watch each one live, tweak it, and copy a prompt for your AI assistant+> I built a handbook of 159 web animations — watch each one live, tweak it, and copy a prompt for your AI assistant**Body:**-> 158 techniques in 7 categories (scroll, entrance/exit, page transitions,+> 159 techniques in 7 categories (scroll, entrance/exit, page transitions,> micro-interactions, text, 3D, ambient). Find one by where it goes on your page or> by describing it, try a few plain settings, then copy a prompt that describes it in> plain words for ChatGPT, Claude or Cursor. Each technique is also one standalone@@ -93,7 +93,7 @@ comments yourself in the first hours.### dev.to / Hashnode article-**Title:** `158 web animations you can copy as a prompt for your AI assistant`+**Title:** `159 web animations you can copy as a prompt for your AI assistant`**Outline:**1. The problem — animation knowledge is scattered across libraries and CodePens, and an AI@@ -108,7 +108,7 @@ comments yourself in the first hours.### X / Bluesky thread-> 1/ I built Animation Handbook — 158 web animations you can watch live, tweak, and+> 1/ I built Animation Handbook — 159 web animations you can watch live, tweak, and> copy as a prompt for your AI assistant. No dependencies, no build step. 🧵 <docs/demo.gif>>> 2/ Find one by where it goes — buttons, text, backgrounds, page changes — or just@@ -126,7 +126,7 @@ awesome-web-animation) via PR.### Product Hunt-**Tagline:** `158 web animations, each with a prompt for your AI assistant`+**Tagline:** `159 web animations, each with a prompt for your AI assistant`Schedule for a Tuesday–Thursday 12:01am PT. Line up 5–10 people to comment/upvote early.---diff --git a/index.html b/index.htmlindex f247bf7a..9bc69bbf 100644--- a/index.html+++ b/index.html@@ -4,8 +4,8 @@<meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="google-site-verification" content="2PnJemecfPix7j08I3cojuzPTfwKpwxxFMADFxv4wk8">-<title>Animation Handbook — 158 Web Animation Techniques with Live Demos</title>-<meta name="description" content="A visual reference of 158 web animation techniques — scroll effects, page transitions, micro-interactions, text animation, 3D, and ambient backgrounds. Every entry is a live, dependency-free demo with an explanation of how it works.">+<title>Animation Handbook — 159 Web Animation Techniques with Live Demos</title>+<meta name="description" content="A visual reference of 159 web animation techniques — scroll effects, page transitions, micro-interactions, text animation, 3D, and ambient backgrounds. Every entry is a live, dependency-free demo with an explanation of how it works."><meta name="keywords" content="web animation, CSS animation, animation examples, scroll animation, page transitions, micro-interactions, kinetic typography, WebGL, frontend animation reference, motion design, animation handbook"><meta name="author" content="matinmonshizadeh"><meta name="robots" content="index, follow, max-image-preview:large">@@ -18,8 +18,8 @@<!-- Open Graph --><meta property="og:type" content="website"><meta property="og:site_name" content="Animation Handbook">-<meta property="og:title" content="Animation Handbook — 158 Web Animation Techniques with Live Demos">-<meta property="og:description" content="A visual reference of 158 web animation techniques. Every entry is a live, dependency-free demo with an explanation of how it works.">+<meta property="og:title" content="Animation Handbook — 159 Web Animation Techniques with Live Demos">+<meta property="og:description" content="A visual reference of 159 web animation techniques. Every entry is a live, dependency-free demo with an explanation of how it works."><meta property="og:url" content="https://matinmonshizadeh.github.io/animation-handbook/"><meta property="og:image" content="https://matinmonshizadeh.github.io/animation-handbook/og-image.png"><meta property="og:image:width" content="1200">@@ -27,8 +27,8 @@<!-- Twitter --><meta name="twitter:card" content="summary_large_image">-<meta name="twitter:title" content="Animation Handbook — 158 Web Animation Techniques">-<meta name="twitter:description" content="A visual reference of 158 web animation techniques. Every entry is a live, dependency-free demo you can open in the browser.">+<meta name="twitter:title" content="Animation Handbook — 159 Web Animation Techniques">+<meta name="twitter:description" content="A visual reference of 159 web animation techniques. Every entry is a live, dependency-free demo you can open in the browser."><meta name="twitter:image" content="https://matinmonshizadeh.github.io/animation-handbook/og-image.png"><!-- Structured data: parsed by search + AI answer engines -->@@ -38,7 +38,7 @@"@type": "WebSite","name": "Animation Handbook","url": "https://matinmonshizadeh.github.io/animation-handbook/",- "description": "A visual reference of 158 web animation techniques, each with a live, dependency-free demo and an explanation of how it works.",+ "description": "A visual reference of 159 web animation techniques, each with a live, dependency-free demo and an explanation of how it works.","inLanguage": "en","author": { "@type": "Person", "name": "matinmonshizadeh" },"about": ["web animation", "CSS animation", "motion design", "frontend development"],@@ -918,6 +918,15 @@ button,input{font:inherit;color:inherit}.pv-handwrite .rl{stroke:#9db0d6;stroke-width:.8}.pv-handwrite .w{fill:none;stroke:#2346b5;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 1;stroke-dashoffset:1;animation:t-hand 5s linear infinite}@keyframes t-hand{0%,6%{stroke-dashoffset:1;opacity:1}62%,86%{stroke-dashoffset:0;opacity:1}96%{stroke-dashoffset:0;opacity:0}100%{stroke-dashoffset:1;opacity:0}}+/* "HELLO" in 73 dots (5 × 7 per letter): a pointer and its reach sweep through, and each dot it passes jumps aside, swings a little past home and settles (the delays line each dot up with the pointer); mid-sweep at 36% (STILL) */+.pv-tparticles{background:radial-gradient(ellipse 58% 44% at 50% 58%,color-mix(in srgb,var(--accent) 15%,transparent),transparent 72%),#0c0608}+.pv-tparticles svg{position:absolute;inset:0;width:100%;height:100%}+.pv-tparticles .d{fill:url(#tpG);animation:tp-d 4.8s infinite}+.pv-tparticles .cur{animation:tp-c 4.8s infinite}+.pv-tparticles .rg{fill:none;stroke:rgba(255,255,255,.3);stroke-width:.6}+.pv-tparticles .pt{fill:#fff}+@keyframes tp-d{0%{transform:none;animation-timing-function:cubic-bezier(.2,.7,.3,1)}7%{transform:translate(var(--dx),var(--dy))}15%{transform:translate(calc(var(--dx) * -.2),calc(var(--dy) * -.2))}21%{transform:translate(calc(var(--dx) * .07),calc(var(--dy) * .07))}27%,100%{transform:none}}+@keyframes tp-c{0%{transform:translate(14px,58px);opacity:0}8%{transform:translate(14px,58px);opacity:1;animation-timing-function:linear}60%{transform:translate(146px,58px);opacity:1}68%,100%{transform:translate(146px,58px);opacity:0}}/* ── bespoke: 06 3D & Advanced ── *//* the cube's half side --h: 30px, smaller on a small card, and the cube a little low, so it turns clear of the place label (1cqh is 1% of the stage's height; closest at 601px, three cards across) */@@ -1329,7 +1338,7 @@ button,input{font:inherit;color:inherit}<section class="wrap home-hero" aria-labelledby="hero-title"><span class="float fl1" aria-hidden="true"></span><span class="float fl2" aria-hidden="true"></span><span class="float fl3" aria-hidden="true"></span><span class="float fl4" aria-hidden="true"></span><span class="float fl5" aria-hidden="true"></span><span class="float fl6" aria-hidden="true"></span>- <p class="pill"><span class="pill-dot" aria-hidden="true"></span>158 free animations · no coding needed</p>+ <p class="pill"><span class="pill-dot" aria-hidden="true"></span>159 free animations · no coding needed</p><h1 class="h1" id="hero-title">What do you want to animate?</h1><p class="sub">Pick a place, or describe it in your own words. Every animation plays live, and each one comes with a ready-made prompt for your AI assistant.</p><form class="search" id="search-form" role="search" action="./" method="get">@@ -1386,8 +1395,8 @@ button,input{font:inherit;color:inherit}<p class="empty-s">Try a simpler word, or pick one of these:</p><p class="pop"><button type="button" data-q="fade in">fade in</button><button type="button" data-q="typing text">typing text</button><button type="button" data-q="loading spinner">loading spinner</button><button type="button" data-q="parallax">parallax</button><button type="button" data-q="confetti">confetti</button></p></div>- <div class="more" id="more"><button type="button" class="bigbtn" id="more-btn"><span id="more-label">Browse all 158 animations</span><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M6 13l6 6 6-6"/></svg></button></div>- <noscript><p class="noscript">This page shows its animations with JavaScript. All 158 are still easy to reach: see the <a href="https://github.com/matinmonshizadeh/animation-handbook#categories">category list on GitHub</a> or the <a href="sitemap.xml">full sitemap</a>. Each demo is a page of its own under <code>/animations/<category>/<name>/</code>.</p></noscript>+ <div class="more" id="more"><button type="button" class="bigbtn" id="more-btn"><span id="more-label">Browse all 159 animations</span><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M6 13l6 6 6-6"/></svg></button></div>+ <noscript><p class="noscript">This page shows its animations with JavaScript. All 159 are still easy to reach: see the <a href="https://github.com/matinmonshizadeh/animation-handbook#categories">category list on GitHub</a> or the <a href="sitemap.xml">full sitemap</a>. Each demo is a page of its own under <code>/animations/<category>/<name>/</code>.</p></noscript></section><section class="how" id="how" aria-labelledby="how-title">@@ -1405,7 +1414,7 @@ button,input{font:inherit;color:inherit}<footer class="wrap foot"><a class="brand" href="./"><svg class="mark" viewBox="0 0 32 32" aria-hidden="true"><circle class="ring" cx="11.16" cy="20.84" r="6.1"/><circle class="ring" cx="15.12" cy="16.88" r="6.1"/><circle class="ring" cx="18.51" cy="13.49" r="6.1"/><circle class="ball" cx="21.2" cy="10.8" r="6.6"/></svg><span>Animation Handbook</span></a>- <p class="foot-t">158 web animations with live demos and copyable prompts.</p>+ <p class="foot-t">159 web animations with live demos and copyable prompts.</p><nav class="nav" aria-label="Footer"><a class="lnk" href="https://github.com/matinmonshizadeh/animation-handbook" target="_blank" rel="noopener noreferrer">GitHub</a><a class="lnk" href="#top">Back to top</a></nav></footer><div class="toast" id="toast" role="status" aria-live="polite"><span class="ok" aria-hidden="true"><svg class="i" viewBox="0 0 24 24"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg></span><span class="toast-t"></span></div>@@ -1566,6 +1575,7 @@ const CATS=[['split-flap-board','Split-Flap Board','Tiles flip through the letters to spell a word, like an airport board. Best for hero titles.'],['neon-flicker','Neon Flicker','Glowing letters sputter now and then, like a worn neon sign. Best for night themes.'],['handwriting-draw','Handwriting Draw','A word writes itself stroke by stroke, as if by a pen. Best for greetings and signatures.'],+ ['text-particles','Text Particles','A word of dots scatters from your pointer and springs back. Best for intros.'],]},{@@ -1675,7 +1685,7 @@ const PV={'grid-dot-pattern-parallax':'dotgrid','abstract-geometric-motion':'geo','magnetic-button':'magnet','heart-burst':'heart','success-confetti':'confetti','error-shake':'shake','swipe-to-dismiss':'swipe','glitch-text':'glitch','text-on-path':'onpath','wavy-text':'wavy','highlighter-sweep':'hilite','split-flap-board':'splitflap',- 'neon-flicker':'neon','handwriting-draw':'handwrite',+ 'neon-flicker':'neon','handwriting-draw':'handwrite','text-particles':'tparticles','particle-constellation':'particles','flow-field':'flow','synthwave-grid':'synth'};@@ -1798,6 +1808,7 @@ const PLACES={'split-flap-board':['text','intro'],'neon-flicker':['text','bg'],'handwriting-draw':['text','intro'],+ 'text-particles':['text','intro'],// 06'3d-model-orbit':['imgcard'],'scroll-driven-3d-rotation':['scroll','imgcard'],@@ -1871,6 +1882,11 @@ function pvMarkup(k){case 'xsearch': return '<span class="tb"><i class="br"></i><span class="ln anim"><i></i><i></i><i></i></span><span class="fd anim"><i class="tx anim"></i></span><svg class="ic" viewBox="0 0 24 24"><circle cx="11" cy="11" r="6"/><path d="m19.5 19.5-4-4"/></svg></span><span class="pg"><i></i><i></i></span>';case 'btnload': return '<span class="bw"><span class="pl anim">SUBMIT</span><span class="cc anim"></span><span class="gc anim"></span><span class="sp anim"></span><svg class="tk anim" viewBox="0 0 24 24"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg></span>';case 'sig5': return '<span class="s5 anim"></span><span class="s5 anim"></span><span class="s5 anim"></span>';+ case 'tparticles': {const F={H:'10001100011000111111100011000110001',E:'11111100001000011110100001000011111',L:'10000100001000010000100001000011111',O:'01110100011000110001100011000101110'};let d='';+ // each dot is pushed away from the pointer's line (dots on it alternate up and down), less the further it sits, starting .2 s before the pointer reaches its column+ [...'HELLO'].forEach((ch,k)=>[...F[ch]].forEach((b,i)=>{if(b!=='1')return;const c=k*6+i%5,r=(i/5|0)-3,f=1-Math.abs(r)/4,x=24+c*4,s=r?Math.sign(r):c%2?1:-1;+ d+='<circle class="d anim" cx="'+x+'" cy="'+(58+r*4)+'" r="1.5" style="--dx:'+(1.8*f).toFixed(2)+'px;--dy:'+(10*f*s).toFixed(2)+'px;animation-delay:'+(4.8*(.08+(x-14)/132*.52)-5).toFixed(2)+'s"/>';}));+ return '<svg viewBox="0 0 160 100"><defs><linearGradient id="tpG" gradientUnits="userSpaceOnUse" x1="24" x2="136"><stop offset="0" stop-color="#ff6f8b"/><stop offset=".5" stop-color="#ff9d5c"/><stop offset="1" stop-color="#ffce5a"/></linearGradient></defs>'+d+'<g class="cur anim"><circle class="rg" r="12"/><circle class="pt" r="2.2"/></g></svg>';}case 'hilite': return '<span class="ppr"><span class="ln"><b style="width:24%"></b><b class="k anim" style="width:40%"></b><b style="width:22%"></b></span>'+'<span class="ln"><b style="width:20%"></b><b style="width:28%"></b><b class="k k2 anim" style="width:38%"></b></span>'+'<span class="ln"><b class="k k3 anim" style="width:44%"></b><b style="width:30%"></b></span></span>';@@ -2178,7 +2194,7 @@ let shown=[];// under the place label or between two states). Nothing here runs without reduced motion.const STILL={cover:.1,curtain:.6,kinetic:.25,carousel:.1,typewriter:.55,textclip:.7,svgpath:.7,smoke:.3,leak:.7,- flash:.41,blurpage:.2,toggle:.7,shake:.8,hideheader:.72,hilite:.7,splitflap:.7,handwrite:.75,circlerev:.25,owipe:.165,pcurl:.44,cubepage:.3,reorder:.4,ascii:.2,phys2d:.6+ flash:.41,blurpage:.2,toggle:.7,shake:.8,hideheader:.72,hilite:.7,splitflap:.7,handwrite:.75,tparticles:.36,circlerev:.25,owipe:.165,pcurl:.44,cubepage:.3,reorder:.4,ascii:.2,phys2d:.6};function hold(card){const anims=card.querySelector('.pv').getAnimations({subtree:true});diff --git a/sitemap.xml b/sitemap.xmlindex 38230db2..6cef6d12 100644--- a/sitemap.xml+++ b/sitemap.xml@@ -113,6 +113,7 @@<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/split-flap-board/</loc><lastmod>2026-10-01</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url><url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/neon-flicker/</loc><lastmod>2026-10-01</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url><url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/handwriting-draw/</loc><lastmod>2026-10-01</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>+ <url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/text-particles/</loc><lastmod>2026-10-01</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url><url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/3d-model-orbit/</loc><lastmod>2026-07-14</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url><url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/scroll-driven-3d-rotation/</loc><lastmod>2026-07-14</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url><url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/parallax-3d-tilt/</loc><lastmod>2026-07-14</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>