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 focus ring's box starts above the island, so its clip needs no negative inset or shadow

matinbfab91ed4501
diff --git a/animations/04-micro-interactions/dynamic-island/index.html b/animations/04-micro-interactions/dynamic-island/index.html
index 1c55f300..358e1980 100644
--- a/animations/04-micro-interactions/dynamic-island/index.html
+++ b/animations/04-micro-interactions/dynamic-island/index.html
@@ -42,8 +42,8 @@
.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))}
+ /* Focus: an outline would be clipped away, so a ring layer 3px larger than the shape sits behind it (its box starts 3px higher) */
+ .ring{top:-3px;opacity:0;background:var(--ui-accent);clip-path:inset(0 calc(50% - var(--hw) - 3px) calc(100% - var(--h) - 6px) 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}