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.
HTML ai-promptsanimationcss-animationsfrontendgithub-pagesjavascriptmicrointeractionsmotion-designno-dependenciesreferencescroll-animationui-animationweb-animationweb-developmentwebgl
feat: Wave Layers (07.18)
matine282b1a1379d
diff --git a/README.md b/README.mdindex 60328023..1941016c 100644--- a/README.md+++ b/README.md@@ -237,6 +237,7 @@ All 129 techniques, each linked to its live demo.- **[Synthwave Grid](animations/07-ambient-background/synthwave-grid/)** — A glowing grid rolls toward you under a striped sun. Best for music and games.- **[Matrix Rain](animations/07-ambient-background/matrix-rain/)** — Columns of glowing characters rain down a dark screen. Best for tech themes.- **[Plasma Field](animations/07-ambient-background/plasma/)** — Smooth waves of color flow endlessly, made from math. Best for creative sites.+- **[Wave Layers](animations/07-ambient-background/wave-layers/)** — Layers of waves drift sideways, each at its own speed. Best for hero sections and footers.</details>diff --git a/animations/07-ambient-background/README.md b/animations/07-ambient-background/README.mdindex 61006e59..600b968d 100644--- a/animations/07-ambient-background/README.md+++ b/animations/07-ambient-background/README.md@@ -23,6 +23,7 @@ Passive, looping effects that hold visual interest without demanding attention.| [Synthwave Grid](synthwave-grid/) | A glowing grid rolls toward you under a striped sun. Best for music and games. || [Matrix Rain](matrix-rain/) | Columns of glowing characters rain down a dark screen. Best for tech themes. || [Plasma Field](plasma/) | Smooth waves of color flow endlessly, made from math. Best for creative sites. |+| [Wave Layers](wave-layers/) | Layers of waves drift sideways, each at its own speed. Best for hero sections and footers. |## The ambient mindsetdiff --git a/animations/07-ambient-background/plasma/index.html b/animations/07-ambient-background/plasma/index.htmlindex 32661d35..77d873ed 100644--- a/animations/07-ambient-background/plasma/index.html+++ b/animations/07-ambient-background/plasma/index.html@@ -32,7 +32,7 @@<body class="hb" data-hb-kind="loop"><nav class="hb-bar" aria-label="Animation Handbook"><a class="hb-home" href="../../../"><svg class="hb-mark" viewBox="0 0 32 32" aria-hidden="true"><g class="g"><circle cx="11.16" cy="20.84" r="6.1"/><circle cx="15.12" cy="16.88" r="6.1"/><circle cx="18.51" cy="13.49" r="6.1"/></g><circle class="b" cx="21.2" cy="10.8" r="6.6"/></svg><span>Animation Handbook</span></a>- <span class="hb-pager"><a href="../matrix-rain/" rel="prev" aria-label="Previous: Matrix Rain"><svg class="hb-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg><span><span class="hb-dir">Previous: </span>Matrix Rain</span></a></span>+ <span class="hb-pager"><a href="../matrix-rain/" rel="prev" aria-label="Previous: Matrix Rain"><svg class="hb-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg><span><span class="hb-dir">Previous: </span>Matrix Rain</span></a><a href="../wave-layers/" rel="next" aria-label="Next: Wave Layers"><span><span class="hb-dir">Next: </span>Wave Layers</span><svg class="hb-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></a></span></nav><main class="hb-page"><header class="hb-head">diff --git a/animations/07-ambient-background/wave-layers/README.md b/animations/07-ambient-background/wave-layers/README.mdnew file mode 100644index 00000000..2d570130--- /dev/null+++ b/animations/07-ambient-background/wave-layers/README.md@@ -0,0 +1,64 @@+# Wave Layers++## What it is+Wave layers stack a few strips of water, one in front of the other, each with a wavy top edge. Every strip slides sideways on its own endless loop, and the near strips sit lower, move faster and have bigger waves than the far ones, so a handful of flat shapes reads as deep water. The browser moves it all with no script.++## When to use it+- The bottom edge of a hero section, where the waves lead into the page below+- Footers and section dividers on travel, beach, sailing and outdoor sites+- Calm intros for wellness, meditation or holiday pages+- Empty or waiting states that need a quiet sign of life++## How it works+Each layer holds a track twice as wide as the stage. The top of the track is an SVG wave and a plain block of the same color fills the rest. One path serves every layer: it draws ten whole waves, and each layer's `viewBox` shows only the first ten, eight, six or four of them, stretched across its track by `preserveAspectRatio="none"`. Far layers therefore get small, close waves and near layers long ones.++```html+<svg class="defs"><defs><path id="wv" d="M0 0C18 0 32 40 50 40S82 0 100 0 … S982 0 1000 0V40H0Z"/></defs></svg>++<div class="wave w1"><div class="track">+ <svg viewBox="0 0 1000 40" preserveAspectRatio="none"><use href="#wv"/></svg><i></i>+</div></div>+<!-- w2, w3 and w4 show 800, 600 and 400 units of the same path -->+```++Every track holds an even number of waves, so after sliding left by half its width it looks exactly as it did at the start, and the jump back to the start cannot be seen. The stage is a size container (`container-type: size`), so heights are written in `cqh`, hundredths of the stage's height. Each layer has its own height on the stage (`--y`), wave size (`--k`), cycle (`--s`) and head start (`--o`); the cycles and head starts are shares of one `--dur`:++```css+.track { width: 200%; animation: drift calc(var(--dur) * var(--s)) linear calc(var(--dur) * var(--s) * var(--o)) infinite; }+.track svg { width: 100%; height: calc(var(--amp) * var(--k)); fill: var(--fill); }+.wave { top: calc(var(--y) - var(--amp) * var(--k) / 2); bottom: -12cqh;+ animation: bob calc(var(--dur) * var(--s) / 4) ease-in-out calc(var(--dur) * var(--s) * var(--o)) infinite alternate; }+.w1 { --y: 42%; --k: .5; --s: 1.7; --o: -.15; } /* far: high, small waves, slow */+.w4 { --y: 80%; --k: 1; --s: .9; --o: -.8; } /* near: low, big waves, fast */+@keyframes drift { to { transform: translateX(-50%); } }+@keyframes bob { from { transform: translateY(-1.2cqh); } to { transform: translateY(1.2cqh); } }+```++A new speed changes `--dur`, which would make every layer jump to another point of its cycle. Scaling each animation's time by the same factor first keeps every wave where it is, moving or paused:++```js+stage.getAnimations({ subtree: true }).forEach(a => { if (a.currentTime != null) a.currentTime = a.currentTime * next / secs; });+stage.style.setProperty('--dur', next + 's');+```++The palettes keep one rule: 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.++## Key parameters+| Parameter | Default | Effect |+|-----------|---------|--------|+| Speed | Normal | The base cycle: slow is 40 seconds, normal 24 and fast 14; the layers take 1.7, 1.35, 1.1 and 0.9 times that, far to near, to slide one stage width |+| Colors | Ocean | Ocean blues, Sunset pinks and purples under an orange glow, or Night indigo; far layers are the palest, near ones the darkest |+| Wave height | Medium | How tall the nearest waves are: low is 6%, medium 11% and high 17% of the stage's height; the farther layers get a half to four fifths of that |+| Number of layers | 4 | Two, three or four layers; with fewer, the far layers go first and the near waves always stay |++## Production notes+- **Only transforms move**: the tracks slide with `translateX` and the layers bob with `translateY`, which the browser hands to the compositor, so nothing is repainted while it runs, even on phones. Animating the path's shape or a `background-position` would repaint every frame.+- **Seams**: the block under each wave starts one pixel higher (`margin-top: -1px`), so no hairline shows between it and the SVG at any zoom level.+- **Mask variant**: the same strips can be single elements with a solid background and a repeated wave `mask-image`; the mask then sets the wave length (`mask-size`) without any SVG markup.+- **Reduced motion**: the demo holds the waves still where they are. In your own page, a `prefers-reduced-motion: reduce` rule that sets `animation: none` on the tracks does the same.+- **Libraries**: GSAP can loop each track with `gsap.to(track, { xPercent: -50, duration, ease: 'none', repeat: -1 })`, and Framer Motion with `animate={{ x: '-50%' }}` and `transition={{ repeat: Infinity, ease: 'linear', duration }}`; both only replace the keyframes.++## See also+- [Aurora / Northern Lights](../aurora/) — soft bands of light that sway instead of slide+- [Parallax Scrolling](../../01-scroll-based/parallax-scrolling/) — the same near-fast, far-slow rule, driven by scroll+- [Marquee / Ticker](../../05-text-typography/marquee-ticker/) — the same seamless half-width loop, with textdiff --git a/animations/07-ambient-background/wave-layers/index.html b/animations/07-ambient-background/wave-layers/index.htmlnew file mode 100644index 00000000..306ae230--- /dev/null+++ b/animations/07-ambient-background/wave-layers/index.html@@ -0,0 +1,206 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>Wave Layers — Animation Handbook</title>+ <meta name="description" content="Layers of waves drift sideways, each at its own speed. Best for hero sections and footers.">+ <link rel="canonical" href="https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/wave-layers/">+ <link rel="icon" type="image/png" sizes="96x96" href="../../../favicon.png">+ <link rel="icon" type="image/svg+xml" href="../../../favicon.svg">+ <link rel="apple-touch-icon" href="../../../apple-touch-icon.png">+ <meta property="og:type" content="article">+ <meta property="og:site_name" content="Animation Handbook">+ <meta property="og:title" content="Wave Layers — Animation Handbook">+ <meta property="og:description" content="Layers of waves drift sideways, each at its own speed. Best for hero sections and footers.">+ <meta property="og:url" content="https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/wave-layers/">+ <meta property="og:image" content="https://matinmonshizadeh.github.io/animation-handbook/og-image.png">+ <meta name="twitter:card" content="summary_large_image">+ <meta name="twitter:title" content="Wave Layers — Animation Handbook">+ <meta name="twitter:description" content="Layers of waves drift sideways, each at its own speed. Best for hero sections and footers.">+ <meta name="twitter:image" content="https://matinmonshizadeh.github.io/animation-handbook/og-image.png">+ <script type="application/ld+json">{"@context": "https://schema.org", "@type": "TechArticle", "headline": "Wave Layers", "name": "Wave Layers", "description": "Layers of waves drift sideways, each at its own speed. Best for hero sections and footers.", "url": "https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/wave-layers/", "inLanguage": "en", "articleSection": "Ambient & Background", "isPartOf": {"@type": "WebSite", "name": "Animation Handbook", "url": "https://matinmonshizadeh.github.io/animation-handbook/"}, "author": {"@type": "Person", "name": "matinmonshizadeh"}, "keywords": "web animation, CSS animation, Ambient & Background, Wave Layers"}</script>+ <style>+ :root{--ui-accent:#ffce5a}+ *,*::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 */+ .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%)}+ .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}+ /* 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;+ animation:bob calc(var(--dur)*var(--s)/4) ease-in-out calc(var(--dur)*var(--s)*var(--o)) infinite alternate}+ .track{display:flex;flex-direction:column;width:200%;height:100%;+ animation:drift calc(var(--dur)*var(--s)) linear calc(var(--dur)*var(--s)*var(--o)) infinite}+ .track svg{display:block;flex:none;width:100%;height:calc(var(--amp)*var(--k));fill:var(--fill)}+ .track i{flex:1;margin-top:-1px;background:var(--fill)}+ /* Far layers sit higher, with smaller waves and a slower cycle; near layers are lower, bigger and faster */+ .w1{--y:42%;--k:.5;--s:1.7;--o:-.15;--fill:var(--c1)}+ .w2{--y:54%;--k:.65;--s:1.35;--o:-.6;--fill:var(--c2)}+ .w3{--y:66%;--k:.8;--s:1.1;--o:-.35;--fill:var(--c3)}+ .w4{--y:80%;--k:1;--s:.9;--o:-.8;--fill:var(--c4)}+ @keyframes drift{to{transform:translateX(-50%)}}+ @keyframes bob{from{transform:translateY(-1.2cqh)}to{transform:translateY(1.2cqh)}}+ </style>+ <link rel="stylesheet" href="../../../assets/css/demo-page.css?v=6">+ <script src="../../../assets/js/demo-page.js?v=6" defer></script>+</head>+<body class="hb" data-hb-kind="loop">+<nav class="hb-bar" aria-label="Animation Handbook">+ <a class="hb-home" href="../../../"><svg class="hb-mark" viewBox="0 0 32 32" aria-hidden="true"><g class="g"><circle cx="11.16" cy="20.84" r="6.1"/><circle cx="15.12" cy="16.88" r="6.1"/><circle cx="18.51" cy="13.49" r="6.1"/></g><circle class="b" cx="21.2" cy="10.8" r="6.6"/></svg><span>Animation Handbook</span></a>+ <span class="hb-pager"><a href="../plasma/" rel="prev" aria-label="Previous: Plasma Field"><svg class="hb-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg><span><span class="hb-dir">Previous: </span>Plasma Field</span></a></span>+</nav>+<main class="hb-page">+ <header class="hb-head">+ <p class="hb-cat">07.18 · Ambient & Background</p>+ <h1>Wave Layers</h1>+ <p class="hb-lede">Layers of waves drift sideways, each at its own speed. Best for hero sections and footers.</p>+ </header>++ <section class="hb-step hb-watch" aria-labelledby="hb-watch-title">+ <div class="hb-step-head">+ <span class="hb-num" aria-hidden="true">1</span>+ <div><h2 id="hb-watch-title">Watch it</h2><p>It moves by itself. Pause it to look closely, or turn on slow motion to see each part of the movement.</p></div>+ </div>+ <div class="stage">+ <!-- One path of ten whole waves; each layer's viewBox shows the first ten, eight, six or four of them -->+ <svg class="defs" aria-hidden="true"><defs><path id="wv" d="M0 0C18 0 32 40 50 40S82 0 100 0S132 40 150 40S182 0 200 0S232 40 250 40S282 0 300 0S332 40 350 40S382 0 400 0S432 40 450 40S482 0 500 0S532 40 550 40S582 0 600 0S632 40 650 40S682 0 700 0S732 40 750 40S782 0 800 0S832 40 850 40S882 0 900 0S932 40 950 40S982 0 1000 0V40H0Z"/></defs></svg>+ <div class="hero">+ <p class="hero-eyebrow">Wave layers</p>+ <p class="hero-title">Near waves move faster than far ones</p>+ </div>+ <div class="wave w1" aria-hidden="true"><div class="track"><svg viewBox="0 0 1000 40" preserveAspectRatio="none"><use href="#wv"/></svg><i></i></div></div>+ <div class="wave w2" aria-hidden="true"><div class="track"><svg viewBox="0 0 800 40" preserveAspectRatio="none"><use href="#wv"/></svg><i></i></div></div>+ <div class="wave w3" aria-hidden="true"><div class="track"><svg viewBox="0 0 600 40" preserveAspectRatio="none"><use href="#wv"/></svg><i></i></div></div>+ <div class="wave w4" aria-hidden="true"><div class="track"><svg viewBox="0 0 400 40" preserveAspectRatio="none"><use href="#wv"/></svg><i></i></div></div>+ </div>+ <div class="hb-player">+ <button class="hb-play" type="button" id="btn-pause" data-hb-pause="css" data-state="playing"><svg class="hb-ic hb-i-pause" viewBox="0 0 24 24" aria-hidden="true"><rect x="6" y="4" width="4" height="16" rx="1"/><rect x="14" y="4" width="4" height="16" rx="1"/></svg><svg class="hb-ic hb-i-play" viewBox="0 0 24 24" aria-hidden="true"><path d="M6 3l14 9-14 9z"/></svg><span class="hb-pause-label">Pause</span></button>+ <label class="hb-toggle"><input class="hb-switch" type="checkbox" role="switch" id="slow-tog" data-hb-slowmo="css" autocomplete="off"><span>Slow motion</span></label>+ </div>+ </section>++ <section class="hb-step hb-try" aria-labelledby="hb-try-title">+ <div class="hb-step-head">+ <span class="hb-num" aria-hidden="true">2</span>+ <div><h2 id="hb-try-title">Try it</h2><p>Change a setting and see the difference as it moves.</p></div>+ </div>+ <div class="hb-settings">+ <div class="hb-setting">+ <p class="hb-setting-name" id="speed-lbl">Speed</p>+ <div class="seg" id="speed-seg" role="group" aria-labelledby="speed-lbl">+ <button type="button" data-secs="40" aria-pressed="false">Slow</button>+ <button type="button" data-secs="24" class="on" aria-pressed="true">Normal</button>+ <button type="button" data-secs="14" aria-pressed="false">Fast</button>+ </div>+ <p class="hb-hint">Slow feels like a calm sea.</p>+ </div>+ <div class="hb-setting">+ <p class="hb-setting-name" id="pal-lbl">Colors</p>+ <div class="seg" id="pal-seg" role="group" aria-labelledby="pal-lbl">+ <button type="button" data-pal="ocean" class="on" aria-pressed="true">Ocean</button>+ <button type="button" data-pal="sunset" aria-pressed="false">Sunset</button>+ <button type="button" data-pal="night" aria-pressed="false">Night</button>+ </div>+ <p class="hb-hint">Far layers are the palest, near ones the darkest.</p>+ </div>+ <div class="hb-setting">+ <p class="hb-setting-name" id="amp-lbl">Wave height</p>+ <div class="seg" id="amp-seg" role="group" aria-labelledby="amp-lbl">+ <button type="button" data-amp="6cqh" aria-pressed="false">Low</button>+ <button type="button" data-amp="11cqh" class="on" aria-pressed="true">Medium</button>+ <button type="button" data-amp="17cqh" aria-pressed="false">High</button>+ </div>+ <p class="hb-hint">High waves look like rough water.</p>+ </div>+ </div>+ <details class="hb-options">+ <summary><span class="hb-more-label">More options</span><span class="hb-less">Fewer options</span><svg class="hb-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg></summary>+ <div class="hb-settings">+ <div class="hb-setting">+ <p class="hb-setting-name" id="count-lbl">Number of layers</p>+ <div class="seg" id="count-seg" role="group" aria-labelledby="count-lbl">+ <button type="button" data-n="2" aria-pressed="false">2</button>+ <button type="button" data-n="3" aria-pressed="false">3</button>+ <button type="button" data-n="4" class="on" aria-pressed="true">4</button>+ </div>+ <p class="hb-hint">More layers give more depth; the far ones go first.</p>+ </div>+ </div>+ </details>+ </section>++ <section class="hb-step hb-prompt-step" aria-labelledby="hb-prompt-title">+ <div class="hb-step-head">+ <span class="hb-num" aria-hidden="true">3</span>+ <div><h2 id="hb-prompt-title">Copy the prompt</h2><p>Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.</p></div>+ </div>+ <div class="hb-card">+ <p class="hb-prompt">Add layered waves to [the bottom of the section you want them in]. Stack a few strips of water, each one twice as wide as the section with the same wave shape repeated along its top edge: far strips sit higher, paler and with smaller waves, near strips lower, darker and with bigger ones. Slide every strip sideways by half its width, over and over, so the repeated shape hides the restart, and give near strips a quicker pace than far ones so the water feels deep. Move the strips only by shifting them, which keeps it smooth on phones. If the visitor has reduced motion turned on, keep the waves still. Match the settings listed below.</p>+ <div class="hb-chips-box" hidden>+ <p class="hb-chips-title">Your settings</p>+ <ul class="hb-chips"></ul>+ </div>+ <div class="hb-copy-row">+ <button class="hb-copy" type="button"><svg class="hb-ic hb-i-copy" viewBox="0 0 24 24" aria-hidden="true"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg><svg class="hb-ic hb-i-done" viewBox="0 0 24 24" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg><span class="hb-copy-label" aria-live="polite">Copy prompt</span></button>+ <p class="hb-hint">Replace the words in brackets with your own element. Your settings are added at the end.</p>+ </div>+ </div>+ </section>++ <section class="hb-about" aria-labelledby="hb-what-title">+ <div class="hb-what">+ <h2 id="hb-what-title">What it is</h2>+ <div class="hb-what-text"><p>The full explanation is in <a href="README.md">README.md</a>.</p></div>+ </div>+ <div class="hb-fit">+ <h2>Good for</h2>+ <ul class="hb-tags hb-good"><li>Hero sections</li><li>Page footers</li><li>Section dividers</li><li>Travel and beach sites</li></ul>+ <h3>Avoid on</h3>+ <ul class="hb-tags hb-avoid"><li>Dense dashboards</li><li>Long reading pages</li></ul>+ </div>+ </section>++ <section class="hb-related" aria-labelledby="hb-related-title" hidden>+ <h2 id="hb-related-title">Similar animations</h2>+ <div class="hb-rel-list"></div>+ </section>+</main>+<footer class="hb-foot"><span>Animation Handbook</span><a href="#top">Back to top ↑</a></footer>+<script>+ const stage=document.querySelector('.stage');+ const waves=[...document.querySelectorAll('.wave')];+ let secs=24;++ function choices(id,pick){+ const buttons=document.querySelectorAll('#'+id+' button');+ buttons.forEach(b=>b.addEventListener('click',()=>{+ if(b.classList.contains('on'))return; // pressing the choice already made does nothing+ buttons.forEach(x=>{x.classList.toggle('on',x===b);x.setAttribute('aria-pressed',String(x===b))});+ pick(b.dataset);+ }));+ }+ // A new --dur keeps the time already played, so every layer would jump to another point of its cycle. Scaling each+ // animation's time by the same factor as its cycle (and its head start, which follows --dur) keeps it where it is.+ choices('speed-seg',d=>{+ const next=+d.secs;+ stage.getAnimations({subtree:true}).forEach(a=>{if(a.currentTime!=null)a.currentTime=a.currentTime*next/secs});+ secs=next;+ stage.style.setProperty('--dur',next+'s');+ });+ choices('pal-seg',d=>{stage.dataset.pal=d.pal});+ choices('amp-seg',d=>{stage.style.setProperty('--amp',d.amp)});+ // Fewer layers hide the far ones first, so the near waves at the bottom always stay+ choices('count-seg',d=>{waves.forEach((w,i)=>{w.hidden=i<waves.length-d.n})});+</script>+</body>+</html>diff --git a/index.html b/index.htmlindex e2d7eb15..e9b0c8ea 100644--- a/index.html+++ b/index.html@@ -816,6 +816,16 @@ button,input{font:inherit;color:inherit}.pv-aripple .src b:nth-child(2){animation-delay:1.3s}.pv-aripple .src b:nth-child(3){animation-delay:2.6s}.pv-aripple .s2 b{animation-duration:4.6s}@keyframes d-arip{0%{transform:translate(-50%,-50%) scale(1);opacity:.8}100%{transform:translate(-50%,-50%) scale(9);opacity:0}}+/* Wave Layers: three tracks twice the stage's width, each a wave edge over a block of its color, slide left by half their width,+ the near ones faster; the colors are the demo's Ocean palette, darker toward the front against a glowing horizon */+.pv-wavelayers{background:linear-gradient(#040b16 22%,#3f8fb5 46%);overflow:hidden;container-type:size}+.pv-wavelayers .wl{position:absolute;left:0;width:200%;bottom:-4cqh;display:flex;flex-direction:column;animation:d-wl 13s linear infinite}+.pv-wavelayers .wl svg{display:block;flex:none;width:100%;fill:currentColor}+.pv-wavelayers .wl i{flex:1;margin-top:-1px;background:currentColor}+.pv-wavelayers .l1{top:42cqh;color:#1f6386}.pv-wavelayers .l1 svg{height:7cqh}+.pv-wavelayers .l2{top:56cqh;color:#123f5a;animation-duration:9.5s;animation-delay:-4s}.pv-wavelayers .l2 svg{height:10cqh}+.pv-wavelayers .l3{top:71cqh;color:#08263b;animation-duration:7s;animation-delay:-2s}.pv-wavelayers .l3 svg{height:13cqh}+@keyframes d-wl{to{transform:translateX(-50%)}}/* ── bespoke: added demos ── */.pv-magnet{background:#08090c;display:grid;place-items:center;position:relative}@@ -1007,7 +1017,7 @@ button,input{font:inherit;color:inherit}<section class="wrap home-hero" aria-labelledby="hero-title"><span class="float fl1" aria-hidden="true"></span><span class="float fl2" aria-hidden="true"></span><span class="float fl3" aria-hidden="true"></span><span class="float fl4" aria-hidden="true"></span><span class="float fl5" aria-hidden="true"></span><span class="float fl6" aria-hidden="true"></span>- <p class="pill"><span class="pill-dot" aria-hidden="true"></span>129 free animations · no coding needed</p>+ <p class="pill"><span class="pill-dot" aria-hidden="true"></span>130 free animations · no coding needed</p><h1 class="h1" id="hero-title">What do you want to animate?</h1><p class="sub">Pick a place, or describe it in your own words. Every animation plays live, and each one comes with a ready-made prompt for your AI assistant.</p><form class="search" id="search-form" role="search" action="./" method="get">@@ -1064,8 +1074,8 @@ button,input{font:inherit;color:inherit}<p class="empty-s">Try a simpler word, or pick one of these:</p><p class="pop"><button type="button" data-q="fade in">fade in</button><button type="button" data-q="typing text">typing text</button><button type="button" data-q="loading spinner">loading spinner</button><button type="button" data-q="parallax">parallax</button><button type="button" data-q="confetti">confetti</button></p></div>- <div class="more" id="more"><button type="button" class="bigbtn" id="more-btn"><span id="more-label">Browse all 129 animations</span><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M6 13l6 6 6-6"/></svg></button></div>- <noscript><p class="noscript">This page shows its animations with JavaScript. All 129 are still easy to reach: see the <a href="https://github.com/matinmonshizadeh/animation-handbook#categories">category list on GitHub</a> or the <a href="sitemap.xml">full sitemap</a>. Each demo is a page of its own under <code>/animations/<category>/<name>/</code>.</p></noscript>+ <div class="more" id="more"><button type="button" class="bigbtn" id="more-btn"><span id="more-label">Browse all 130 animations</span><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M6 13l6 6 6-6"/></svg></button></div>+ <noscript><p class="noscript">This page shows its animations with JavaScript. All 130 are still easy to reach: see the <a href="https://github.com/matinmonshizadeh/animation-handbook#categories">category list on GitHub</a> or the <a href="sitemap.xml">full sitemap</a>. Each demo is a page of its own under <code>/animations/<category>/<name>/</code>.</p></noscript></section><section class="how" id="how" aria-labelledby="how-title">@@ -1083,7 +1093,7 @@ button,input{font:inherit;color:inherit}<footer class="wrap foot"><a class="brand" href="./"><svg class="mark" viewBox="0 0 32 32" aria-hidden="true"><circle class="ring" cx="11.16" cy="20.84" r="6.1"/><circle class="ring" cx="15.12" cy="16.88" r="6.1"/><circle class="ring" cx="18.51" cy="13.49" r="6.1"/><circle class="ball" cx="21.2" cy="10.8" r="6.6"/></svg><span>Animation Handbook</span></a>- <p class="foot-t">129 web animations with live demos and copyable prompts.</p>+ <p class="foot-t">130 web animations with live demos and copyable prompts.</p><nav class="nav" aria-label="Footer"><a class="lnk" href="https://github.com/matinmonshizadeh/animation-handbook" target="_blank" rel="noopener noreferrer">GitHub</a><a class="lnk" href="#top">Back to top</a></nav></footer><div class="toast" id="toast" role="status" aria-live="polite"><span class="ok" aria-hidden="true"><svg class="i" viewBox="0 0 24 24"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg></span><span class="toast-t"></span></div>@@ -1275,6 +1285,7 @@ const CATS=[['synthwave-grid','Synthwave Grid','A glowing grid rolls toward you under a striped sun. Best for music and games.'],['matrix-rain','Matrix Rain','Columns of glowing characters rain down a dark screen. Best for tech themes.'],['plasma','Plasma Field','Smooth waves of color flow endlessly, made from math. Best for creative sites.'],+ ['wave-layers','Wave Layers','Layers of waves drift sideways, each at its own speed. Best for hero sections and footers.'],]}];@@ -1285,6 +1296,7 @@ const PV={'hamburger-menu-toggle':'hamb','theme-toggle-morph':'thememorph','copy-to-clipboard':'copyfx','star-rating':'stars','toast-notification':'toast','segmented-control':'segct','pull-to-refresh':'pullref','flip-card-3d':'flip3d','matrix-rain':'matrix','plasma':'plasmapv',+ 'wave-layers':'wavelayers','parallax-depth-of-field':'dof','parallax-scrolling':'plx','reverse-scrolling-columns':'revcol','cover-card-to-fixed-header':'cover','fly-in-fly-out-contact-list':'flylist','stacking-cards':'stack','scroll-trigger':'trigger','scrub-animation':'scrub','pin-animation':'pin','snap-scrolling':'snap',@@ -1456,7 +1468,8 @@ const PLACES={'flow-field':['bg'],'synthwave-grid':['bg'],'matrix-rain':['bg'],- 'plasma':['bg']+ 'plasma':['bg'],+ 'wave-layers':['bg','intro']};// The eight cards of "Good places to start", in this order.const PICKS=['click-ripple','typewriter-effect','flip-card-3d','aurora','hamburger-menu-toggle','loading-spinner','parallax-scrolling','slide-up-reveal'];@@ -1470,6 +1483,8 @@ function pvMarkup(k){case 'sig5': return '<span class="s5 anim"></span><span class="s5 anim"></span><span class="s5 anim"></span>';case 'sig6': return '<div class="cube anim"><span class="face f1"></span><span class="face f2"></span><span class="face f3"></span><span class="face f4"></span><span class="face f5"></span><span class="face f6"></span></div>';case 'sig7': return '<span class="s7 anim"></span>';+ case 'wavelayers': {let d='M0 0C18 0 32 40 50 40';for(let s=1;s<16;s++)d+='S'+(s*50+32)+(s%2?' 0 ':' 40 ')+(s*50+50)+(s%2?' 0':' 40');+ return [800,600,400].map((w,k)=>'<span class="wl l'+(k+1)+' anim"><svg viewBox="0 0 '+w+' 40" preserveAspectRatio="none"><path d="'+d+'V40H0Z"/></svg><i></i></span>').join('');}case 'aurora': return '<span class="band b1 anim"></span><span class="band b2 anim"></span><span class="band b3 anim"></span>';case 'mesh': return '<span class="m m1 anim"></span><span class="m m2 anim"></span><span class="m m3 anim"></span>';case 'glow': return '<span class="core anim"></span><span class="ring anim"></span>';diff --git a/sitemap.xml b/sitemap.xmlindex 23cc35d9..3607264b 100644--- a/sitemap.xml+++ b/sitemap.xml@@ -130,4 +130,5 @@<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/synthwave-grid/</loc><lastmod>2026-07-14</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url><url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/matrix-rain/</loc><lastmod>2026-07-14</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url><url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/plasma/</loc><lastmod>2026-07-14</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>+ <url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/07-ambient-background/wave-layers/</loc><lastmod>2026-10-01</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url></urlset>