Skip to content

176 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step.

feat: Dynamic Island (04.41)

matinb913176d1f76
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index b8d170bd..d154d8bf 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -2,4 +2,4 @@ blank_issues_enabled: true
contact_links:
- name: Browse the live handbook
url: https://matinmonshizadeh.github.io/animation-handbook/
- about: See all 158 techniques running before filing an issue.
+ about: See all 159 techniques running before filing an issue.
diff --git a/README.md b/README.md
index 7cfae9a2..9b40af14 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,14 @@
<div align="center">
-<a href="https://matinmonshizadeh.github.io/animation-handbook/"><img src="og-image.png" alt="Animation Handbook — 158 web animation techniques with live demos" width="820"></a>
+<a href="https://matinmonshizadeh.github.io/animation-handbook/"><img src="og-image.png" alt="Animation Handbook — 159 web animation techniques with live demos" width="820"></a>
# Animation Handbook
-**A visual reference of 158 web animation techniques — every entry is a live, dependency-free demo you can open in the browser and read how it works.**
+**A visual reference of 159 web animation techniques — every entry is a live, dependency-free demo you can open in the browser and read how it works.**
[**Open the live handbook →**](https://matinmonshizadeh.github.io/animation-handbook/)
-[![Live site](https://img.shields.io/website?url=https%3A%2F%2Fmatinmonshizadeh.github.io%2Fanimation-handbook%2F&label=live%20demo&up_message=online&color=6ea8ff)](https://matinmonshizadeh.github.io/animation-handbook/) [![Stars](https://img.shields.io/github/stars/matinmonshizadeh/animation-handbook?style=flat&color=5fd88a)](https://github.com/matinmonshizadeh/animation-handbook/stargazers) [![License](https://img.shields.io/github/license/matinmonshizadeh/animation-handbook?color=b98cff)](LICENSE) ![Techniques](https://img.shields.io/badge/techniques-158-ff9d5c) ![Dependencies](https://img.shields.io/badge/dependencies-0-ff6f8b) ![Build](https://img.shields.io/badge/build-none-3fd6c4)
+[![Live site](https://img.shields.io/website?url=https%3A%2F%2Fmatinmonshizadeh.github.io%2Fanimation-handbook%2F&label=live%20demo&up_message=online&color=6ea8ff)](https://matinmonshizadeh.github.io/animation-handbook/) [![Stars](https://img.shields.io/github/stars/matinmonshizadeh/animation-handbook?style=flat&color=5fd88a)](https://github.com/matinmonshizadeh/animation-handbook/stargazers) [![License](https://img.shields.io/github/license/matinmonshizadeh/animation-handbook?color=b98cff)](LICENSE) ![Techniques](https://img.shields.io/badge/techniques-159-ff9d5c) ![Dependencies](https://img.shields.io/badge/dependencies-0-ff6f8b) ![Build](https://img.shields.io/badge/build-none-3fd6c4)
</div>
@@ -37,14 +37,14 @@ Everything is plain HTML, CSS, and JavaScript: no build step, no frameworks, no
| 01 | [Scroll-Based](#01) | 27 | Animations driven by scroll position — parallax, sticky, scrub, snap, and narrative storytelling. |
| 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. |
+| 04 | [Micro-Interactions](#04) | 39 | Short, user-triggered animations — hover, click, focus, loading states, and UI feedback patterns. |
| 05 | [Text & Typography](#05) | 18 | Animations specifically for type — kinetic motion, character-level effects, gradient flows, and word transformations. |
| 06 | [3D & Advanced](#06) | 23 | WebGL, shaders, particles, 3D transforms, and the performance-sensitive effects that push the browser's limits. |
| 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>
@@ -137,7 +137,7 @@ All 158 techniques, each linked to its live demo.
<a id="04"></a>
-### 04 · Micro-Interactions · 38 techniques
+### 04 · Micro-Interactions · 39 techniques
<sub>Short, user-triggered animations — hover, click, focus, loading states, and UI feedback patterns.</sub>
@@ -181,6 +181,7 @@ All 158 techniques, each linked to its live demo.
- **[Hold to Confirm](animations/04-micro-interactions/hold-to-confirm/)** — A button fills up while you hold it and acts only once it is full. Best for delete buttons.
- **[Expanding Search](animations/04-micro-interactions/expanding-search/)** — A search icon opens into a field, then closes when done. Best for toolbars.
- **[Button Loading States](animations/04-micro-interactions/button-loading-states/)** — The button becomes a spinner, then a tick or a cross. Best for Save buttons.
+- **[Dynamic Island](animations/04-micro-interactions/dynamic-island/)** — A black pill grows into a notification, then shrinks back. Best for live updates.
</details>
diff --git a/animations/04-micro-interactions/README.md b/animations/04-micro-interactions/README.md
index 6ece8893..7f5bd67e 100644
--- a/animations/04-micro-interactions/README.md
+++ b/animations/04-micro-interactions/README.md
@@ -44,6 +44,7 @@ Short, user-triggered animations that provide feedback, confirm actions, and com
| [Hold to Confirm](hold-to-confirm/) | A button fills up while you hold it and acts only once it is full. Best for delete buttons. |
| [Expanding Search](expanding-search/) | A search icon opens into a field, then closes when done. Best for toolbars. |
| [Button Loading States](button-loading-states/) | The button becomes a spinner, then a tick or a cross. Best for Save buttons. |
+| [Dynamic Island](dynamic-island/) | A black pill grows into a notification, then shrinks back. Best for live updates. |
## Key concepts
diff --git a/animations/04-micro-interactions/dynamic-island/README.md b/animations/04-micro-interactions/dynamic-island/README.md
new file mode 100644
index 00000000..a3b2167f
--- /dev/null
+++ b/animations/04-micro-interactions/dynamic-island/README.md
@@ -0,0 +1,85 @@
+# Dynamic Island
+
+## What it is
+A Dynamic Island is a small black pill at the top of a phone screen that grows into a larger card to show something live, such as a call, a timer or the song that is playing, and shrinks back into the pill when it is done. The pill and the card are one black shape whose outline changes, so the change reads as one object stretching rather than a new window opening. The name comes from the iPhone, but the same idea suits any status area at the top of an app or page.
+
+## When to use it
+- Incoming calls and video calls in a web or mobile app
+- Timers, workouts and countdowns that keep running while the visitor does something else
+- Music and podcast players, with the track and its controls
+- Order, delivery and ride updates that change over a few minutes
+- Live scores and other short updates worth a glance
+
+## How it works
+The island is a box the size of its largest card, with a little room left around it for the bounce. Everything inside is laid out once at full size; what the visitor sees is a black layer cut out with `clip-path: inset()`. Three custom properties describe the visible shape: half its width (`--hw`), its height (`--h`) and its corner radius (`--r`). Changing them is the whole animation: the browser eases the clip from one shape to the other, so the pill grows into a card, or one card changes straight into another, without ever animating `width` or `height`.
+
+```html
+<button class="isl" type="button" aria-label="Phone notification" aria-expanded="false" data-n="call">
+ <span class="shape"></span> <!-- the black layer, clipped -->
+ <span class="c c-call" aria-hidden="true">…</span> <!-- each card's content, at full size -->
+</button>
+```
+
+```css
+.isl { --hw: 48px; --h: 32px; --r: 16px; position: absolute; top: 11px; left: 6px; right: 6px; height: 172px; }
+.shape { position: absolute; inset: 0; background: #000;
+ clip-path: inset(0 calc(50% - var(--hw)) calc(100% - var(--h)) round var(--r));
+ transition: clip-path 700ms var(--ease); }
+/* The content fades in once the shape has room and scales evenly, so its text never stretches */
+.c { opacity: 0; transform: scale(.88); transition: opacity 175ms ease, transform 700ms var(--ease); }
+.open[data-n="call"] .c-call { opacity: 1; transform: none; transition-duration: 315ms, 700ms; transition-delay: 140ms; }
+```
+
+```js
+// Each shape as [half its width, its height, its corner radius]; a % is of the island's box
+const SIZE = { rest: ['48px', '32px', '16px'], call: ['44%', '76px', '30px'],
+ timer: ['40%', '64px', '32px'], music: ['44%', '148px', '34px'] };
+// The open card's size, else the resting pill's (under reduced motion the card keeps its size while it fades out)
+function shape() {
+ const g = SIZE[open || reduceMq.matches ? note : 'rest'];
+ ['--hw', '--h', '--r'].forEach((v, i) => isl.style.setProperty(v, g[i]));
+}
+function setOpen(next) {
+ open = next;
+ isl.classList.toggle('open', open);
+ isl.setAttribute('aria-expanded', String(open));
+ shape();
+}
+
+// Bounce: a damped spring (damping z: .68 for Soft, .5 for Springy) sampled into a CSS linear() curve
+function spring(z) {
+ const w = 4.6 / z, d = w * Math.sqrt(1 - z * z), p = [];
+ for (let i = 0; i < 40; i++) {
+ const t = i / 40;
+ p.push((1 - Math.exp(-z * w * t) * (Math.cos(d * t) + z * w / d * Math.sin(d * t))).toFixed(3));
+ }
+ return 'linear(' + p.join(',') + ',1)'; // set as --ease on the island
+}
+```
+
+The same transition runs whichever two shapes it goes between, so picking another notification while one is open morphs the card directly. The clip also decides where the button can be pressed, so the small pill gets a larger invisible target (124 × 48px), and the focus ring is a second clipped layer 3px larger than the shape, behind it, because an outline would be clipped away. While a card is open the status bar fades out, and a polite live region reads out the message when the visitor opened it, not when Show me did. On larger screens the content also comes into focus from a slight blur; phones skip the blur. Under reduced motion a resting pill stays in place and the card fades in over it at its own size, so nothing grows or moves.
+
+## Key parameters
+| Parameter | Default | Effect |
+|-----------|---------|--------|
+| Notification | Call | What the pill grows into: a call card, a timer in a wide capsule, or a taller music card with controls; picking another while it is open changes the shape straight into the new one |
+| Speed | Normal | How long it takes to grow or shrink: slow is 1100ms, normal 700ms and fast 450ms; a spring needs a little longer than a plain ease, because it settles at the end |
+| Bounce | Soft | None eases out without going past the size; Soft goes about 5% past it and Springy about 16%, and then each settles |
+
+## Production notes
+- **Never animate `width` or `height`**: every frame would lay out the card and its text again, and the words would wrap and jump while it grows. A clip, or a scale on a layer whose children are scaled back, changes only what is painted.
+- **A clip is repainted**: a `clip-path` animation repaints the island on every frame. That is cheap for a shape this size; for a large panel, animate `transform: scale()` on the layer and scale its content the other way (the FLIP technique), which stays on the compositor.
+- **Leave room for the bounce**: a spring goes past the target size, and a clip cannot show more than its box. Make the box larger than the largest card by the overshoot, or the corners turn square for a moment at the peak.
+- **`linear()` support**: the spring curve needs `linear()` (Chrome and Edge 113, Firefox 112, Safari 17.2). Check with `CSS.supports()` and fall back to a `cubic-bezier()` that overshoots, such as `cubic-bezier(.3, 1.5, .45, 1)`.
+- **Hit area and focus**: the clip also clips pointer hits and the outline. Give the small pill a target of at least 44 × 44px, and draw the focus ring as a clipped layer of its own.
+- **Accessibility**: make the pill a real `<button>` with `aria-expanded`, announce a new message in a polite `role="status"` region, never move the focus into the card, and let Escape close it.
+- **Framer Motion**: `<motion.div layout style={{ borderRadius: 30 }} />` animates a size change with transforms and corrects the corner radius and the children's scale for you.
+- **GSAP**: the Flip plugin records the pill's box and animates to the card's; `gsap.to(shape, { clipPath: "inset(0% 6% 14% 6% round 30px)", ease: "elastic.out(1, 0.6)" })` animates the clip itself with a bounce.
+- **Native apps**: on iOS the real Dynamic Island shows Live Activities through ActivityKit; on the web it is a pattern you draw yourself.
+
+## See also
+- [Toast Notification](../toast-notification/) — short messages that come into a corner and leave on their own
+- [Expanding Search](../expanding-search/) — an icon that opens into a field with a clip
+- [Button Loading States](../button-loading-states/) — a button clipped into a circle while it works
+- [Modal Expand](../modal-expand/) — a window that grows out of the button you pressed
+- [Morph Transition](../../03-page-transitions/morph-transition/) — a logo that changes shape to match each page
diff --git a/animations/04-micro-interactions/dynamic-island/index.html b/animations/04-micro-interactions/dynamic-island/index.html
new file mode 100644
index 00000000..1c55f300
--- /dev/null
+++ b/animations/04-micro-interactions/dynamic-island/index.html
@@ -0,0 +1,298 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Dynamic Island — Animation Handbook</title>
+ <meta name="description" content="A black pill grows into a notification, then shrinks back. Best for live updates.">
+ <link rel="canonical" href="https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/dynamic-island/">
+ <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="Dynamic Island — Animation Handbook">
+ <meta property="og:description" content="A black pill grows into a notification, then shrinks back. Best for live updates.">
+ <meta property="og:url" content="https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/dynamic-island/">
+ <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="Dynamic Island — Animation Handbook">
+ <meta name="twitter:description" content="A black pill grows into a notification, then shrinks back. Best for live updates.">
+ <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": "Dynamic Island", "name": "Dynamic Island", "description": "A black pill grows into a notification, then shrinks back. Best for live updates.", "url": "https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/dynamic-island/", "inLanguage": "en", "articleSection": "Micro-Interactions", "isPartOf": {"@type": "WebSite", "name": "Animation Handbook", "url": "https://matinmonshizadeh.github.io/animation-handbook/"}, "author": {"@type": "Person", "name": "matinmonshizadeh"}, "keywords": "web animation, CSS animation, Micro-Interactions, Dynamic Island"}</script>
+ <style>
+ :root{--ui-accent:#ff9d5c;--muted:#a1a1aa;--orange:#ff9f0a}
+ *,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
+ /* The top of a phone, its bottom running off the stage */
+ .stage{display:flex;justify-content:center;padding:18px clamp(8px,3vw,16px) 0;background:radial-gradient(46% 70% at 50% 40%,rgba(124,92,255,.2),transparent),#0b0b0d}
+ .phone{flex:none;width:min(420px,100%);height:calc(100% + 40px);border:7px solid #1c1c21;border-bottom:0;border-radius:54px 54px 0 0;box-shadow:0 0 0 1.5px #3a3a43}
+ .screen{position:relative;height:100%;overflow:hidden;border-radius:47px 47px 0 0;container-type:inline-size;color:#fff;
+ background:radial-gradient(70% 45% at 92% 92%,rgba(255,122,89,.5),transparent 70%),radial-gradient(80% 50% at 0 78%,rgba(124,92,255,.55),transparent 70%),linear-gradient(#2b3a5c,#1d1a3c 62%,#2b1a3c)}
+ /* The status bar steps aside while a card is open, as it does behind a real island */
+ .sb{position:absolute;inset:0 0 auto;height:54px;display:flex;align-items:center;justify-content:space-between;padding:0 min(24px,7cqw) 0 min(32px,10cqw);font-size:15px;font-weight:600;transition:opacity .2s}
+ .isl.open~.sb{opacity:0}.sb svg{width:58px;height:11px;fill:#fff}
+ .date,.clock{position:absolute;left:0;right:0;text-align:center}.date{top:188px;font-size:15px;font-weight:600;color:rgba(255,255,255,.88)}
+ .clock{top:206px;font-size:clamp(50px,19cqw,80px);font-weight:700;line-height:1;letter-spacing:-.02em}
+ /* The island: a box the size of the largest card plus room for a bounce. Only its clipped black shape shows; the script sets
+ --hw, --h and --r (half its width, its height and its corner radius) for the pill and for each card */
+ .isl{--hw:48px;--h:32px;--r:16px;--dur:700ms;--ease:cubic-bezier(.3,1.2,.5,1);position:absolute;z-index:1;top:11px;left:6px;right:6px;height:172px;container-type:inline-size;border:0;background:none;color:#fff;font:inherit;text-align:left;
+ cursor:pointer;pointer-events:none;-webkit-tap-highlight-color:transparent;transform-origin:50% calc(var(--h) / 2);transition:transform .25s cubic-bezier(.22,1,.36,1)}
+ .shape,.ring,.pill{position:absolute;inset:0;transition:clip-path var(--dur) var(--ease)}
+ .shape{background:#000;pointer-events:auto;clip-path:inset(0 calc(50% - var(--hw)) calc(100% - var(--h)) round var(--r))}
+ .isl:not(.open) .shape{pointer-events:none}
+ /* The pill is short, so a larger invisible target covers it at rest */
+ .hit{position:absolute;left:50%;top:-8px;width:124px;height:48px;margin-left:-62px;pointer-events:auto}
+ /* Focus: an outline would be clipped away, so a ring layer 3px larger than the shape sits behind it (its shadow paints above the box) */
+ .ring{opacity:0;background:var(--ui-accent);box-shadow:0 0 0 3px var(--ui-accent);clip-path:inset(-3px calc(50% - var(--hw) - 3px) calc(100% - var(--h) - 3px) round calc(var(--r) + 3px))}
+ .isl:focus-visible .ring{opacity:1}
+ .hb-page .stage .isl:focus-visible{outline:none}
+ .pill{display:none;inset:0 auto auto 50%;width:96px;height:32px;margin-left:-48px;border-radius:16px;background:#000}
+ /* A pointer over the pill swells it a little, and a press squeezes the island, as a finger does on a phone */
+ @media(hover:hover) and (prefers-reduced-motion:no-preference){.isl:not(.open):hover{transform:scale(1.06)}}
+ @media(prefers-reduced-motion:no-preference){.stage .isl:active,.isl.down{transform:scale(.95)}}
+ /* Each card's content is laid out once at its full size; it fades and grows in only once the shape has room for it. Sizes in cqw
+ follow the island's width, so a narrow phone gets smaller pieces, never squeezed ones. */
+ .c{position:absolute;top:0;left:6%;right:6%;display:flex;align-items:center;gap:min(10px,3cqw);padding:0 min(14px,4.5cqw);opacity:0;transform:scale(.88);transform-origin:50% 16px;
+ transition:opacity calc(var(--dur) * .25) ease,transform var(--dur) var(--ease),filter calc(var(--dur) * .25) ease}
+ .open[data-n=call] .c-call,.open[data-n=timer] .c-timer,.open[data-n=music] .c-music{opacity:1;transform:none;filter:none;
+ transition-duration:calc(var(--dur) * .45),var(--dur),calc(var(--dur) * .45);transition-delay:calc(var(--dur) * .2)}
+ .c-call{height:76px}.c-timer{left:10%;right:10%;height:64px;padding:0 min(12px,4cqw)}
+ .c-music{height:148px;flex-direction:column;align-items:stretch;justify-content:center;gap:12px;padding:0 min(18px,5.5cqw)}
+ .tx{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;white-space:nowrap}
+ .tx small{font-size:min(12px,4.6cqw);color:var(--muted)}
+ .tx b{font-size:clamp(13px,5.6cqw,16px);font-weight:600;overflow:hidden;text-overflow:ellipsis}
+ .av{position:relative;flex:none;display:grid;place-items:center;width:min(42px,14cqw);aspect-ratio:1;border-radius:50%;background:linear-gradient(135deg,#c2410c,#9d174d);font-size:min(15px,5cqw);font-weight:700}
+ .av i{position:absolute;inset:-4px;border:2px solid #ff8a65;border-radius:50%;opacity:0}
+ .open[data-n=call] .av i{animation:ringing 1.6s ease-out infinite}
+ @keyframes ringing{0%{transform:scale(.92);opacity:.9}100%{transform:scale(1.4);opacity:0}}
+ .rb{flex:none;display:grid;place-items:center;width:min(36px,12.5cqw);aspect-ratio:1;border-radius:50%}
+ .rb svg{width:50%;height:50%;fill:none;stroke:#fff;stroke-width:2.4;stroke-linecap:round}
+ .no{background:#ff453a}.no svg{transform:rotate(135deg)}.yes{background:#30d158}.no svg,.yes svg{fill:#fff;stroke:none}
+ .pz{background:rgba(255,159,10,.24)}.pz svg{stroke:var(--orange)}.x{background:#3a3a3c}
+ .c-timer .tx{align-items:flex-end;color:var(--orange)}.c-timer .tx small{color:inherit}
+ /* The countdown's digits sit in cells of one width, so the time does not shift as they change */
+ .c-timer .tx b{font-size:min(30px,10cqw);line-height:1}.c-timer .tx b i{display:inline-block;width:.62em;text-align:center;font-style:normal}
+ .mrow{display:flex;align-items:center;gap:min(12px,3.5cqw)}
+ .art{flex:none;width:min(48px,16cqw);aspect-ratio:1;border-radius:12px;background:radial-gradient(circle at 32% 30%,#ffd36e 0 16%,transparent 17%),linear-gradient(140deg,#ff7a59,#c2185b 55%,#5b2a86)}
+ .wave{flex:none;display:flex;align-items:center;gap:3px;height:22px}
+ .wave i{width:3px;height:100%;border-radius:2px;background:#ff8a65;transform:scaleY(.35)}
+ .open[data-n=music] .wave i{animation:wave .8s ease-in-out var(--d,0s) infinite alternate}
+ .wave i:nth-child(2){--d:-.5s}.wave i:nth-child(3){--d:-.2s}.wave i:nth-child(4){--d:-.65s}
+ @keyframes wave{to{transform:scaleY(1)}}
+ .prog{display:flex;align-items:center;gap:8px;font-size:11px;color:var(--muted)}
+ .prog i{flex:1;height:4px;border-radius:2px;background:linear-gradient(90deg,#fff 34%,#3a3a3c 34%)}
+ .mctl{display:flex;justify-content:center;gap:30px}.mctl svg{width:24px;height:24px;fill:#fff}
+ .still,.still *{transition:none!important}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
+ /* Larger screens: the content comes into focus as it fades in (a phone skips the blur) */
+ @media(min-width:601px) and (min-height:501px){.c{filter:blur(6px)}}
+ /* Reduced motion: a resting pill shows, and the card fades in over it and out again at its own size; nothing grows or moves */
+ @media(prefers-reduced-motion:reduce){
+ .isl,.shape,.ring,.c{transition:opacity .3s ease!important}
+ .pill{display:block}.shape{opacity:0}.open .shape{opacity:1}.c{transform:none;filter:none}
+ .isl:not(.open):focus-visible .ring{opacity:0}.isl:not(.open):focus-visible .pill{box-shadow:0 0 0 3px var(--ui-accent)}
+ .open[data-n] .av i,.open[data-n] .wave i{animation:none}
+ }
+ </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="../button-loading-states/" rel="prev" aria-label="Previous: Button Loading States"><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>Button Loading States</span></a></span>
+</nav>
+<main class="hb-page">
+ <header class="hb-head">
+ <p class="hb-cat">04.41 · Micro-Interactions</p>
+ <h1>Dynamic Island</h1>
+ <p class="hb-lede">A black pill grows into a notification, then shrinks back. Best for live updates.</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">Click it</h2><p>Click or tap the black pill to open it and again to close it, or press Show me.</p></div>
+ </div>
+ <div class="stage">
+ <div class="phone">
+ <div class="screen">
+ <p class="date" aria-hidden="true">Thursday, October 1</p>
+ <p class="clock" aria-hidden="true">9:41</p>
+ <button class="isl" id="isl" type="button" aria-label="Phone notification" aria-expanded="false" data-n="call">
+ <span class="ring"></span><span class="pill"></span><span class="shape"></span><span class="hit"></span>
+ <span class="c c-call" aria-hidden="true"><span class="av">MC<i></i></span><span class="tx"><small>Incoming call</small><b>Maya Chen</b></span>
+ <span class="rb no"><svg viewBox="0 0 24 24"><path d="M20 15.5c-1.25 0-2.45-.2-3.57-.57a1 1 0 0 0-1.02.24l-2.2 2.2a15 15 0 0 1-6.59-6.59l2.2-2.21a1 1 0 0 0 .25-1A11.4 11.4 0 0 1 8.5 4a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1c0 9.39 7.61 17 17 17a1 1 0 0 0 1-1v-3.5a1 1 0 0 0-1-1z"/></svg></span><span class="rb yes"><svg viewBox="0 0 24 24"><path d="M20 15.5c-1.25 0-2.45-.2-3.57-.57a1 1 0 0 0-1.02.24l-2.2 2.2a15 15 0 0 1-6.59-6.59l2.2-2.21a1 1 0 0 0 .25-1A11.4 11.4 0 0 1 8.5 4a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1c0 9.39 7.61 17 17 17a1 1 0 0 0 1-1v-3.5a1 1 0 0 0-1-1z"/></svg></span></span>
+ <span class="c c-timer" aria-hidden="true"><span class="rb pz"><svg viewBox="0 0 24 24"><path d="M9 7v10M15 7v10"/></svg></span><span class="rb x"><svg viewBox="0 0 24 24"><path d="m7.5 7.5 9 9m0-9-9 9"/></svg></span>
+ <span class="tx"><small>Timer</small><b id="tm"><i>5</i>:<i>0</i><i>0</i></b></span></span>
+ <span class="c c-music" aria-hidden="true"><span class="mrow"><span class="art"></span><span class="tx"><b>Golden Hour</b><small>Nova Lane</small></span><span class="wave"><i></i><i></i><i></i><i></i></span></span>
+ <span class="prog">1:12<i></i>-2:31</span>
+ <span class="mctl"><svg viewBox="0 0 24 24"><path d="M6 6h2v12H6zm3.5 6 8.5 6V6z"/></svg><svg viewBox="0 0 24 24"><path d="M6 5h4v14H6zm8 0h4v14h-4z"/></svg><svg viewBox="0 0 24 24"><path d="m6 18 8.5-6L6 6zM16 6v12h2V6z"/></svg></span></span>
+ </button>
+ <div class="sb" aria-hidden="true"><span>9:41</span><svg viewBox="0 0 58 11"><rect y="7" width="3" height="4" rx="1"/><rect x="4.5" y="5" width="3" height="6" rx="1"/><rect x="9" y="2.5" width="3" height="8.5" rx="1"/><rect x="13.5" width="3" height="11" rx="1"/><path d="M27 11l-2-2.2a3 3 0 0 1 4 0zm-3.4-3.6-1.4-1.5a6.6 6.6 0 0 1 9.6 0l-1.4 1.5a4.6 4.6 0 0 0-6.8 0zm-2.8-2.9L19.4 3a10.6 10.6 0 0 1 15.2 0l-1.4 1.5a8.6 8.6 0 0 0-12.4 0z"/><rect x="37.5" y=".5" width="18" height="10" rx="3" fill="none" stroke="#fff" stroke-opacity=".5"/><rect x="39.5" y="2.5" width="11" height="6" rx="1.5"/></svg></div>
+ </div>
+ </div>
+ <p class="sr-only" id="say" role="status" aria-live="polite"></p>
+ </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>
+ <button class="hb-play" type="button" id="btn-reset" data-hb-reset><svg class="hb-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/></svg>Reset</button>
+ <label class="hb-toggle"><input class="hb-switch" type="checkbox" role="switch" id="slow-tog" data-hb-slowmo="css" autocomplete="off"><span>Slow motion</span></label>
+ </div>
+ </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="note-lbl">Notification</p>
+ <div class="seg" id="note-seg" role="group" aria-labelledby="note-lbl">
+ <button type="button" data-n="call" class="on" aria-pressed="true">Call</button>
+ <button type="button" data-n="timer" aria-pressed="false">Timer</button>
+ <button type="button" data-n="music" aria-pressed="false">Music</button>
+ </div>
+ <p class="hb-hint">What the pill grows into; pick another while it is open to see it change shape.</p>
+ </div>
+ <div class="hb-setting">
+ <p class="hb-setting-name" id="speed-lbl">Speed</p>
+ <div class="seg" id="speed-seg" role="group" aria-labelledby="speed-lbl">
+ <button type="button" data-ms="1100" aria-pressed="false">Slow</button>
+ <button type="button" data-ms="700" class="on" aria-pressed="true">Normal</button>
+ <button type="button" data-ms="450" aria-pressed="false">Fast</button>
+ </div>
+ <p class="hb-hint">How quickly it grows and shrinks.</p>
+ </div>
+ <div class="hb-setting">
+ <p class="hb-setting-name" id="bounce-lbl">Bounce</p>
+ <div class="seg" id="bounce-seg" role="group" aria-labelledby="bounce-lbl">
+ <button type="button" data-b="none" aria-pressed="false">None</button>
+ <button type="button" data-b="soft" class="on" aria-pressed="true">Soft</button>
+ <button type="button" data-b="springy" aria-pressed="false">Springy</button>
+ </div>
+ <p class="hb-hint">How far it grows past its size before it settles.</p>
+ </div>
+ </div>
+ </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 Dynamic Island style notification to [the top of your app or page]. At rest it is a small black pill; when [an event such as an incoming message] happens or the pill is pressed, it grows into a rounded card with the details, then shrinks back. Change the black shape with a clip or a scale, never by animating its width or height, so the text inside never stretches and nothing around it moves, and fade the details in only once the shape has room for them. Make the pill a real button for taps, clicks and the keyboard, and announce its message politely to screen readers. If the visitor has reduced motion turned on, crossfade the pill and the card instead. 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>Calls and timers</li><li>Music players</li><li>Order tracking</li><li>Live scores</li></ul>
+ <h3>Avoid on</h3>
+ <ul class="hb-tags hb-avoid"><li>Long messages</li><li>Errors that need action</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 $=id=>document.getElementById(id);
+ const stage=document.querySelector('.stage'),isl=$('isl'),say=$('say'),tm=$('tm'),slowTog=$('slow-tog');
+ const reduceMq=matchMedia('(prefers-reduced-motion:reduce)');
+ // Each shape as [half its width, its height, its corner radius]. A % is of the island's box, which leaves 6% on each side
+ // of the widest card and room below the tallest, so a bounce past the card's size is never cut off by the box.
+ const SIZE={rest:['48px','32px','16px'],call:['44%','76px','30px'],timer:['40%','64px','32px'],music:['44%','148px','34px']};
+ const SAY={call:'Incoming call from Maya Chen.',timer:'Timer: 5 minutes left.',music:'Now playing: Golden Hour by Nova Lane.'};
+ let note='call',open=false,dur=700,runTimers=[],tick=0;
+
+ // Bounce: a damped spring (damping z, 1 = no overshoot) sampled into a CSS linear() curve that settles by its end. Soft overshoots
+ // the size by about 5%, Springy by about 16%. Browsers without linear() get a cubic-bezier that overshoots about as far.
+ function spring(z){
+ const w=4.6/z,d=w*Math.sqrt(1-z*z),p=[];
+ for(let i=0;i<40;i++){const t=i/40;p.push((1-Math.exp(-z*w*t)*(Math.cos(d*t)+z*w/d*Math.sin(d*t))).toFixed(3))}
+ return 'linear('+p.join(',')+',1)';
+ }
+ const curves=CSS.supports('transition-timing-function','linear(0,1)');
+ const EASE={none:'cubic-bezier(.22,1,.36,1)',soft:curves?spring(.68):'cubic-bezier(.3,1.2,.5,1)',springy:curves?spring(.5):'cubic-bezier(.3,1.5,.45,1)'};
+
+ // The shape's size: the open card's, else the resting pill's. Under reduced motion the card keeps its size while it fades out.
+ function shape(){
+ const g=SIZE[open||reduceMq.matches?note:'rest'];
+ ['--hw','--h','--r'].forEach((v,i)=>isl.style.setProperty(v,g[i]));
+ }
+ // The timer counts down from 5:00 while it shows
+ function clock(){
+ clearInterval(tick);
+ if(!open||note!=='timer')return;
+ const t0=performance.now();
+ const draw=()=>{const s=Math.max(0,300-Math.floor((performance.now()-t0)/1000));tm.innerHTML=(Math.floor(s/60)+':'+String(s%60).padStart(2,'0')).replace(/\d/g,'<i>$&</i>')};
+ draw();tick=setInterval(draw,250);
+ }
+ // Open or close it. Only the visitor's own changes are announced (politely); Show me's are not.
+ function setOpen(next,visitor){
+ open=next;isl.classList.toggle('open',open);isl.setAttribute('aria-expanded',String(open));
+ shape();clock();
+ if(visitor)say.textContent=open?SAY[note]:'';
+ }
+ isl.addEventListener('click',()=>setOpen(!open,true));
+ isl.addEventListener('keydown',e=>{if(e.key==='Escape'&&open){e.preventDefault();setOpen(false,true)}});
+ // A press anywhere else on the stage closes it, as a tap outside does on a phone
+ stage.addEventListener('click',e=>{if(open&&!isl.contains(e.target))setOpen(false,true)});
+ reduceMq.addEventListener('change',shape);
+
+ // Show me: one run at a time. later(fn, move, hold) waits move*(slow?3:1) + hold ms: Slow motion triples the movement, never the hold.
+ function later(fn,move,hold){
+ const id=setTimeout(()=>{runTimers.splice(runTimers.indexOf(id),1);fn()},move*(slowTog.checked?3:1)+hold);
+ runTimers.push(id);
+ }
+ function running(){return runTimers.length>0}
+ function stopRun(){runTimers.forEach(clearTimeout);runTimers=[];isl.classList.remove('down')}
+ // A run starts from the pill at rest, put there without animating
+ function toRest(){isl.classList.add('still');setOpen(false);void isl.offsetWidth;isl.classList.remove('still')}
+ // The pill is pressed at 300ms and opens at 420ms; it shrinks back after the move and 1.4 s. At Normal it is at rest again at 3.2 s.
+ // The arrival press leaves alone an island the visitor has already opened.
+ $('btn-demo').addEventListener('click',e=>{
+ if(!e.isTrusted&&open)return;
+ stopRun();toRest();
+ later(()=>isl.classList.add('down'),0,300);
+ later(()=>{isl.classList.remove('down');setOpen(true)},0,420);
+ later(()=>setOpen(false),dur,1820);
+ });
+ $('btn-reset').addEventListener('click',()=>{stopRun();setOpen(false)});
+ // The visitor pressed, typed, scrolled or moved the focus into the stage: the run stops and the island stays as it is
+ document.addEventListener('hb:input',()=>{if(running())stopRun()});
+ isl.addEventListener('focus',()=>{if(running())stopRun()});
+
+ function choices(id,pick){
+ const buttons=document.querySelectorAll('#'+id+' button');
+ buttons.forEach(b=>b.addEventListener('click',()=>{
+ buttons.forEach(x=>{x.classList.toggle('on',x===b);x.setAttribute('aria-pressed',String(x===b))});
+ pick(b.dataset);
+ }));
+ }
+ // A new notification opens the island, or changes the open card's shape into the new one
+ choices('note-seg',d=>{note=d.n;isl.dataset.n=note;stopRun();setOpen(true,true)});
+ choices('speed-seg',d=>{dur=+d.ms;isl.style.setProperty('--dur',dur+'ms')});
+ choices('bounce-seg',d=>isl.style.setProperty('--ease',EASE[d.b]));
+ isl.style.setProperty('--ease',EASE.soft);shape();
+</script>
+</body>
+</html>
diff --git a/animations/04-micro-interactions/toast-notification/README.md b/animations/04-micro-interactions/toast-notification/README.md
index b5f5b326..1504a05b 100644
--- a/animations/04-micro-interactions/toast-notification/README.md
+++ b/animations/04-micro-interactions/toast-notification/README.md
@@ -47,3 +47,4 @@ The region is `role="status" aria-live="polite"` so each toast's text is announc
- [Drawer / Panel Slide](../drawer-slide/) — a bigger panel that slides in from an edge
- [Modal Expand](../modal-expand/) — a window that must be closed before you go on
- [Success Confetti](../success-confetti/) — a celebration for a finished task
+- [Dynamic Island](../dynamic-island/) — a black pill that grows into a live notification and shrinks back
diff --git a/docs/launch-kit.md b/docs/launch-kit.md
index dda098f3..0b3cd1ea 100644
--- a/docs/launch-kit.md
+++ b/docs/launch-kit.md
@@ -10,7 +10,7 @@ quality is already there; this is the distribution layer. Work top to bottom.
GitHub → repo **Settings** (or the ⚙️ next to "About" on the repo home page):
**Description:**
-> 158 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step.
+> 159 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step.
**Website:** `https://matinmonshizadeh.github.io/animation-handbook/`
@@ -25,7 +25,7 @@ With the GitHub CLI (`gh`), this is one command:
```bash
gh repo edit matinmonshizadeh/animation-handbook \
- --description "158 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step." \
+ --description "159 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step." \
--homepage "https://matinmonshizadeh.github.io/animation-handbook/" \
--add-topic web-animation,css-animation,animation,frontend,web-development,javascript,motion-design,ui-animation,scroll-animation,microinteractions,webgl,ai-prompts,reference,no-dependencies,github-pages \
--remove-topic awesome
@@ -41,7 +41,7 @@ and share, which drives return visits.
## 2. Verify SEO is live (after pushing)
-- `https://matinmonshizadeh.github.io/animation-handbook/sitemap.xml` → should list 159 URLs
+- `https://matinmonshizadeh.github.io/animation-handbook/sitemap.xml` → should list 160 URLs
- `https://matinmonshizadeh.github.io/animation-handbook/robots.txt` → should load
- Submit the sitemap to **Google Search Console** (add the property, then Sitemaps → submit `sitemap.xml`).
- Test the social card at https://opengraph.xyz — paste the homepage URL, confirm the og-image shows.
@@ -59,14 +59,14 @@ comments yourself in the first hours.
### Show HN (news.ycombinator.com/submit)
**Title:**
-> Show HN: Animation Handbook – 158 web animations, each with a prompt for your AI
+> Show HN: Animation Handbook – 159 web animations, each with a prompt for your AI
**URL:** `https://matinmonshizadeh.github.io/animation-handbook/`
**First comment (post immediately after submitting):**
> I kept re-googling the same animation techniques and landing on either a
> library's marketing page or a CodePen with no explanation. So I built a
-> reference: 158 techniques, from scroll effects and page transitions to
+> reference: 159 techniques, from scroll effects and page transitions to
> micro-interactions, text, 3D, and ambient backgrounds. You find one by where it
> goes on your page (buttons, text, backgrounds, page changes…) or by describing
> it. Each one plays live, has a few plain settings, and gives you a ready-made
@@ -78,10 +78,10 @@ comments yourself in the first hours.
### Reddit — r/webdev (Showoff Saturday) and r/Frontend
**Title:**
-> I built a handbook of 158 web animations — watch each one live, tweak it, and copy a prompt for your AI assistant
+> I built a handbook of 159 web animations — watch each one live, tweak it, and copy a prompt for your AI assistant
**Body:**
-> 158 techniques in 7 categories (scroll, entrance/exit, page transitions,
+> 159 techniques in 7 categories (scroll, entrance/exit, page transitions,
> micro-interactions, text, 3D, ambient). Find one by where it goes on your page or
> by describing it, try a few plain settings, then copy a prompt that describes it in
> plain words for ChatGPT, Claude or Cursor. Each technique is also one standalone
@@ -93,7 +93,7 @@ comments yourself in the first hours.
### dev.to / Hashnode article
-**Title:** `158 web animations you can copy as a prompt for your AI assistant`
+**Title:** `159 web animations you can copy as a prompt for your AI assistant`
**Outline:**
1. The problem — animation knowledge is scattered across libraries and CodePens, and an AI
@@ -108,7 +108,7 @@ comments yourself in the first hours.
### X / Bluesky thread
-> 1/ I built Animation Handbook — 158 web animations you can watch live, tweak, and
+> 1/ I built Animation Handbook — 159 web animations you can watch live, tweak, and
> copy as a prompt for your AI assistant. No dependencies, no build step. 🧵 <docs/demo.gif>
>
> 2/ Find one by where it goes — buttons, text, backgrounds, page changes — or just
@@ -126,7 +126,7 @@ awesome-web-animation) via PR.
### Product Hunt
-**Tagline:** `158 web animations, each with a prompt for your AI assistant`
+**Tagline:** `159 web animations, each with a prompt for your AI assistant`
Schedule for a Tuesday–Thursday 12:01am PT. Line up 5–10 people to comment/upvote early.
---
diff --git a/index.html b/index.html
index f247bf7a..5a97eff9 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"],
@@ -843,6 +843,23 @@ button,input{font:inherit;color:inherit}
@keyframes bl-gc{0%,54%{transform:scale(1);opacity:0}58%{opacity:1}61%{transform:scale(1.08)}65%,80%{transform:scale(1);opacity:1}88%,100%{transform:scale(.8);opacity:0}}
@keyframes bl-sp{0%,18%{transform:rotate(0);opacity:0}22%{opacity:1}54%{transform:rotate(810deg);opacity:1}57%,100%{transform:rotate(810deg);opacity:0}}
@keyframes bl-tk{0%,56%{transform:scale(.5);opacity:0}62%,80%{transform:scale(1);opacity:1}86%,100%{transform:scale(1);opacity:0}}
+/* dynamic island: at the top of a phone, a black pill grows into a call card, bounces a little and shrinks back. Pill and card are
+ one capsule scaled evenly, so its ends stay round; the avatar, the lines and the two buttons fade in while it is open. The phone
+ starts low, clear of the place label */
+.pv-dynisland{background:radial-gradient(50% 70% at 50% 40%,rgba(124,92,255,.18),transparent),#08090c;overflow:hidden;container-type:size}
+.pv-dynisland .ph{position:absolute;left:25cqw;right:25cqw;top:29cqh;bottom:-8cqh;border:1.5px solid #3a3a43;border-bottom:0;border-radius:8cqw 8cqw 0 0;background:radial-gradient(90% 60% at 0 100%,rgba(124,92,255,.5),transparent 70%),linear-gradient(#2b3a5c,#1d1a3c)}
+.pv-dynisland .ph::before,.pv-dynisland .ph::after{content:"";position:absolute;top:3.4cqw;left:7cqw;width:6cqw;height:1.6cqw;border-radius:1cqw;background:#e9e9ec}
+.pv-dynisland .ph::after{left:auto;right:6cqw;width:5cqw}
+.pv-dynisland .ph b{position:absolute;left:0;right:0;top:34cqh;text-align:center;color:#fff;font:700 15cqh/1 var(--disp);letter-spacing:-.02em}
+.pv-dynisland .is{position:absolute;left:28cqw;top:calc(29cqh + 1.8cqw);width:44cqw;height:11cqw;border-radius:5.5cqw;background:#000;transform-origin:50% 0;animation:di-is 4.4s var(--ease) infinite}
+.pv-dynisland .in{position:absolute;inset:0;animation:di-in 4.4s ease infinite}
+.pv-dynisland .in i{position:absolute;top:2.25cqw;width:6.5cqw;height:6.5cqw;border-radius:50%}
+.pv-dynisland .av{left:2.25cqw;background:linear-gradient(135deg,#c2410c,#9d174d)}
+.pv-dynisland .in .l1,.pv-dynisland .in .l2{left:11cqw;width:12cqw;height:1.3cqw;border-radius:1cqw;background:#8a8a92}
+.pv-dynisland .in .l1{top:3.3cqw}.pv-dynisland .in .l2{top:6cqw;width:9cqw;height:1.8cqw;background:#fff}
+.pv-dynisland .no{right:10cqw;background:#ff453a}.pv-dynisland .yes{right:2.25cqw;background:#30d158}
+@keyframes di-is{0%,14%{transform:scale(.32)}26%{transform:scale(1.05)}32%,72%{transform:scale(1)}84%,100%{transform:scale(.32)}}
+@keyframes di-in{0%,26%{opacity:0}34%,68%{opacity:1}74%,100%{opacity:0}}
/* ── bespoke: 05 Text & Typography ── */
.pv-kinetic{background:#0c0608;display:grid;place-items:center;overflow:hidden}
@@ -1329,7 +1346,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 +1403,8 @@ button,input{font:inherit;color:inherit}
<p class="empty-s">Try a simpler word, or pick one of these:</p>
<p class="pop"><button type="button" data-q="fade in">fade in</button><button type="button" data-q="typing text">typing text</button><button type="button" data-q="loading spinner">loading spinner</button><button type="button" data-q="parallax">parallax</button><button type="button" data-q="confetti">confetti</button></p>
</div>
- <div class="more" id="more"><button type="button" class="bigbtn" id="more-btn"><span id="more-label">Browse all 158 animations</span><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M6 13l6 6 6-6"/></svg></button></div>
- <noscript><p class="noscript">This page shows its animations with JavaScript. All 158 are still easy to reach: see the <a href="https://github.com/matinmonshizadeh/animation-handbook#categories">category list on GitHub</a> or the <a href="sitemap.xml">full sitemap</a>. Each demo is a page of its own under <code>/animations/&lt;category&gt;/&lt;name&gt;/</code>.</p></noscript>
+ <div class="more" id="more"><button type="button" class="bigbtn" id="more-btn"><span id="more-label">Browse all 159 animations</span><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M6 13l6 6 6-6"/></svg></button></div>
+ <noscript><p class="noscript">This page shows its animations with JavaScript. All 159 are still easy to reach: see the <a href="https://github.com/matinmonshizadeh/animation-handbook#categories">category list on GitHub</a> or the <a href="sitemap.xml">full sitemap</a>. Each demo is a page of its own under <code>/animations/&lt;category&gt;/&lt;name&gt;/</code>.</p></noscript>
</section>
<section class="how" id="how" aria-labelledby="how-title">
@@ -1405,7 +1422,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>
@@ -1541,6 +1558,7 @@ const CATS=[
['hold-to-confirm','Hold to Confirm','A button fills up while you hold it and acts only once it is full. Best for delete buttons.'],
['expanding-search','Expanding Search','A search icon opens into a field, then closes when done. Best for toolbars.'],
['button-loading-states','Button Loading States','The button becomes a spinner, then a tick or a cross. Best for Save buttons.'],
+ ['dynamic-island','Dynamic Island','A black pill grows into a notification, then shrinks back. Best for live updates.'],
]
},
{
@@ -1639,7 +1657,7 @@ const PV={
'drag-to-reorder':'reorder',
'rolling-numbers':'rollnum',
'typing-indicator':'typing',
- 'hold-to-confirm':'holdconf','expanding-search':'xsearch','button-loading-states':'btnload',
+ 'hold-to-confirm':'holdconf','expanding-search':'xsearch','button-loading-states':'btnload','dynamic-island':'dynisland',
'flip-card-3d':'flip3d','carousel-3d':'carousel3d','depth-map-photo':'depthmap','flocking':'flock','ascii-halftone':'ascii','physics-2d':'phys2d','matrix-rain':'matrix','plasma':'plasmapv',
'wave-layers':'wavelayers','snow-rain':'snowrain','fireworks':'fireworks',
'topographic-lines':'topo','light-rays':'rays','game-of-life':'life',
@@ -1779,6 +1797,7 @@ const PLACES={
'hold-to-confirm':['btn'],
'expanding-search':['menu','btn'],
'button-loading-states':['btn','load'],
+ 'dynamic-island':['load','menu'],
// 05
'kinetic-typography':['text','intro'],
'typewriter-effect':['text','intro'],
@@ -1861,6 +1880,7 @@ function pvMarkup(k){
case 'pcurl': return '<span class="pg"><b></b><b></b><b></b></span><span class="nb anim"></span><span class="pg pb anim"><b></b><b></b><b></b></span><span class="fl anim"></span>';
case 'owipe': return '<span class="pg"><b></b><b></b><b></b></span><span class="pbg anim"><span class="pg"><b></b><b></b><b></b></span></span><span class="w w1 anim"></span><span class="w w2 anim"></span>';
case 'sig4': return '<span class="s4r anim"></span><span class="s4r r2 anim"></span><span class="s4r r3 anim"></span><span class="s4d"></span>';
+ case 'dynisland': return '<span class="ph"><b>9:41</b></span><span class="is anim"><span class="in anim"><i class="av"></i><i class="l1"></i><i class="l2"></i><i class="no"></i><i class="yes"></i></span></span>';
case 'gradborder': return '<span class="gbx"><span class="gl"><i class="anim"></i></span><span class="rg"><i class="anim"></i></span><span class="in"><b></b><b></b><b></b></span></span>';
case 'spotlight': return '<span class="sg"><span class="lt anim"></span>'+'<i></i>'.repeat(6)+'</span>';
case 'cartfly': return '<span class="pd"></span><span class="bt anim"></span><span class="ct anim"><svg viewBox="0 0 24 24"><path d="M2.5 3.5h2.3l2.5 11a1.5 1.5 0 0 0 1.5 1.2h8.6a1.5 1.5 0 0 0 1.4-1.1l1.9-6.6H6"/><circle cx="9.5" cy="19.6" r="1.4"/><circle cx="17" cy="19.6" r="1.4"/></svg><span class="bd"><b class="n2 anim">2</b><b class="n3 anim">3</b></span></span><span class="fx anim"><span class="fy anim"><span class="fs anim"></span></span></span>';
diff --git a/sitemap.xml b/sitemap.xml
index 38230db2..817603c2 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -95,6 +95,7 @@
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/hold-to-confirm/</loc><lastmod>2026-10-01</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/expanding-search/</loc><lastmod>2026-10-01</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/button-loading-states/</loc><lastmod>2026-10-01</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
+ <url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/04-micro-interactions/dynamic-island/</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/kinetic-typography/</loc><lastmod>2026-07-14</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/typewriter-effect/</loc><lastmod>2026-07-14</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/scramble-text/</loc><lastmod>2026-07-14</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>