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: Liquid Glass (06.24)

matin180bb3844392
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..0dec7292 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,14 @@
<div align="center">
-<a href="https://matinmonshizadeh.github.io/animation-handbook/"><img src="og-image.png" alt="Animation Handbook — 158 web animation techniques with live demos" width="820"></a>
+<a href="https://matinmonshizadeh.github.io/animation-handbook/"><img src="og-image.png" alt="Animation Handbook — 159 web animation techniques with live demos" width="820"></a>
# Animation Handbook
-**A visual reference of 158 web animation techniques — every entry is a live, dependency-free demo you can open in the browser and read how it works.**
+**A visual reference of 159 web animation techniques — every entry is a live, dependency-free demo you can open in the browser and read how it works.**
[**Open the live handbook →**](https://matinmonshizadeh.github.io/animation-handbook/)
-[![Live site](https://img.shields.io/website?url=https%3A%2F%2Fmatinmonshizadeh.github.io%2Fanimation-handbook%2F&label=live%20demo&up_message=online&color=6ea8ff)](https://matinmonshizadeh.github.io/animation-handbook/) [![Stars](https://img.shields.io/github/stars/matinmonshizadeh/animation-handbook?style=flat&color=5fd88a)](https://github.com/matinmonshizadeh/animation-handbook/stargazers) [![License](https://img.shields.io/github/license/matinmonshizadeh/animation-handbook?color=b98cff)](LICENSE) ![Techniques](https://img.shields.io/badge/techniques-158-ff9d5c) ![Dependencies](https://img.shields.io/badge/dependencies-0-ff6f8b) ![Build](https://img.shields.io/badge/build-none-3fd6c4)
+[![Live site](https://img.shields.io/website?url=https%3A%2F%2Fmatinmonshizadeh.github.io%2Fanimation-handbook%2F&label=live%20demo&up_message=online&color=6ea8ff)](https://matinmonshizadeh.github.io/animation-handbook/) [![Stars](https://img.shields.io/github/stars/matinmonshizadeh/animation-handbook?style=flat&color=5fd88a)](https://github.com/matinmonshizadeh/animation-handbook/stargazers) [![License](https://img.shields.io/github/license/matinmonshizadeh/animation-handbook?color=b98cff)](LICENSE) ![Techniques](https://img.shields.io/badge/techniques-159-ff9d5c) ![Dependencies](https://img.shields.io/badge/dependencies-0-ff6f8b) ![Build](https://img.shields.io/badge/build-none-3fd6c4)
</div>
@@ -39,12 +39,12 @@ Everything is plain HTML, CSS, and JavaScript: no build step, no frameworks, no
| 03 | [Page Transitions](#03) | 16 | Full-page transitions between routes or views — crossfades, slides, portals, morphs, and the browser-native API. |
| 04 | [Micro-Interactions](#04) | 38 | Short, user-triggered animations — hover, click, focus, loading states, and UI feedback patterns. |
| 05 | [Text & Typography](#05) | 18 | Animations specifically for type — kinetic motion, character-level effects, gradient flows, and word transformations. |
-| 06 | [3D & Advanced](#06) | 23 | WebGL, shaders, particles, 3D transforms, and the performance-sensitive effects that push the browser's limits. |
+| 06 | [3D & Advanced](#06) | 24 | WebGL, shaders, particles, 3D transforms, and the performance-sensitive effects that push the browser's limits. |
| 07 | [Ambient & Background](#07) | 23 | Passive, looping effects that hold visual interest without demanding attention — gradients, particles, grain, and glows. |
## Full catalog
-All 158 techniques, each linked to its live demo.
+All 159 techniques, each linked to its live demo.
<a id="01"></a>
@@ -215,7 +215,7 @@ All 158 techniques, each linked to its live demo.
<a id="06"></a>
-### 06 · 3D & Advanced · 23 techniques
+### 06 · 3D & Advanced · 24 techniques
<sub>WebGL, shaders, particles, 3D transforms, and the performance-sensitive effects that push the browser's limits.</sub>
@@ -244,6 +244,7 @@ All 158 techniques, each linked to its live demo.
- **[Flocking](animations/06-3d-advanced/flocking/)** — Birds swirl and turn together as one flock. Best for calm backgrounds.
- **[ASCII / Halftone](animations/06-3d-advanced/ascii-halftone/)** — A moving picture is redrawn with letters or dots. Best for retro and tech looks.
- **[2D Physics](animations/06-3d-advanced/physics-2d/)** — Balls drop where you click, bounce and pile up. Best for playful intros.
+- **[Liquid Glass](animations/06-3d-advanced/liquid-glass/)** — Drag a glass panel and the picture behind it bends at the edges. Best for cards.
</details>
diff --git a/animations/06-3d-advanced/README.md b/animations/06-3d-advanced/README.md
index 4874ecff..3495b6f7 100644
--- a/animations/06-3d-advanced/README.md
+++ b/animations/06-3d-advanced/README.md
@@ -29,6 +29,7 @@ WebGL, shaders, particles, 3D transforms, and the performance-sensitive effects
| [Flocking](flocking/) | Birds swirl and turn together as one flock. Best for calm backgrounds. |
| [ASCII / Halftone](ascii-halftone/) | A moving picture is redrawn with letters or dots. Best for retro and tech looks. |
| [2D Physics](physics-2d/) | Balls drop where you click, bounce and pile up. Best for playful intros. |
+| [Liquid Glass](liquid-glass/) | Drag a glass panel and the picture behind it bends at the edges. Best for cards. |
## Key concepts
@@ -47,6 +48,7 @@ WebGL, shaders, particles, 3D transforms, and the performance-sensitive effects
| All WebGL demos | WebGL 1.0 (all modern browsers) |
| GPGPU Particle System | WebGL2 (Chrome 56+, Firefox 51+, Safari 15+) |
| backdrop-filter (Glassmorphism) | Chrome, Edge, Safari; Firefox 103+ |
+| SVG filter in backdrop-filter (Liquid Glass) | Chromium browsers (Chrome, Edge, Opera); Safari and Firefox show frosted glass instead |
## See also
- [04 — Micro-Interactions](../04-micro-interactions/) — lighter-weight interactive animations
diff --git a/animations/06-3d-advanced/glassmorphism-animated/README.md b/animations/06-3d-advanced/glassmorphism-animated/README.md
index 9094ae43..c679bbb0 100644
--- a/animations/06-3d-advanced/glassmorphism-animated/README.md
+++ b/animations/06-3d-advanced/glassmorphism-animated/README.md
@@ -100,3 +100,4 @@ Three CSS properties create the glass effect:
- [Mesh Gradient Animation](../../07-ambient-background/mesh-gradient/) — soft color blobs drifting as a background
- [WebGL Shader Animation](../webgl-shader-animation/) — moving color drawn on the graphics chip
- [Modal Expand](../../04-micro-interactions/modal-expand/) — a dialog, where frosted glass often appears
+- [Liquid Glass](../liquid-glass/) — clear glass that bends what is behind it at its edges instead of blurring it
diff --git a/animations/06-3d-advanced/liquid-glass/README.md b/animations/06-3d-advanced/liquid-glass/README.md
new file mode 100644
index 00000000..a87a27a9
--- /dev/null
+++ b/animations/06-3d-advanced/liquid-glass/README.md
@@ -0,0 +1,82 @@
+# Liquid Glass
+
+## What it is
+Liquid glass makes a panel look like a slab of thick, clear glass lying on the page. Near its rounded edges the picture behind it is bent and magnified, the way the curved rim of a lens bends light, while the middle stays almost clear, and a thin highlight runs along the rim. In Chromium browsers the bend is a displacement filter applied to whatever is behind the panel; other browsers show the same panel as frosted glass.
+
+## When to use it
+- Floating menus and tab bars that sit over photos or scrolling content
+- Media controls and small cards laid over a hero image or a video
+- A lens you can drag over a map, a chart or a product photo
+- One tactile, eye-catching control on a product page or a portfolio
+
+## How it works
+**The filter.** An SVG filter moves every pixel by an amount it reads from a second picture, the displacement map: the map's red channel is the sideways shift and its green channel the shift up or down, with 128 meaning no shift. Referenced from `backdrop-filter`, the filter bends what lies behind the panel instead of the panel's own content:
+
+```html
+<svg width="0" height="0" style="position:absolute">
+ <filter id="lg-filter" filterUnits="userSpaceOnUse" x="0" y="0" width="280" height="174" color-interpolation-filters="sRGB">
+ <feImage href="data:image/png;base64,…" x="0" y="0" width="280" height="174" preserveAspectRatio="none" result="map"/>
+ <feDisplacementMap in="SourceGraphic" in2="map" scale="59" xChannelSelector="R" yChannelSelector="G"/>
+ </filter>
+</svg>
+```
+
+```css
+.lg-refract .lg-glass { backdrop-filter: url(#lg-filter) blur(var(--lg-blur)) saturate(1.3); }
+```
+
+The filter region and the map are the panel's own size in pixels, so the map lines up with the panel, and the script sets both whenever the panel changes size. `color-interpolation-filters="sRGB"` keeps 128 in the middle: in the default linear color space the filter reads that gray as about 0.22 and shifts everything.
+
+**The map.** The demo draws the map on a canvas, one pixel for each CSS pixel of the panel. For every pixel it finds `e`, the distance in from the rounded edge, and `(nx, ny)`, the direction out of it. Inside the rim, which is 70% of the panel's half height, the pixel is told to read the picture from further in, most at the very edge, so the rim magnifies what is behind it; a small pull toward the middle everywhere magnifies the whole panel a little. Outside the rounded corners the map stays at 128:
+
+```js
+const m = e < 0 ? 0 : (1 - Math.min(1, e / B)) ** 2, z = e < 0 ? 0 : MAG; // B: the rim's width, MAG = 0.15
+d[k] = 128 - 127 * (nx * m + z * X / hw) / (1 + MAG); // red: sideways
+d[k + 1] = 128 - 127 * (ny * m + z * Y / hh) / (1 + MAG); // green: up and down
+```
+
+The filter shifts a pixel by up to half its `scale`, so How much it bends only changes `scale` (twice the bend times the rim's width, times 1.15 for the pull toward the middle); the map is drawn again only when the panel changes size or shape.
+
+**Which browsers bend.** Chromium-based browsers, such as Chrome, Edge and Opera, draw an SVG filter in `backdrop-filter` (the demo was checked in Chrome and Edge). Safari and Firefox do not draw it, and a feature test cannot tell: `CSS.supports()` checks only that the rule is valid, not that the bend appears. The demo gives the bend to browsers that list Chromium among their brands in `navigator.userAgentData`, which only Chromium-based browsers have, and shows everyone else frosted glass: a blur of the backdrop with the same tint, rim and shadow, and a glow inside the rim that grows with How much it bends.
+
+```js
+const REFRACT = !!(navigator.userAgentData && navigator.userAgentData.brands.some(b => b.brand === 'Chromium'))
+ && CSS.supports('backdrop-filter', 'url(#lg-filter)');
+stage.classList.toggle('lg-refract', REFRACT);
+```
+
+**The liquid stretch.** The panel moves by `transform` only. Its speed, measured from one drawn frame to the next and smoothed over a few frames, sets how far it should stretch along the motion: about 6% for every width of the panel it covers in a second, at most 12%. A spring that takes fixed steps of 1/60 s follows that target, so the stretch lags a little, and when the panel stops it overshoots into a short wobble. The stretch keeps the area: longer along the motion, shorter across it, as one matrix around the panel's center:
+
+```js
+const ta = e * (ux * ux - uy * uy), tb = e * 2 * ux * uy; // the target for the motion's direction (ux, uy)
+for (acc += dt * f; acc >= FRAME; acc -= FRAME) { // f is 1/3 in slow motion
+ va += -.08 * (a - ta) - .1 * va; vb += -.08 * (b - tb) - .1 * vb; a += va; b += vb;
+}
+glass.style.transform = `translate(${x - gw / 2}px, ${y - gh / 2}px) matrix(${1 + a}, ${b}, ${b}, ${1 - a}, 0, 0)`;
+```
+
+Show me glides along three legs (to the left end, across to the right end and back where it started), each eased in and out and timed by its length, 3.6 s in all. The arrow keys move a target a step at a time (8% of the stage's shorter side, three steps with Shift), and the panel glides toward it by a share of the gap per 1/60 s, the same on any screen.
+
+**Reduced motion.** The panel still follows the pointer or finger while it is dragged, but it never stretches, wobbles or glides: the arrow keys, a tap and Reset move it at once, and Show me puts it at the right end for 1.2 s and back.
+
+## Key parameters
+| Parameter | Default | Effect |
+|-----------|---------|--------|
+| How much it bends | Medium | The deepest shift, at the very edge, as a share of the rim's width: subtle 25%, medium 42% and strong 60%. Past half the rim folds into a thin mirrored band, as the edge of thick glass does |
+| Frost | Clear | How much the backdrop is blurred: clear none, light 1.5 and frosted 4 pixels where the glass bends; 3, 8 and 16 pixels for the frosted glass of other browsers |
+| Tint | White | The color the glass adds, mixed in at 9% for white and 20% for the other colors |
+| Shape | Card | Card: 1.6 times as wide as tall, corners a third of its height; pill: 2.7 times as wide as tall with round ends; circle: a round lens. The card is 30% of the stage's width, from 150 to 280 pixels |
+| Shows the bend map | off | Lays the displacement map over the glass: red is the sideways shift, green the shift up or down, gray none |
+
+## Production notes
+- **Chromium only, for now**: `backdrop-filter: url()` bends the backdrop in Chromium; Safari and Firefox need the fallback, so check the page in both. A way that reaches more browsers is to put a copy of the background inside the panel and apply the same filter to that copy with `filter: url()`, which also works on ordinary elements; it only works where you control what is behind the panel.
+- **Detection**: `CSS.supports()` only checks the syntax, so pair it with a check for Chromium, as the demo does, and keep the fallback good enough to be the whole effect.
+- **Cost**: the browser filters the backdrop again on every frame the panel moves, and the work grows with the panel's area. Keep glass to menus, controls and small cards, not full-screen sheets. The displacement is one texture lookup per pixel; the blur is the expensive part, so keep frost light. The demo's panel is a share of the stage, so it is smaller on phones.
+- **Keep the map in step with the panel**: a map drawn for another size moves the bend away from the rim. Redraw it on resize and when the shape changes; changing only `scale` is cheap.
+- **Text on glass**: text over refracted, moving color can drop below 4.5:1. Give it a dark see-through layer or a solid backing, as Glassmorphism Animated does.
+- **Libraries**: no library is needed for the filter. The drag and the wobble can come from GSAP's Draggable with an elastic ease or Framer Motion's drag with a spring; several open-source React and Vue components wrap the same SVG displacement technique. In native apps, Apple's Liquid Glass (iOS and macOS 26) is a system material.
+
+## See also
+- [Glassmorphism Animated](../glassmorphism-animated/) — frosted glass that blurs what is behind it instead of bending it
+- [Image Distortion on Hover](../image-distortion-hover/) — a picture bent around the pointer, drawn with a shader
+- [Parallax 3D Tilt](../parallax-3d-tilt/) — a card tilts toward the pointer while a light slides over it
diff --git a/animations/06-3d-advanced/liquid-glass/index.html b/animations/06-3d-advanced/liquid-glass/index.html
new file mode 100644
index 00000000..07f6b30f
--- /dev/null
+++ b/animations/06-3d-advanced/liquid-glass/index.html
@@ -0,0 +1,302 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Liquid Glass — Animation Handbook</title>
+ <meta name="description" content="Drag a glass panel and the picture behind it bends at the edges. Best for cards.">
+ <link rel="canonical" href="https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/liquid-glass/">
+ <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="Liquid Glass — Animation Handbook">
+ <meta property="og:description" content="Drag a glass panel and the picture behind it bends at the edges. Best for cards.">
+ <meta property="og:url" content="https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/liquid-glass/">
+ <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="Liquid Glass — Animation Handbook">
+ <meta name="twitter:description" content="Drag a glass panel and the picture behind it bends at the edges. Best for cards.">
+ <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": "Liquid Glass", "name": "Liquid Glass", "description": "Drag a glass panel and the picture behind it bends at the edges. Best for cards.", "url": "https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/liquid-glass/", "inLanguage": "en", "articleSection": "3D & Advanced", "isPartOf": {"@type": "WebSite", "name": "Animation Handbook", "url": "https://matinmonshizadeh.github.io/animation-handbook/"}, "author": {"@type": "Person", "name": "matinmonshizadeh"}, "keywords": "web animation, CSS animation, 3D & Advanced, Liquid Glass"}</script>
+ <style>
+ :root{--ui-accent:#3fd6c4}
+ *,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
+ /* The picture behind the glass, drawn with gradients and sized by the stage (1cqw and 1cqh are 1% of its width and height):
+ dots, stripes, thin neon lines and big letters give the bend edges to show */
+ .stage{--lg-tint:#f4f4f2;--lg-tp:9%;--lg-blur:0px;--lg-fb:3px;--lg-rim:23px;position:relative;overflow:hidden;container-type:size;-webkit-user-select:none;user-select:none;
+ background:radial-gradient(80% 90% at 88% 4%,#3b2c86,transparent 62%),linear-gradient(168deg,#1e1752,#100f36 52%,#0a1b2d)}
+ .lg-scene,.lg-scene>*{position:absolute;display:block}
+ .lg-scene{inset:0}
+ .lg-dots{left:0;top:0;width:58%;height:70%;background:radial-gradient(circle,rgba(255,255,255,.32) 1.5px,transparent 2px) 0 0/18px 18px;-webkit-mask:radial-gradient(farthest-side at 0 0,#000 50%,transparent);mask:radial-gradient(farthest-side at 0 0,#000 50%,transparent)}
+ .lg-sun{right:6%;top:7%;width:min(42cqh,27cqw);aspect-ratio:1;border-radius:50%;background:linear-gradient(#ffd36e,#ff8a5c 55%,#ff5c8a);-webkit-mask:linear-gradient(#000 50%,transparent 0),repeating-linear-gradient(transparent 0 2.5%,#000 0 9%);mask:linear-gradient(#000 50%,transparent 0),repeating-linear-gradient(transparent 0 2.5%,#000 0 9%)}
+ /* A skyline of dark towers lined with neon, cut out of one wide band */
+ .lg-city{left:0;right:0;bottom:30%;height:26%;background:repeating-linear-gradient(90deg,#b98cff 0 2px,transparent 2px 9px),linear-gradient(#2c2070,#150f3c);clip-path:polygon(0 100%,0 52%,6% 52%,6% 30%,11% 30%,11% 64%,15% 64%,15% 12%,21% 12%,21% 44%,26% 44%,26% 70%,31% 70%,31% 26%,36% 26%,36% 56%,41% 56%,41% 6%,46% 6%,46% 40%,52% 40%,52% 62%,57% 62%,57% 20%,62% 20%,62% 48%,67% 48%,67% 34%,72% 34%,72% 66%,77% 66%,77% 24%,83% 24%,83% 54%,88% 54%,88% 16%,94% 16%,94% 46%,100% 46%,100% 100%)}
+ .lg-sea{left:0;right:0;bottom:0;height:30%;background:repeating-linear-gradient(#3fd6c4 0 4px,transparent 4px 13px);-webkit-mask:linear-gradient(transparent,#000 25%);mask:linear-gradient(transparent,#000 25%)}
+ .lg-ball{width:7cqmin;aspect-ratio:1;border-radius:50%}
+ .lg-b1{left:47%;top:11%;background:#ff6f8b}.lg-b2{left:30%;top:20%;width:4cqmin;background:#ffce5a}
+ .lg-word{left:5%;top:27%;font-weight:900;font-size:min(17cqh,10cqw);line-height:1;letter-spacing:-.03em;color:#fff;white-space:nowrap}
+ /* Narrow stages (phones): a smaller sun, higher, so the letters pass under it */
+ @container (aspect-ratio < 1.8){.lg-sun{top:5%;width:26cqw}.lg-word{top:34%}.lg-b1{left:56%;top:6%}}
+ /* The glass: a faint tint, a gloss at the top, a thin rim that catches the light and a shadow below. Where the bend cannot be
+ drawn, the backdrop is blurred (frosted glass) and a glow inside the rim grows with the bend. */
+ .lg-glass{position:absolute;left:0;top:0;cursor:grab;touch-action:none;will-change:transform;
+ background:radial-gradient(120% 80% at 25% 0%,rgba(255,255,255,.16),transparent 55%),color-mix(in srgb,var(--lg-tint) var(--lg-tp),transparent);
+ -webkit-backdrop-filter:blur(var(--lg-fb)) saturate(1.7);backdrop-filter:blur(var(--lg-fb)) saturate(1.7);box-shadow:0 18px 38px rgba(0,0,0,.45),0 3px 8px rgba(0,0,0,.25),inset 0 0 var(--lg-rim) calc(var(--lg-rim) / 3) rgba(255,255,255,.3)}
+ .lg-refract .lg-glass{backdrop-filter:url(#lg-filter) blur(var(--lg-blur)) saturate(1.3);box-shadow:0 18px 38px rgba(0,0,0,.45),0 3px 8px rgba(0,0,0,.25),inset 0 0 14px rgba(255,255,255,.12),inset 0 -10px 16px -12px rgba(255,255,255,.45)}
+ .lg-glass::before,.lg-map{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none}
+ .lg-glass::before{padding:1.5px;background:linear-gradient(135deg,#fff,rgba(255,255,255,.2) 28%,rgba(255,255,255,.06) 55%,rgba(255,255,255,.62));-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask-composite:exclude}
+ .lg-map{background:0 0/100% 100% no-repeat;opacity:.92}
+ .lg-glass.lg-grab{cursor:grabbing}
+ .lg-defs{position:absolute;width:0;height:0;overflow:hidden}
+ </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="../physics-2d/" rel="prev" aria-label="Previous: 2D Physics"><svg class="hb-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg><span><span class="hb-dir">Previous: </span>2D Physics</span></a></span>
+</nav>
+<main class="hb-page">
+ <header class="hb-head">
+ <p class="hb-cat">06.24 · 3D &amp; Advanced</p>
+ <h1>Liquid Glass</h1>
+ <p class="hb-lede">Drag a glass panel and the picture behind it bends at the edges. Best for cards.</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">Drag it</h2><p>Drag the glass or tap where it should go, use the arrow keys, or press Show me.</p></div>
+ </div>
+ <div class="stage" id="stage">
+ <div class="lg-scene" aria-hidden="true"><i class="lg-dots"></i><i class="lg-sun"></i><i class="lg-city"></i><i class="lg-sea"></i><i class="lg-ball lg-b1"></i><i class="lg-ball lg-b2"></i><p class="lg-word">Look closer</p></div>
+ <div class="lg-glass" id="glass" tabindex="0" role="group" aria-roledescription="glass panel" aria-label="Glass over a colorful picture. Drag it, or press the arrow keys to move it."><i class="lg-map" id="lg-map" hidden></i></div>
+ <svg class="lg-defs" aria-hidden="true" focusable="false"><filter id="lg-filter" filterUnits="userSpaceOnUse" x="0" y="0" width="1" height="1" color-interpolation-filters="sRGB"><feImage id="lg-img" x="0" y="0" width="1" height="1" preserveAspectRatio="none" result="map"/><feDisplacementMap id="lg-disp" in="SourceGraphic" in2="map" scale="0" xChannelSelector="R" yChannelSelector="G"/></filter></svg>
+ </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 autocomplete="off"><span>Slow motion</span></label>
+ </div>
+ </section>
+
+ <section class="hb-step hb-try" aria-labelledby="hb-try-title">
+ <div class="hb-step-head">
+ <span class="hb-num" aria-hidden="true">2</span>
+ <div><h2 id="hb-try-title">Try it</h2><p>Change a setting and look at the glass, then drag it or press Show me.</p></div>
+ </div>
+ <div class="hb-settings">
+ <div class="hb-setting">
+ <p class="hb-setting-name" id="bend-lbl">How much it bends</p>
+ <div class="seg" id="bend-seg" role="group" aria-labelledby="bend-lbl">
+ <button type="button" data-b=".25" aria-pressed="false">Subtle</button>
+ <button type="button" data-b=".42" class="on" aria-pressed="true">Medium</button>
+ <button type="button" data-b=".6" aria-pressed="false">Strong</button>
+ </div>
+ <p class="hb-hint">How far the rounded edge pulls in the picture behind it.</p>
+ </div>
+ <div class="hb-setting">
+ <p class="hb-setting-name" id="frost-lbl">Frost</p>
+ <div class="seg" id="frost-seg" role="group" aria-labelledby="frost-lbl">
+ <button type="button" data-f="0" data-fb="3" class="on" aria-pressed="true">Clear</button>
+ <button type="button" data-f="1.5" data-fb="8" aria-pressed="false">Light</button>
+ <button type="button" data-f="4" data-fb="16" aria-pressed="false">Frosted</button>
+ </div>
+ <p class="hb-hint">How much the glass blurs what is behind it.</p>
+ </div>
+ <div class="hb-setting">
+ <p class="hb-setting-name" id="tint-lbl">Tint</p>
+ <div class="swatches" id="tint-sw" role="group" aria-labelledby="tint-lbl">
+ <button type="button" aria-pressed="false" aria-label="Pink" data-c="#ff6f8b" data-p="20" style="background:#ff6f8b"></button>
+ <button type="button" class="on" aria-pressed="true" aria-label="White" data-c="#f4f4f2" data-p="9" style="background:#f4f4f2"></button>
+ <button type="button" aria-pressed="false" aria-label="Blue" data-c="#58a6ff" data-p="20" style="background:#58a6ff"></button>
+ <button type="button" aria-pressed="false" aria-label="Purple" data-c="#d2a8ff" data-p="20" style="background:#d2a8ff"></button>
+ <button type="button" aria-pressed="false" aria-label="Green" data-c="#56d364" data-p="20" style="background:#56d364"></button>
+ <button type="button" aria-pressed="false" aria-label="Orange" data-c="#ffa657" data-p="20" style="background:#ffa657"></button>
+ </div>
+ <p class="hb-hint">The color the glass adds.</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="shape-lbl">Shape</p>
+ <div class="seg" id="shape-seg" role="group" aria-labelledby="shape-lbl">
+ <button type="button" data-s="card" class="on" aria-pressed="true">Card</button>
+ <button type="button" data-s="pill" aria-pressed="false">Pill</button>
+ <button type="button" data-s="circle" aria-pressed="false">Circle</button>
+ </div>
+ <p class="hb-hint">A pill suits a menu bar; a circle works like a lens.</p>
+ </div>
+ <div class="hb-setting">
+ <label class="hb-switch-row"><span>Shows the bend map</span><input class="hb-switch" type="checkbox" role="switch" id="map-tog" autocomplete="off"></label>
+ <p class="hb-hint">The picture that steers the bend: red moves it sideways, green up and down.</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 liquid glass panel to [the card or menu you want to float over a picture]. The panel shows what is behind it bent and magnified near its rounded edges, like thick curved glass, with a soft highlight along the rim. Bend it with an SVG displacement filter applied to what is behind the panel, which Chromium browsers support; other browsers get blurred, tinted glass with the same highlight. Dragging with the pointer or a finger moves it, and so do the arrow keys; it stretches a little as it moves and wobbles back when it stops. Use transforms only, so it stays smooth. If the visitor has reduced motion turned on, let it jump instead of gliding, with no stretch or wobble. 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>Floating menus</li><li>Cards over photos</li><li>Tab bars</li><li>Media controls</li></ul>
+ <h3>Avoid on</h3>
+ <ul class="hb-tags hb-avoid"><li>Long text</li><li>Plain backgrounds</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'),glass=document.getElementById('glass'),mapEl=document.getElementById('lg-map');
+const filt=document.getElementById('lg-filter'),fImg=document.getElementById('lg-img'),fDisp=document.getElementById('lg-disp');
+const slowTog=document.getElementById('slow-tog'),vars=stage.style,reduce=matchMedia('(prefers-reduced-motion:reduce)');
+// Chromium draws an SVG filter in backdrop-filter; Safari and Firefox do not, and CSS.supports() only checks the syntax, so the
+// bend goes to browsers that name Chromium among their brands and the others keep the frosted glass.
+const REFRACT=!!(navigator.userAgentData&&navigator.userAgentData.brands.some(b=>b.brand==='Chromium'))&&CSS.supports('backdrop-filter','url(#lg-filter)');
+stage.classList.toggle('lg-refract',REFRACT);
+const FRAME=1000/60,RUN_MS=3600,EMAX=.12,MAG=.15;
+// Each shape: its width and height as shares of the base width, and its corner radius as a share of its height
+const SHAPES={card:[1,.62,.34],pill:[1.12,.42,.5],circle:[.68,.68,.5]};
+let W=0,H=0,gw=0,gh=0,shape='card',bend=.42,x=0,y=0,run=null,drag=null,target=null,hold=0,holdFrom=null,raf=0,lastT=null,acc=0;
+let lx=0,ly=0,vx=0,vy=0,a=0,b=0,va=0,vb=0; // where the last frame drew the glass, its smoothed speed (px/ms), its stretch (a, b) and its speed
+
+// The bend map, one pixel per CSS pixel of the glass. Red is the sideways shift and green the shift up or down (128: none).
+// Near the rim every pixel reads the picture from further in, most at the very edge (the rim magnifies), and a little
+// everywhere toward the middle (the whole glass magnifies slightly). Outside the rounded corners it stays at 128.
+function drawMap(){
+ const c=document.createElement('canvas');c.width=gw;c.height=gh;
+ const g=c.getContext('2d'),img=g.createImageData(gw,gh),d=img.data,hw=gw/2,hh=gh/2,r=gh*SHAPES[shape][2],B=Math.min(hw,hh)*.7;
+ for(let j=0;j<gh;j++)for(let i=0;i<gw;i++){
+ const X=i+.5-hw,Y=j+.5-hh,qx=Math.abs(X)-hw+r,qy=Math.abs(Y)-hh+r,k=(j*gw+i)*4;
+ let e,nx=0,ny=0; // e: the distance in from the edge; (nx, ny): the way out
+ if(qx>0&&qy>0){const l=Math.hypot(qx,qy);e=r-l;nx=Math.sign(X)*qx/l;ny=Math.sign(Y)*qy/l;}
+ else if(qx>qy){e=r-qx;nx=Math.sign(X);}else{e=r-qy;ny=Math.sign(Y);}
+ const m=e<0?0:(1-Math.min(1,e/B))**2,z=e<0?0:MAG;
+ d[k]=128-127*(nx*m+z*X/hw)/(1+MAG);d[k+1]=128-127*(ny*m+z*Y/hh)/(1+MAG);d[k+2]=128;d[k+3]=255;
+ }
+ g.putImageData(img,0,0);const url=c.toDataURL();fImg.setAttribute('href',url);mapEl.style.backgroundImage='url('+url+')';
+ for(const el of [filt,fImg]){el.setAttribute('width',gw);el.setAttribute('height',gh);}setBend();
+}
+// The filter shifts a pixel by up to half its scale; at the very edge that is the bend times the rim's width
+function setBend(){fDisp.setAttribute('scale',(2*bend*Math.min(gw,gh)*.35*(1+MAG)).toFixed(1));vars.setProperty('--lg-rim',Math.round(bend*70-6)+'px');}
+
+const cx=v=>Math.min(W-gw/2,Math.max(gw/2,v)),cy=v=>Math.min(H-gh/2,Math.max(gh/2,v));
+const home=()=>[cx(W*.56),cy(H*.86-gh/2)]; // its lower edge over the sea, so the rim bends the stripes
+function place(){glass.style.transform=`translate(${(x-gw/2).toFixed(2)}px,${(y-gh/2).toFixed(2)}px) matrix(${(1+a).toFixed(4)},${b.toFixed(4)},${b.toFixed(4)},${(1-a).toFixed(4)},0,0)`;}
+// The glass is a share of the stage's width (150 to 280px wide for a card), never more than 55% of its height. A new size keeps
+// the glass where it was, as a share of the stage, and draws the map again.
+function layout(){
+ const w=stage.clientWidth,h=stage.clientHeight;if(!w||!h)return;
+ const [sw,sh,sr]=SHAPES[shape],base=Math.min(280,Math.max(150,w*.3)),k=Math.min(1,h*.55/(base*sh)),nw=Math.round(base*sw*k),nh=Math.round(base*sh*k);
+ const first=!W;if(W){x*=w/W;y*=h/H;}W=w;H=h;
+ if(nw!==gw||nh!==gh){gw=nw;gh=nh;glass.style.width=gw+'px';glass.style.height=gh+'px';glass.style.borderRadius=Math.round(gh*sr)+'px';drawMap();}
+ if(first)[x,y]=home();lx=x=cx(x);ly=y=cy(y);place();
+}
+
+// One loop, only while something moves. Show me and a glide move the glass in the demo's own time (a third of it in slow motion);
+// the stretch follows its speed through a spring of 1/60 s steps, so it lags, overshoots when the glass stops and wobbles out.
+// The stretch is a squeeze that keeps the area: longer along the motion by a, b (a = e cos 2θ, b = e sin 2θ), shorter across.
+function wake(){if(!raf){lastT=null;lx=x;ly=y;raf=requestAnimationFrame(tick);}}
+function tick(ts){
+ raf=0;const dt=lastT===null?0:Math.min(ts-lastT,50),f=slowTog.checked?1/3:1,ox=lx,oy=ly;lastT=ts;
+ if(run){run.t+=dt*f;const p=along(run);x=cx(p[0]);y=cy(p[1]);if(run.t>=run.end)run=null;}
+ else if(target){const k=1-Math.pow(.8,dt*f/FRAME);x+=(target[0]-x)*k;y+=(target[1]-y)*k;
+ if(Math.abs(target[0]-x)+Math.abs(target[1]-y)<.5){[x,y]=target;target=null;}}
+ if(dt&&!reduce.matches){
+ const s=dt*(drag?1:f),k=1-Math.pow(.7,dt*f/FRAME);
+ vx+=((x-ox)/s-vx)*k;vy+=((y-oy)/s-vy)*k;
+ const sp=Math.hypot(vx,vy),e=Math.min(EMAX,sp*60/gw),ux=sp?vx/sp:0,uy=sp?vy/sp:0,ta=e*(ux*ux-uy*uy),tb=e*2*ux*uy;
+ for(acc+=dt*f;acc>=FRAME;acc-=FRAME){va+=-.08*(a-ta)-.1*va;vb+=-.08*(b-tb)-.1*vb;a+=va;b+=vb;}
+ }
+ const more=run||target||drag||Math.abs(a)+Math.abs(b)+Math.abs(va)+Math.abs(vb)+Math.hypot(vx,vy)>1e-3;
+ if(!more)a=b=va=vb=vx=vy=acc=0;lx=x;ly=y;place();if(more)raf=requestAnimationFrame(tick);
+}
+document.addEventListener('visibilitychange',()=>{lastT=null;});
+// Show me's path: three legs (to the left end, the right end and back), each eased in and out, timed by its length
+function along(r){
+ let t=r.t,i=0;while(i<2&&t>r.legs[i][2]){t-=r.legs[i][2];i++;}
+ const [p,q,d]=r.legs[i],u=Math.min(1,t/d),e=u<.5?4*u*u*u:1-4*(1-u)**3;return [p[0]+(q[0]-p[0])*e,p[1]+(q[1]-p[1])*e];
+}
+
+// Pointer Events cover mouse, touch and pen: the glass follows the pointer from where it was picked up. A tap or click on the
+// picture sends it there. Under reduced motion the glass still follows the pointer, but it never stretches or glides.
+glass.addEventListener('pointerdown',e=>{
+ if(e.button>0)return;run=null;target=null;drag={id:e.pointerId,dx:x-e.clientX,dy:y-e.clientY};
+ try{glass.setPointerCapture(e.pointerId);}catch(_){}glass.classList.add('lg-grab');wake();
+});
+glass.addEventListener('pointermove',e=>{if(drag&&e.pointerId===drag.id){x=cx(e.clientX+drag.dx);y=cy(e.clientY+drag.dy);}});
+const letGo=e=>{if(drag&&e.pointerId===drag.id){drag=null;glass.classList.remove('lg-grab');wake();}};
+['pointerup','pointercancel','lostpointercapture'].forEach(t=>glass.addEventListener(t,letGo));
+function goTo(p){run=null;if(reduce.matches){[x,y]=p;target=null;place();}else{target=p;wake();}}
+stage.addEventListener('click',e=>{if(!glass.contains(e.target)){const r=stage.getBoundingClientRect();goTo([cx(e.clientX-r.left),cy(e.clientY-r.top)]);}});
+// The arrow keys move it a step (three with Shift), and quick presses add up
+glass.addEventListener('keydown',e=>{
+ const k={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!k)return;
+ const s=Math.min(W,H)*(e.shiftKey?.24:.08),from=target||[x,y];e.preventDefault();goTo([cx(from[0]+k[0]*s),cy(from[1]+k[1]*s)]);
+});
+
+// Show me: the glass glides to the left end, across to the right end and back in 3.6 s. Under reduced motion it jumps to the
+// right end, stays 1.2 s and jumps back. A second press starts again from where the first one began.
+function stopHold(){clearTimeout(hold);hold=0;}
+// The visitor pressed, typed, scrolled, touched or tabbed into the stage: a run stops where it is and the glass settles there
+function stopRun(){if(hold)stopHold();if(run){run=null;wake();}}
+document.addEventListener('hb:input',stopRun);stage.addEventListener('focusin',e=>{if(e.isTrusted)stopRun();});
+document.getElementById('btn-demo').addEventListener('click',()=>{
+ if(hold){stopHold();[x,y]=holdFrom;}
+ const p=run?run.legs[2][1]:[x,y],l=[cx(0),cy(H*.4)],r=[cx(W),cy(H*.46)];
+ drag=null;target=null;glass.classList.remove('lg-grab');
+ if(reduce.matches){holdFrom=p;[x,y]=r;place();hold=setTimeout(()=>{hold=0;[x,y]=p;place();},1200);return;}
+ const pts=[[x,y],l,r,p],len=[0,1,2].map(i=>Math.hypot(pts[i+1][0]-pts[i][0],pts[i+1][1]-pts[i][1])),L=len[0]+len[1]+len[2]||1;
+ const legs=[0,1,2].map(i=>[pts[i],pts[i+1],Math.max(1,RUN_MS*len[i]/L)]);
+ run={t:0,legs,end:legs[0][2]+legs[1][2]+legs[2][2]};wake();
+});
+document.getElementById('btn-reset').addEventListener('click',()=>{stopHold();drag=null;glass.classList.remove('lg-grab');goTo(home());});
+
+function choices(id,pick){
+ const buttons=document.querySelectorAll('#'+id+' button');
+ buttons.forEach(btn=>btn.addEventListener('click',()=>{
+ buttons.forEach(o=>{o.classList.toggle('on',o===btn);o.setAttribute('aria-pressed',String(o===btn))});
+ pick(btn.dataset);
+ }));
+}
+choices('bend-seg',d=>{bend=+d.b;setBend();});
+choices('frost-seg',d=>{vars.setProperty('--lg-blur',d.f+'px');vars.setProperty('--lg-fb',d.fb+'px');});
+choices('tint-sw',d=>{vars.setProperty('--lg-tint',d.c);vars.setProperty('--lg-tp',d.p+'%');});
+choices('shape-seg',d=>{shape=d.s;gw=0;layout();});
+document.getElementById('map-tog').addEventListener('change',e=>{mapEl.hidden=!e.target.checked;});
+addEventListener('resize',layout);
+layout();
+</script>
+</body>
+</html>
diff --git a/animations/06-3d-advanced/physics-2d/index.html b/animations/06-3d-advanced/physics-2d/index.html
index 75cc22ac..341aa65d 100644
--- a/animations/06-3d-advanced/physics-2d/index.html
+++ b/animations/06-3d-advanced/physics-2d/index.html
@@ -35,7 +35,7 @@
<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="../ascii-halftone/" rel="prev" aria-label="Previous: ASCII / Halftone"><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>ASCII / Halftone</span></a></span>
+ <span class="hb-pager"><a href="../ascii-halftone/" rel="prev" aria-label="Previous: ASCII / Halftone"><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>ASCII / Halftone</span></a><a href="../liquid-glass/" rel="next" aria-label="Next: Liquid Glass"><span><span class="hb-dir">Next: </span>Liquid Glass</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/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..1d2ad898 100644
--- a/index.html
+++ b/index.html
@@ -4,8 +4,8 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="google-site-verification" content="2PnJemecfPix7j08I3cojuzPTfwKpwxxFMADFxv4wk8">
-<title>Animation Handbook — 158 Web Animation Techniques with Live Demos</title>
-<meta name="description" content="A visual reference of 158 web animation techniques — scroll effects, page transitions, micro-interactions, text animation, 3D, and ambient backgrounds. Every entry is a live, dependency-free demo with an explanation of how it works.">
+<title>Animation Handbook — 159 Web Animation Techniques with Live Demos</title>
+<meta name="description" content="A visual reference of 159 web animation techniques — scroll effects, page transitions, micro-interactions, text animation, 3D, and ambient backgrounds. Every entry is a live, dependency-free demo with an explanation of how it works.">
<meta name="keywords" content="web animation, CSS animation, animation examples, scroll animation, page transitions, micro-interactions, kinetic typography, WebGL, frontend animation reference, motion design, animation handbook">
<meta name="author" content="matinmonshizadeh">
<meta name="robots" content="index, follow, max-image-preview:large">
@@ -18,8 +18,8 @@
<!-- Open Graph -->
<meta property="og:type" content="website">
<meta property="og:site_name" content="Animation Handbook">
-<meta property="og:title" content="Animation Handbook — 158 Web Animation Techniques with Live Demos">
-<meta property="og:description" content="A visual reference of 158 web animation techniques. Every entry is a live, dependency-free demo with an explanation of how it works.">
+<meta property="og:title" content="Animation Handbook — 159 Web Animation Techniques with Live Demos">
+<meta property="og:description" content="A visual reference of 159 web animation techniques. Every entry is a live, dependency-free demo with an explanation of how it works.">
<meta property="og:url" content="https://matinmonshizadeh.github.io/animation-handbook/">
<meta property="og:image" content="https://matinmonshizadeh.github.io/animation-handbook/og-image.png">
<meta property="og:image:width" content="1200">
@@ -27,8 +27,8 @@
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image">
-<meta name="twitter:title" content="Animation Handbook — 158 Web Animation Techniques">
-<meta name="twitter:description" content="A visual reference of 158 web animation techniques. Every entry is a live, dependency-free demo you can open in the browser.">
+<meta name="twitter:title" content="Animation Handbook — 159 Web Animation Techniques">
+<meta name="twitter:description" content="A visual reference of 159 web animation techniques. Every entry is a live, dependency-free demo you can open in the browser.">
<meta name="twitter:image" content="https://matinmonshizadeh.github.io/animation-handbook/og-image.png">
<!-- Structured data: parsed by search + AI answer engines -->
@@ -38,7 +38,7 @@
"@type": "WebSite",
"name": "Animation Handbook",
"url": "https://matinmonshizadeh.github.io/animation-handbook/",
- "description": "A visual reference of 158 web animation techniques, each with a live, dependency-free demo and an explanation of how it works.",
+ "description": "A visual reference of 159 web animation techniques, each with a live, dependency-free demo and an explanation of how it works.",
"inLanguage": "en",
"author": { "@type": "Person", "name": "matinmonshizadeh" },
"about": ["web animation", "CSS animation", "motion design", "frontend development"],
@@ -1039,6 +1039,19 @@ button,input{font:inherit;color:inherit}
@keyframes d-ph2{0%,22%{transform:translateY(-620%);animation-timing-function:cubic-bezier(.5,0,1,.6)}34%{transform:translateY(0);animation-timing-function:cubic-bezier(0,.4,.5,1)}37%{transform:translateY(-22%);animation-timing-function:cubic-bezier(.5,0,1,.6)}40%,100%{transform:translateY(0)}}
@keyframes d-ph3{0%,32%{transform:translateY(-620%);animation-timing-function:cubic-bezier(.5,0,1,.6)}44%{transform:translateY(0);animation-timing-function:cubic-bezier(0,.4,.5,1)}47%{transform:translateY(-22%);animation-timing-function:cubic-bezier(.5,0,1,.6)}50%,100%{transform:translateY(0)}}
@keyframes d-phfade{0%,84%{opacity:1}92%,100%{opacity:0}}
+/* Liquid Glass: a glass card glides over the demo's neon city. Inside it a copy of the scene, scaled up around the card's center
+ and slid back by as much as the card moves, stays lined up with the scene behind, so the card reads as a lens; a rim catches the light */
+.pv-liquidglass{background:radial-gradient(80% 90% at 88% 4%,#3b2c86,transparent 62%),linear-gradient(168deg,#1e1752,#100f36 52%,#0a1b2d);overflow:hidden;container-type:size}
+.pv-liquidglass .sc{position:absolute;left:0;top:0;width:100cqw;height:100cqh}
+.pv-liquidglass .sc b{position:absolute;display:block}
+.pv-liquidglass .sun{right:8cqw;top:9cqh;width:24cqw;aspect-ratio:1;border-radius:50%;background:linear-gradient(#ffd36e,#ff8a5c 55%,#ff5c8a);-webkit-mask:linear-gradient(#000 50%,transparent 0),repeating-linear-gradient(transparent 0 2.5%,#000 0 9%);mask:linear-gradient(#000 50%,transparent 0),repeating-linear-gradient(transparent 0 2.5%,#000 0 9%)}
+.pv-liquidglass .city{left:0;right:0;bottom:30cqh;height:28cqh;background:repeating-linear-gradient(90deg,#b98cff 0 1.5px,transparent 1.5px 6px),linear-gradient(#2c2070,#150f3c);clip-path:polygon(0 100%,0 52%,6% 52%,6% 30%,11% 30%,11% 64%,15% 64%,15% 12%,21% 12%,21% 44%,26% 44%,26% 70%,31% 70%,31% 26%,36% 26%,36% 56%,41% 56%,41% 6%,46% 6%,46% 40%,52% 40%,52% 62%,57% 62%,57% 20%,62% 20%,62% 48%,67% 48%,67% 34%,72% 34%,72% 66%,77% 66%,77% 24%,83% 24%,83% 54%,88% 54%,88% 16%,94% 16%,94% 46%,100% 46%,100% 100%)}
+.pv-liquidglass .sea{left:0;right:0;bottom:0;height:30cqh;background:repeating-linear-gradient(#3fd6c4 0 2px,transparent 2px 7px)}
+.pv-liquidglass .gl{position:absolute;left:31cqw;top:45cqh;width:38cqw;height:38cqh;border-radius:10cqh;overflow:hidden;box-shadow:0 8px 18px rgba(0,0,0,.5);animation:d-lg 6s ease-in-out infinite}
+.pv-liquidglass .gl::after{content:"";position:absolute;inset:0;border-radius:inherit;background:radial-gradient(120% 80% at 25% 0%,rgba(255,255,255,.18),transparent 55%);box-shadow:inset 0 0 0 1px rgba(255,255,255,.28),inset 1.5px 1.5px 0 rgba(255,255,255,.8),inset 0 0 9px rgba(255,255,255,.22)}
+.pv-liquidglass .gl .sc{left:-31cqw;top:-45cqh;transform-origin:50cqw 64cqh;animation:d-lgin 6s ease-in-out infinite}
+@keyframes d-lg{0%,50%,100%{transform:translateX(0)}25%{transform:translateX(25cqw)}75%{transform:translateX(-25cqw)}}
+@keyframes d-lgin{0%,50%,100%{transform:scale(1.22) translateX(0)}25%{transform:scale(1.22) translateX(-25cqw)}75%{transform:scale(1.22) translateX(25cqw)}}
/* ── bespoke: 07 Ambient & Background ── */
.pv-grain2{background:radial-gradient(circle at 50% 40%,#1a1710,#08080a);overflow:hidden}
@@ -1329,7 +1342,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 +1399,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 +1418,7 @@ button,input{font:inherit;color:inherit}
<footer class="wrap foot">
<a class="brand" href="./"><svg class="mark" viewBox="0 0 32 32" aria-hidden="true"><circle class="ring" cx="11.16" cy="20.84" r="6.1"/><circle class="ring" cx="15.12" cy="16.88" r="6.1"/><circle class="ring" cx="18.51" cy="13.49" r="6.1"/><circle class="ball" cx="21.2" cy="10.8" r="6.6"/></svg><span>Animation Handbook</span></a>
- <p class="foot-t">158 web animations with live demos and copyable prompts.</p>
+ <p class="foot-t">159 web animations with live demos and copyable prompts.</p>
<nav class="nav" aria-label="Footer"><a class="lnk" href="https://github.com/matinmonshizadeh/animation-handbook" target="_blank" rel="noopener noreferrer">GitHub</a><a class="lnk" href="#top">Back to top</a></nav>
</footer>
<div class="toast" id="toast" role="status" aria-live="polite"><span class="ok" aria-hidden="true"><svg class="i" viewBox="0 0 24 24"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg></span><span class="toast-t"></span></div>
@@ -1596,6 +1609,7 @@ const CATS=[
['flocking','Flocking','Birds swirl and turn together as one flock. Best for calm backgrounds.'],
['ascii-halftone','ASCII / Halftone','A moving picture is redrawn with letters or dots. Best for retro and tech looks.'],
['physics-2d','2D Physics','Balls drop where you click, bounce and pile up. Best for playful intros.'],
+ ['liquid-glass','Liquid Glass','Drag a glass panel and the picture behind it bends at the edges. Best for cards.'],
]
},
{
@@ -1640,7 +1654,7 @@ const PV={
'rolling-numbers':'rollnum',
'typing-indicator':'typing',
'hold-to-confirm':'holdconf','expanding-search':'xsearch','button-loading-states':'btnload',
- 'flip-card-3d':'flip3d','carousel-3d':'carousel3d','depth-map-photo':'depthmap','flocking':'flock','ascii-halftone':'ascii','physics-2d':'phys2d','matrix-rain':'matrix','plasma':'plasmapv',
+ 'flip-card-3d':'flip3d','carousel-3d':'carousel3d','depth-map-photo':'depthmap','flocking':'flock','ascii-halftone':'ascii','physics-2d':'phys2d','liquid-glass':'liquidglass','matrix-rain':'matrix','plasma':'plasmapv',
'wave-layers':'wavelayers','snow-rain':'snowrain','fireworks':'fireworks',
'topographic-lines':'topo','light-rays':'rays','game-of-life':'life',
'parallax-depth-of-field':'dof','parallax-scrolling':'plx','reverse-scrolling-columns':'revcol',
@@ -1822,6 +1836,7 @@ const PLACES={
'flocking':['bg'],
'ascii-halftone':['imgcard','bg'],
'physics-2d':['intro','bg'],
+ 'liquid-glass':['imgcard','menu'],
// 07
'animated-gradient-background':['bg'],
'mesh-gradient':['bg'],
@@ -1878,6 +1893,7 @@ function pvMarkup(k){
case 'neon': return '<span class="sg"><span class="gl">OPEN</span><span class="lt anim">OPEN</span></span>';
case 'handwrite': return '<span class="pp"><svg viewBox="-34 -90 180 100"><line class="rl" x1="-34" x2="146" y1="0" y2="0"/><path class="w anim" pathLength="1" d="M0 0C3 0 6.9-4 10.6-12C14.8-22 24.7-44 28.3-58C31.4-70 30.7-76 27.7-76C24.7-76 22.4-70 21.1-62C18.1-46 12.5-18 8.5 0C11.6-12 18.9-27 25.6-27.5C31.2-28 30.2-19 27.9-11C25.7-3 27.5 0 31 0C34.5 0 39.8-3.5 44-9C48.2-14.5 50.6-21 46.7-21.5C42.8-22 38-16 37.1-9.5C36-2.5 40.5 0 45 0C48 0 51.9-4 55.6-12C59.8-22 69.7-44 73.3-58C76.4-70 75.7-76 72.7-76C69.7-76 67.4-70 66.1-62C63.1-46 57-16 55.5-7C54.9-2 57 0 60 0C63 0 66.9-4 70.6-12C74.8-22 84.7-44 88.3-58C91.4-70 90.7-76 87.7-76C84.7-76 82.4-70 81.1-62C78.1-46 72-16 70.5-7C69.9-2 72 0 75 0C78 0 83.2-10 89.3-22C92.4-27 95.9-29 98.9-29C100.9-29 102.2-28 102.3-26.5C102.2-28 100.9-29 98.9-29C95.9-29 92.4-27 89.3-22C86.7-17 83.6-5 87.3-1.5C91.2 1.5 97.8-6 99.6-14C100.9-20 101.3-24 100.7-26C103.3-28.5 107.8-28.5 111.9-27"/></svg></span>';
case 'sig6': return '<div class="cube anim"><span class="face f1"></span><span class="face f2"></span><span class="face f3"></span><span class="face f4"></span><span class="face f5"></span><span class="face f6"></span></div>';
+ case 'liquidglass': {const sc=k=>'<span class="sc'+k+'"><b class="sun"></b><b class="city"></b><b class="sea"></b></span>';return sc('')+'<span class="gl anim">'+sc(' anim')+'</span>';}
case 'carousel3d': return '<div class="sc"><div class="tl"><div class="rg anim">'+[0,1,2,3,4,5].map(k=>'<i style="--k:'+k+'"></i>').join('')+'</div></div></div>';
case 'depthmap': return [['sun',-.4],['mt',-.2],['hl',.05],['md',.25],['tr',.45],['gd',.55]].map(([c,k])=>'<i class="'+c+' anim" style="--k:'+k+'"></i>').join('');
case 'flock': return '<span class="fk anim">'+[[0,18,0],[-10,6,-.3],[9,5,-.7],[-20,-5,-1.1],[1,-4,-.5],[17,-8,-.9],[-8,-17,-.2],[10,-20,-1.2],[-1,-29,-.6]].map(function(b){return '<i class="anim" style="--x:'+b[0]+'%;--y:'+b[1]+'%;--d:'+b[2]+'s"></i>';}).join('')+'</span>';
diff --git a/sitemap.xml b/sitemap.xml
index 38230db2..ae055b7d 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -136,6 +136,7 @@
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/flocking/</loc><lastmod>2026-10-01</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/ascii-halftone/</loc><lastmod>2026-10-01</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/physics-2d/</loc><lastmod>2026-10-01</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
+ <url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/liquid-glass/</loc><lastmod>2026-10-01</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/animated-gradient-background/</loc><lastmod>2026-07-14</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/mesh-gradient/</loc><lastmod>2026-07-14</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>
<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/aurora/</loc><lastmod>2026-07-14</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>