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: Wave Layers: the sky starts under the stage border, so no light line shows along its top, and the stage title wraps in balanced lines

matinc16165bc5fe3
diff --git a/animations/07-ambient-background/wave-layers/index.html b/animations/07-ambient-background/wave-layers/index.html
index 6c578310..489e5b25 100644
--- a/animations/07-ambient-background/wave-layers/index.html
+++ b/animations/07-ambient-background/wave-layers/index.html
@@ -25,16 +25,17 @@
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
/* A size container, so the waves are measured in cqh: hundredths of the stage's height */
/* The sky glows lightest at the horizon and every layer is darker than that glow, the near ones darkest, so each
- layer stands out against the one behind it and against the sky, however many are shown */
+ layer stands out against the one behind it and against the sky, however many are shown. The sky starts under the
+ stage's see-through border, so the border shows its dark top, not a repeat of its light bottom. */
.stage{position:relative;overflow:hidden;container-type:size;--dur:24s;--amp:11cqh;
--sky1:#040b16;--sky2:#3f8fb5;--c1:#1f6386;--c2:#164d6c;--c3:#0f3a54;--c4:#08263b;
- background:linear-gradient(var(--sky1) 20%,var(--sky2) 44%)}
+ background:linear-gradient(var(--sky1) 20%,var(--sky2) 44%);background-origin:border-box}
.stage[data-pal="sunset"]{--sky1:#1a0b2e;--sky2:#f08a5d;--c1:#c04a5e;--c2:#8e2f5a;--c3:#5c1f4f;--c4:#2f1238}
.stage[data-pal="night"]{--sky1:#03040b;--sky2:#43539c;--c1:#2a376f;--c2:#1f2856;--c3:#161c3e;--c4:#0d1129}
.defs{position:absolute;width:0;height:0}
.hero{position:absolute;top:clamp(14px,7cqh,36px);left:0;right:0;z-index:2;padding:0 16px;text-align:center}
.hero-eyebrow{font-size:11px;font-weight:600;letter-spacing:2px;text-transform:uppercase;color:rgba(255,255,255,.72);margin-bottom:6px}
- .hero-title{font-size:clamp(16px,2.4vw,24px);font-weight:700;line-height:1.25;color:#fff}
+ .hero-title{font-size:clamp(16px,2.4vw,24px);font-weight:700;line-height:1.25;color:#fff;text-wrap:balance}
/* A layer bobs gently up and down; its track, twice the stage's width, slides left by half its width and starts over.
Both cycles and the head start (--o, a share of the cycle) follow --dur, so a new speed can keep every wave in place. */
.wave{position:absolute;left:0;right:0;top:calc(var(--y) - var(--amp)*var(--k)/2);bottom:-12cqh;