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.

fix: Dynamic Island (04.41): the date fades under the music card on screens up to 309px, and How it works says so

matinc6d70f942e3b
diff --git a/animations/04-micro-interactions/dynamic-island/README.md b/animations/04-micro-interactions/dynamic-island/README.md
index 6e1ad700..514931a7 100644
--- a/animations/04-micro-interactions/dynamic-island/README.md
+++ b/animations/04-micro-interactions/dynamic-island/README.md
@@ -60,7 +60,7 @@ function spring(z) {
}
```
-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). The button is the whole box, so its own outline would not follow the shape: the focus ring is a second clipped layer 3px larger than the shape, behind it. In forced-colors mode the phone keeps its own colors, and so does the ring: a system color such as the highlight is dark in light themes and would vanish against the dark phone, while the ring's own orange stands out against it in every theme. The outline stays, transparent, as a fallback where the ring cannot keep its color. 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. A card only changes while the shape is fully faded: picking another notification fades the open card (or one still fading out after a close) out, puts the new content and size in place while it is hidden, and fades it in again. The picked notification is kept at once, so a press that calls such a switch off halfway still opens the picked card next time, and the focus ring is a hollow outline there, so nothing of it shows through a fading card.
+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). The button is the whole box, so its own outline would not follow the shape: the focus ring is a second clipped layer 3px larger than the shape, behind it. In forced-colors mode the phone keeps its own colors, and so does the ring: a system color such as the highlight is dark in light themes and would vanish against the dark phone, while the ring's own orange stands out against it in every theme. The outline stays, transparent, as a fallback where the ring cannot keep its color. While a card is open the status bar fades out; on a short screen, where the lock-screen date sits under the open music card, the date fades out too (a size container query on the screen), so the card's edge never cuts through it. 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. A card only changes while the shape is fully faded: picking another notification fades the open card (or one still fading out after a close) out, puts the new content and size in place while it is hidden, and fades it in again. The picked notification is kept at once, so a press that calls such a switch off halfway still opens the picked card next time, and the focus ring is a hollow outline there, so nothing of it shows through a fading card.
## Key parameters
| Parameter | Default | Effect |
diff --git a/animations/04-micro-interactions/dynamic-island/index.html b/animations/04-micro-interactions/dynamic-island/index.html
index b498de25..92eb3a05 100644
--- a/animations/04-micro-interactions/dynamic-island/index.html
+++ b/animations/04-micro-interactions/dynamic-island/index.html
@@ -34,7 +34,7 @@
/* Date and clock (--clk tall) move up on a short stage: the clock's line box ends at the stage's edge (40px before the screen's end),
its digits about 10px above it. The open music card would cut the date there, so on a short screen the date fades out under it. */
.date,.clock{--clk:clamp(50px,19cqw,80px);position:absolute;left:0;right:0;text-align:center}.date{top:min(188px,calc(100% - 58px - var(--clk)));font-size:15px;font-weight:600;color:rgba(255,255,255,.88);transition:opacity .2s}
- .clock{top:min(206px,calc(100% - 40px - var(--clk)));font-size:var(--clk);font-weight:700;line-height:1;letter-spacing:-.02em}@container (max-height:305px){.isl.open[data-n=music]~.date{opacity:0}}
+ .clock{top:min(206px,calc(100% - 40px - var(--clk)));font-size:var(--clk);font-weight:700;line-height:1;letter-spacing:-.02em}@container (max-height:309px){.isl.open[data-n=music]~.date{opacity:0}}
/* The island: a box the size of the largest card plus room for a bounce. Only its black shape shows, clipped, with the cards' content
inside it, so the clip cuts the content too. The script sets --hw, --h and --r (half width, height, corner radius) for each shape */
.isl{--hw:48px;--h:32px;--r:16px;--dur:700ms;--ease:cubic-bezier(.3,1.4,.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;