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: the Dynamic Island and Liquid Glass previews clear their place label

matin94dd4dfd8bbb
diff --git a/index.html b/index.html
index 523b3623..9abc0303 100644
--- a/index.html
+++ b/index.html
@@ -895,13 +895,15 @@ button,input{font:inherit;color:inherit}
@keyframes gy-pl{0%,10%{transform:rotate(0)}28%,70%{transform:rotate(135deg)}86%,100%{transform:rotate(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)}
+ starts low, clear of the place label: --top never goes above the label's foot, which sits lower on a small card's bigger label */
+.pv-dynisland{--top:max(29cqh,36px);background:radial-gradient(50% 70% at 50% 40%,rgba(124,92,255,.18),transparent),#08090c;overflow:hidden;container-type:size}
+@media(max-width:700px){.pv-dynisland{--top:max(29cqh,34px)}}
+@media(max-width:600px){.pv-dynisland{--top:max(29cqh,26px)}}
+.pv-dynisland .ph{position:absolute;left:25cqw;right:25cqw;top:var(--top);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 .is{position:absolute;left:28cqw;top:calc(var(--top) + 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)}
@@ -1116,11 +1118,15 @@ button,input{font:inherit;color:inherit}
@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 */
+ 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.
+ On a small card the sun starts right of the place label (--sl, the label's right end), a little smaller and nearer the edge */
.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%)}
+@media(max-width:700px){.pv-liquidglass .sun{--sl:113px;right:auto;left:max(68cqw,var(--sl));width:min(24cqw,calc(95cqw - var(--sl)))}}
+@media(max-width:600px){.pv-liquidglass .sun{--sl:105px}}
+@media(max-width:360px){.pv-liquidglass .sun{--sl:94px}}
.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}