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.

docs: bring the Glassmorphism Animated sheet section in line with the fixes

matinc8aa681d7800
diff --git a/docs/superpowers/plans/2026-09-29-3d-content.md b/docs/superpowers/plans/2026-09-29-3d-content.md
index 18a5025d..a650fdaa 100644
--- a/docs/superpowers/plans/2026-09-29-3d-content.md
+++ b/docs/superpowers/plans/2026-09-29-3d-content.md
@@ -530,9 +530,10 @@ None: leave out the `details.hb-options` block.
- **Watch it help line:** default
- **Player bar:** Pause (css) · Slow motion (css)
- **Sequence:** the four blobs run `@keyframes blob-move` forever (over Speed, alternating direction); the Breathing card runs `blur-breath` (4s) and the Shifting card `tint-cycle` (8s). No page timers or frames. The only animations on the stage are these `@keyframes`.
+ - **Speed keeps the picture.** Setting a new `animation-duration` on a running CSS animation moves it to another point of its cycle, so a Speed change made the blobs jump, both while playing and while paused (13 to 71px per blob; 56% of the paused stage's pixels changed). The three negative delays are therefore fractions of the duration: `.b2{animation-delay:calc(var(--blob-spd) * -.375)}`, `.b3` with `-.625` and `.b4` with `-.25` (equal to −3s, −5s and −2s at the default 8s, so the default picture is the same; `.b1` has no delay). The page keeps `let secs=8`, the length in use. The Speed handler, before it sets `--blob-spd`, multiplies the clock of each blob's animation by the new length divided by the old one, then stores the new length: `const next=parseFloat(d.spd);document.querySelectorAll('.blob').forEach(el=>el.getAnimations().forEach(a=>{if(a.currentTime!=null)a.currentTime=a.currentTime*next/secs}));secs=next;`. Only the blobs are scaled, not `stage.getAnimations`, because `blur-breath` and `tint-cycle` have fixed lengths. Scaling the clocks while keeping fixed delays does not work (a blob whose scaled time falls below zero still jumps). Measured: 0px jump and no scale change over six Speed changes while playing (also with Slow motion on), 0 changed pixels over six changes while paused, the reduced-motion still picture unchanged; the blobs drift over 13s, 8s and 5s.
- **Slow motion:** css
-- **Reduced motion:** the demo's rule `.blob,.glass-card.g2,.glass-card.g3{animation:none!important}` goes, because it would stop Play. The loop starts paused, showing the blobs and cards still.
-- **Stage font:** site font. `.card-title` gets `font-weight:700`; `.card-tag` gets 11px and `font-weight:600` (was 9px); `.card-body` gets 13px and `rgba(255,255,255,.72)` (was 10px at .6).
+- **Reduced motion:** the demo's rule `.blob,.glass-card.g2,.glass-card.g3{animation:none!important}` goes, because it would stop Play. The loop starts paused, showing the blobs and cards still (a Speed change keeps that picture).
+- **Stage font:** site font. `.card-title` gets `font-weight:700`; `.card-tag` gets 11px, `font-weight:600` and `rgba(255,255,255,.88)` (was 9px at .5); `.card-body` gets 13px and `rgba(255,255,255,.92)` (was 10px at .6). The Ambient card colours (tag .5, body .72) were too pale over the bright blobs; see the dark layer below.
- **Stage:**
- The four blobs and the three cards stay. The code badges at the foot of the cards go (the pages show no code). Card text, as eyebrow / title / line:
- "Still" / "Fixed frost" / "The blur stays the same." (was "Static" / "Fixed Frost" / "Constant blur at the configured intensity. The baseline glass effect.")
@@ -540,8 +541,10 @@ None: leave out the `details.hb-options` block.
- "Shifting" / "Shifting tint" / "The tint keeps changing." (was "Tint Cycle" / "Frost color rotates through the palette over 8 seconds.")
- **Phones:** today the cards wrap into one column, and the 300px stage would show only the first. Under `@media(max-width:600px)` the stage becomes a grid of three equal columns, and the cards share one row at one height: `.stage{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-content:center;align-items:stretch;gap:8px;padding:12px}` (the blobs are absolutely positioned, so they stay out of the grid), `.glass-card{width:auto;min-width:0;min-height:0;padding:12px 8px;border-radius:12px;gap:6px}`, `.card-title` 13px, `.card-tag` 10px with 1px letter spacing, and `.card-body` 12px with `line-height:1.4`. Measured with the site font: three 100×137px cards on a 375px phone and three 82×137px cards on a 320px phone, all text inside.
- On computers and tablets the cards stay in one row as today (180×200px on computers, 145×200px on a tablet).
+ - **A dark layer under the text (owner decision: readable card text).** Over the bright blobs the text sat at 1.7:1 on phones and 2.9:1 on computers (worst text and moment, 10th percentile of each text box, measured against what is really behind the words with the text hidden, at 16 moments of the 8s cycle). Each card gets a see-through dark layer inside it, under its text: `.glass-card::before{content:"";position:absolute;inset:0;border-radius:inherit;background:rgba(6,8,14,.54);z-index:-1}`. The card's `z-index:1` makes it a stacking context, so the layer sits above the card's tint and the blurred backdrop and below its text; `tint-cycle` still animates the card's own background. The title stays `#fff`, the tag is `rgba(255,255,255,.88)` and the body `rgba(255,255,255,.92)`. Measured the same way (worst text and moment, 10th percentile), on computers (1280) / a 375px phone / a 320px phone: at least 9.5 / 5.9 / 5.8:1 with the default settings; 9.0 / 5.6 / 5.6:1 with Frost Off; 8.0 / 5.2 / 5.1:1 with Strong tint strength and the White tint color (the brightest glass the settings can make); 7.6 / 5.0 / 5.0:1 with that and Frost Off (the dots sharp behind the words). A tablet (768) and a sideways phone (812×375) read at least 8.4:1 by default and 6.7:1 with Strong tint strength, the White tint color and Frost Off; a laptop (1366×657) reads at least 9.0:1 by default. Every median is 5.1:1 or more. (The first values tried, .45 for the layer with the tag at .75 and the body at .85, gave 4.0:1 on phones at the brightest.)
+ - **A faint pattern behind the glass (owner decision: make Frost visible).** Frost Light, Medium and Heavy looked the same: the backdrop is already a 60px blur (36px on phones) of soft blobs, so the glass blur had nothing left to soften. `.stage::after` paints soft white dots between the colors and the cards: `.stage::after{content:"";position:absolute;inset:0;--dots:rgba(255,255,255,.28);--dot-r:16px;--dot-pitch:56px;--fade:68%;background:radial-gradient(circle,var(--dots) 0 var(--dot-r),transparent calc(var(--dot-r) + 2px)) 0 0/var(--dot-pitch) var(--dot-pitch);-webkit-mask-image:radial-gradient(ellipse closest-side,#000 var(--fade),transparent);mask-image:radial-gradient(ellipse closest-side,#000 var(--fade),transparent)}`, and under the phone block `.stage::after{--dots:rgba(255,255,255,.42);--dot-r:20px;--dot-pitch:64px;-webkit-mask-image:linear-gradient(transparent,#000 28%,#000 72%,transparent);mask-image:linear-gradient(transparent,#000 28%,#000 72%,transparent)}` (bigger, stronger dots, because the bright phone backdrop hides white; the mask keeps them behind the row of cards). It comes after the blobs in tree order and the cards have `z-index:1`, so it sits above the blobs and below the cards; it is static (it adds no animation to the stage) and fades out toward the edges, so most of the stage still reads as soft color. Measured with the text hidden (mean of four moments, luminance levels between the middle of a dot and the gap between dots, inside the two cards that follow Frost): on computers Off 24.7, Light 24.9, Medium 14.0, Heavy 1.5; on a 375px phone 16.9, 17.0, 13.4, 4.3. Changed pixels inside those two cards, before → after, over 8 / over 4 levels of a channel: Light vs Heavy on computers 2.2% → 20.8% / 8.7% → 71.5%, on the phone 25.2% → 37.8% / 66.0% → 74.6%; Light vs Medium on computers 0.0% → 8.4% / 0.9% → 32.5%, on the phone 0.7% → 6.6% / 13.2% → 37.3%; Medium vs Heavy on computers 0.3% → 1.6% / 4.1% → 21.5%, on the phone 4.2% → 4.6% / 39.6% → 34.3% (the phone's earlier differences were smooth color shifts that the dark layer now dims; the dots replace them). The middle card breathes on its own, so only Off changes it.
- `hb-dots`: no. Default height.
-- **Phone fallback:** today's stays: the blobs blur 36px on phones instead of 60px. The glass blur only covers the three small cards.
+- **Phone fallback:** today's stays: the blobs blur 36px on phones instead of 60px. The glass blur only covers the three small cards. The dot pattern is one static layer: on the throttled phone (375×812 at pixel ratio 2, CPU ×4, headless Chrome drawing in software) the page draws 181 or 182 frames in 3 s (a full 60 fps is 180) with none or one dropped, as before, also with Heavy frost and with Frost Off.
**Main settings**
@@ -549,7 +552,7 @@ None: leave out the `details.hb-options` block.
|---|---|---|---|---|---|
| Frost | Choice buttons | Off · Light · Medium · Heavy | Medium | How strongly the glass blurs what is behind it. | Off: the stage gets `no-bf` (no blur on any card); Light · Medium · Heavy: `--blur` 6px / 12px / 20px and `no-bf` removed |
| Tint strength | Choice buttons | Faint · Medium · Strong | Medium | How much color the glass adds. | `--glass-op`: 0.06 / 0.12 / 0.25 |
-| Speed | Choice buttons | Slow · Normal · Fast | Normal | How fast the colors drift behind the glass. | `--blob-spd`: 13s / 8s / 5s |
+| Speed | Choice buttons | Slow · Normal · Fast | Normal | How fast the colors drift behind the glass. | the blobs' clocks rescaled (see Sequence), then `--blob-spd`: 13s / 8s / 5s |
**More options**
@@ -569,7 +572,7 @@ None: leave out the `details.hb-options` block.
- **Good for:** Cards and panels · Dashboards · Modals · Navigation bars · **Avoid on:** Plain backgrounds · Large surfaces
- **Prompt:**
- > Add frosted glass to [the cards or panels you want to style]. Give each card a see-through tinted background, blur whatever sits behind it, and add a thin light edge, so it looks like frosted glass. Put colorful shapes that drift slowly behind the cards, because glass over a plain background just looks grey. A card can also breathe, its blur growing and fading, or slowly change its tint. Blurring what is behind costs a lot, so keep the glass to small cards and blur the background shapes less on phones. If the visitor has reduced motion turned on, keep everything still. Match the settings listed below.
+ > Add frosted glass to [the cards or panels you want to style]. Give each card a see-through tinted background, blur whatever sits behind it, and add a thin light edge. Put colorful shapes that drift slowly behind the cards, with a faint pattern of dots over them, because glass over plain color looks grey and shows no frost. Put a see-through dark layer inside each card under its text so the words stay readable. A card can also breathe, its blur growing and fading, or slowly change its tint. Blurring costs a lot, so keep the glass to small cards and blur the shapes less on phones. If the visitor has reduced motion turned on, keep everything still. Match the settings listed below.
- **README What it is:** rewritten:
@@ -590,8 +593,8 @@ None: leave out the `details.hb-options` block.
- [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
-- **README How it works:** unchanged
-- **README Production notes:** the "Disable for performance audit" bullet becomes: "**Compare with the blur off**: the demo's Frost setting has an Off choice. If the page is noticeably faster without the blur, reconsider the design." The rest is unchanged.
+- **README How it works:** unchanged, plus two paragraphs after the blob keyframes, each with a code block: "**A pattern behind the glass** makes the frost visible. Colors that are already a soft blur leave the glass nothing to soften, so Light, Medium and Heavy frost would look alike. The demo puts a faint pattern of white dots between the colors and the cards. Each card blurs the dots behind it: Off leaves them sharp, Light softens them and Heavy smears them almost away. The pattern fades out toward the edges of the stage, so most of the stage still reads as soft color:" (the `.stage::after` rule with the computer values, without the variables) and "**A dark layer under the text** keeps the words readable. Bright colors pass behind the glass, and white text over them can fall well under the 4.5:1 contrast that small text needs. Each card has a see-through dark layer that sits above the tint and the blurred backdrop and below the text (the card's `z-index` gives the layer's `z-index: -1` a place inside the card):" (the `.glass-card::before` rule).
+- **README Production notes:** the "Disable for performance audit" bullet becomes: "**Compare with the blur off**: the demo's Frost setting has an Off choice. If the page is noticeably faster without the blur, reconsider the design." Three bullets are added: after "The backdrop must have content", "**Frost needs detail behind it to show**: a blur of soft color changes little as the amount grows, so a Frost setting can look as if it does nothing. Put something with edges behind the glass, such as a pattern, shapes or an image, as the demo does with its dots." and "**Keep the text readable**: measure the contrast of the text against what is really behind it, at several moments of the animation, not against the tint. The demo darkens the glass under the text with a see-through layer, so every text stays at 4.5:1 or better, even over the brightest colors."; after "Dark mode", "**Changing the length of a running animation**: a new `animation-duration` puts a running CSS animation at a different point of its cycle, so it jumps. The demo makes its negative delays fractions of the duration and multiplies each blob's `currentTime` by the new length divided by the old one, so a change of Speed keeps every blob where it is." The rest is unchanged.
- **Category line:** `06.06 · 3D & Advanced`
- **Pager:** Previous: Fluid / Liquid Simulation (`../fluid-simulation/`) · Next: WebGL Shader Animation (`../webgl-shader-animation/`)