# Ripple Effect

A headline sits inside a glowing spectral ring that ripples and sends out faint echoes. The ring contracts, then concentric rings expand from the centre and each one reveals the next scene, landing on the product.

- Position in a launch film: Transitions
- Slug: ripple-effect
- Preview video: https://media.motionboard.app/ripple.mp4
- Recipe page: https://motionboard.app/recipes/ripple-effect/
- License: MIT. Free to use in your own projects, including commercial launch films. https://github.com/krisyangdev/motionboard/blob/main/LICENSE

## How to use this recipe

You are a coding agent. The user wants this shot for their own product. Follow these steps.

1. **Know the product.** If the product is clear from the user's repo or conversation, ask nothing and start. Otherwise ask once for: product name, logo file, brand colors.
2. **Pick the output.** If the user's message says a video or their website, do that. Otherwise ask once which one they want.
   - **Video (HyperFrames).** Create a folder named `ripple`. Download every file under "Source files" below with the curl commands, keeping relative paths. Adapt `index.html` (see "What to adapt"). Run `npx --yes hyperframes@0.8.209 check` on the untouched copy first and note its result. Preview with `npx --yes hyperframes@0.8.209 preview`, render an MP4 with `npx --yes hyperframes@0.8.209 render` (into `renders/`, named with a timestamp). The same commands are in `package.json` as `dev`, `check`, `render`; pass flags after `--`, as in `npm run render -- --quality draft`. Rendering needs network access for web fonts and GSAP.
   - **Website motion.** Port the GSAP timeline in `index.html` into the user's site, using their stack (React, Vue, Svelte, plain HTML). Build the same DOM structure, keep the timeline's durations, delays and easings exactly, and start it when the element scrolls into view (IntersectionObserver or ScrollTrigger). Respect `prefers-reduced-motion: reduce`: show the final frame as a static state and skip the movement.
3. **What to adapt.**
   - **Brand layer** (product name, logo, colors, fonts, copy): replace directly with the user's.
   - **UI layer** (the product screens, cards, windows, controls shown in the shot): rebuild the user's real UI as clean DOM, from their codebase (components, design tokens) or from a screenshot used as reference only. Never paste a screenshot into the shot.
   - **Motion** (timing, easing, camera moves, layering, stagger, order of events): keep exactly as in the source. This is what the recipe is.
   - The timeline targets UI elements by id and class, and camera moves land on fixed coordinates. Keep the ids the timeline uses, keep row counts and text lengths close to the source, and when the layout moves, update the target coordinates without changing the times.
4. **Fonts.** HyperFrames fetches Google Fonts such as Inter on its own. Some sources use macOS local fonts (PingFang, Songti via `local()`). Use the user's brand font when it can be bundled; for a system font such as SF Pro, use Inter. Check that text still fits its boxes.
5. **Verify.** Compare the render with the preview video above at the beat times in the Timing row. The beats, timing and camera should match; only brand and UI content differ.

## Spec

| Item | Value |
| --- | --- |
| Timing | Film 10s. The ring grows to full size over 0.1–1.7s (1.6s); the two headline lines blur in at 0.5s and 0.64s (1.1s each) with a 10px red/blue split that closes by 1.55s; echo rings are born at 0.9, 1.7, 2.5, 3.3 and 4.1s and each lives 2.8s; fringe and wobble swell 3.9–4.6s; the ring contracts 5.5% over 4.4–4.7s; five reveal rings open from 4.7s, 0.14s apart, 2.0s each; the case lands at 4.75s (1.8s) and the earbuds at 4.8s and 4.9s (1.9s); the spec line rises at 5.55s (0.9s) and fades at 7.2s (0.5s); the product recedes 7.3–8.3s; lockup mark 7.55s, wordmark 7.65s, tagline 7.95s; a highlight sweeps 8.9–9.9s and the lockup holds to the end |
| Easing | Ring growth, reveal rings, headline and product landing expo.out (1 − 2^(−10p)); echo rings cubic.out; the contraction before the reveal power3.in; float and the slow headline scale sine.inOut; product push-in sine.out; product recede and wordmark highlight power2.inOut |
| Camera | Locked frame, no camera move. The headline block scales 1→1.03x over 0.8–4.7s (sine.inOut); inside the five reveal rings the product scene starts magnified 1.30, 1.24, 1.18, 1.12 and 1.06x and eases to 1x as its ring opens, while a black veil of 55%, 45%, 35%, 25% and 15% clears with it; the product group pushes in 1→1.05x over 4.7–9.9s |
| Subject | Main ring base radius 380px with four strokes 26/11/5/2.2px wide. Its colour is a conic gradient of 24 stops whose hue runs twice around the ring (saturation 82%, lightness 62–78%), starting at 205° − 38°/s × time and rotating at 0.55 rad/s. The edge wobbles with three sines of 5, 8 and 13 lobes (weights 1, 0.6, 0.35) at an amplitude of 3.2–5.6px. Echo rings grow from 402px to 732px radius (1.7px line, plus a 1.1px companion at +7px); three thin rings sit inside at R−18, R−36 and R−62; 220 radial ticks outside have length = energy × (3 + 34n²), with energy 0.3 plus 0.95 during 3.9–4.6s. The reveal rings are five clip-path circles centred at (960, 540), each holding a full copy of the product scene, radius 1320 × (1 − 2^(−10p)); every edge gets a 38px soft band, four strokes of 30/13/5.5/2.4px and thin lines at r+11 and r−9. Product scene: dark radial backdrop, two 230x414px white earbuds (left 701px, right 989px, tilted ∓8°, with a silver head, grey ear tip, mic ports and a blue edge light) and a 400x276px rounded case (left 760px, top 590px) with a lid seam, an LED and an engraved ring |
| Sync | Each echo is born with a 7px outward push on the main ring that decays as exp(−5·age); fringe energy, wobble and brightness peak together at 4.6s, 0.1s before the first reveal ring opens and after the ring has contracted; the first reveal ring covers the headline within 0.1s; the case and earbuds land while the rings open, so the product is already settling when it is revealed; the spec line rises as the last ring nears the frame edge (about 5.8s); the lockup mark starts drawing as the product recedes |
| Style | Base `#09090b`, accent `#8fb4ff` (case light and spec dots); the spectral rings are the only other colour. Inter throughout: headline 88px 700, spec line 26px 500, footnote 16px 400, wordmark 150px 700, tagline 36px 500; elliptical vignette (85% × 78%), no grain |

## Why it works

The headline sits in a spectral ring that swells and sends out a few fading echoes, so by the time the line is read the eye is already held by a circular rhythm. For the reveal the same circle becomes a window: five rings open from the centre one after another, each holding a full copy of the next scene, outer rings first and inner rings after. The product inside each ring starts magnified and eases back to size, so the cut reads as travelling down a tunnel onto the product. The circles share the centre of the title ring, so the ring contracts (4.4–4.7s) and the first circle bursts open from the same point, and no hard cut is needed. The ring's hue runs twice around it and is the only colour on the #09090b backdrop; the product scene uses only white forms and one #8fb4ff light, so the frame returns to a restrained dark after the reveal. The earbuds and case begin landing while the rings open and are nearly settled when the last ring leaves (about 5.8s), and the spec line rises after that.

## Prompt

> Build a 10-second, 1920x1080, 30 fps dark product film called Ripple Effect for a fictional product, Hush (noise-cancelling earbuds). Base colour #09090b, accent #8fb4ff, font Inter. One onUpdate driven by the timeline redraws two canvases and sets the radii of five clip-paths; text and product use GSAP tweens. No random numbers, no CSS animation.
>
> Part 1, the title ring (0–4.7s): a glowing spectral ring centred at (960, 540) with a base radius of 380px, drawn on canvas with the lighter composite mode. It is four strokes (26/11/5/2.2px wide, faint to strong) whose colour is a 24-stop conic gradient (createConicGradient) with the hue running twice around the ring (saturation 82%, lightness 62–78%, hue start 205° − 38°/s × time, gradient rotating at 0.55 rad/s). From 0.1 to 1.7s the ring grows from 0.6x to 1x with expo.out. The edge radius is R + amplitude × (sin(5θ − 2.3t) + 0.6·sin(8θ + 1.7t) + 0.35·sin(13θ − 3.1t)), amplitude 3.2–5.6px. Add three thin rings inside (R−18, R−36, R−62) and 220 radial ticks outside, length = energy × (3 + 34n²) with energy about 0.3. Echo rings are born at 0.9, 1.7, 2.5, 3.3 and 4.1s, live 2.8s, grow from 402px to 732px radius with cubic.out, fade out and are 1.7px wide. Each birth pushes the main ring out 7px, decaying as exp(−5·age), so the ring seems to swell with the echoes. Inside the ring sits the headline Silence, / tuned to you. (88px, weight 700, letter-spacing −0.035em, line-height 1.08): the two lines start at 0.5s and 0.64s and take 1.1s with expo.out from 14px blur and 22px below, while a CSS variable drives a 10px red/blue split that closes over 1.0s from 0.55s. A 16px lab-test footnote fades in at the bottom left from 1.4s. From 3.9 to 4.6s the energy rises by 0.95 and the wobble grows, and from 4.4 to 4.7s the ring contracts 5.5% (power3.in).
>
> Part 2, the reveal (4.7–6.4s): five circular clip-paths centred at (960, 540); circle k starts at 4.7 + 0.14k seconds with radius = 1320 × (1 − 2^(−10p)), p being progress over 2.0s. Each circle holds a full copy of the same product scene (one function builds all five); circle 0 is at the bottom and circle 4 on top, so outer rings leave first and inner rings follow. The copies start magnified 1.30, 1.24, 1.18, 1.12 and 1.06x and ease back to 1x with their ring, and a black veil of 55%, 45%, 35%, 25% and 15% clears with them, which gives the tunnel look. Draw each circle's edge on the upper canvas: a 38px soft band, four spectral strokes 30/13/5.5/2.4px wide, and thin lines at r+11 and r−9; the edge fades once the radius passes 1000px.
>
> Product scene: a dark radial backdrop (#23262f to #09090b) with a faint blue glow. Two 230x414px white earbuds in SVG (silver-white head, grey ear tip with a mesh, mic ports, a blue edge light): the left one at left 701px, top 140px, the right one at left 989px, top 150px, mirrored, tilted ∓8°, both with a drop shadow. A 400x276px white rounded case (left 760px, top 590px) with a lid seam, a blue LED and a soft shadow. The case rises from 150px below at 0.88x over 1.8s with expo.out starting at 4.75s; the earbuds start at 4.8s and 4.9s, rise from 230 and 250px below and rotate from ±26° to ±8° over 1.9s. The product group pushes in to 1.05x over 4.7–9.9s, and from 6.7s everything floats 12–14px (sine.inOut). From 5.55s a 26px spec line sits under the product, Hush · 45 dB adaptive noise cancelling · 9 h, or 36 h with the case, rising over 0.9s and fading at 7.2s.
>
> Ending (7.3–10s): from 7.3s the product group takes 1.0s to drop to 16% opacity, 0.94x and 5px blur. At 7.55s a 124px mark (two spectral thin rings and a white centre dot) draws on and rotates, at 7.65s the wordmark Hush (Inter 700, 150px) rises out of blur, at 7.95s the tagline Noise cancelling, tuned to you. (36px) rises, and from 8.9 to 9.9s a spectral highlight sweeps across the wordmark; from 7.5 to 9.9s one more faint echo ring leaves the frame centre. Add a vignette, no grain.

## Often confused with

- [Iris Transition](https://motionboard.app/r/iris-transition.md): Iris Transition keeps a fixed round window that jumps in size with the beat and cuts images inside it; here concentric rings open one after another from the centre, each edge is a spectral stroke and a mask, and the move happens once.
- [Glass Droplet Split](https://motionboard.app/r/glass-droplet-split.md): Glass Droplet Split stretches a glass form until it breaks; Ripple Effect has no solid object, only a ring that swells, echoes that fade and circular masks that open outward.

## Source files

Runnable HyperFrames project, 3 files.

- https://motionboard.app/source/ripple/hyperframes.json (318 B)
- https://motionboard.app/source/ripple/index.html (25.2 KB)
- https://motionboard.app/source/ripple/package.json (295 B)

Download all of them:

```sh
curl -fsSL --create-dirs -o "ripple/hyperframes.json" "https://motionboard.app/source/ripple/hyperframes.json"
curl -fsSL --create-dirs -o "ripple/index.html" "https://motionboard.app/source/ripple/index.html"
curl -fsSL --create-dirs -o "ripple/package.json" "https://motionboard.app/source/ripple/package.json"
```

## index.html

```html
<!doctype html>
<html lang="en" data-resolution="landscape">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=1920, height=1080" />
    <script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
    <style>
      :root {
        --base: #09090b;
        --accent: #8fb4ff;
        --ink: #f4f6fa;
        --font-ui: "Inter", -apple-system, "SF Pro Display", "Helvetica Neue", sans-serif;
      }
      * { margin: 0; padding: 0; box-sizing: border-box; }
      html, body { width: 1920px; height: 1080px; overflow: hidden; background: var(--base); }
      #root { position: relative; width: 1920px; height: 1080px; overflow: hidden; background: var(--base); font-family: var(--font-ui); color: var(--ink); -webkit-font-smoothing: antialiased; }
      .full { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }

      /* ---------- title scene ---------- */
      #titleScene { z-index: 1; }
      .tbg { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; background: radial-gradient(ellipse 60% 70% at 50% 50%, #0f1015 0%, #09090b 70%); }
      .ttext {
        position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
        font-weight: 700; font-size: 88px; line-height: 1.08; letter-spacing: -0.035em; color: var(--ink); --sp: 0;
        text-shadow: calc(var(--sp) * -1px) 0 0 rgba(255, 70, 110, calc(var(--sp) * 0.07)), calc(var(--sp) * 1px) 0 0 rgba(70, 150, 255, calc(var(--sp) * 0.07));
      }
      .ttext span { display: block; }
      .foot { position: absolute; left: 80px; bottom: 54px; font-size: 16px; font-weight: 400; letter-spacing: 0.01em; color: rgba(236, 240, 248, 0.36); opacity: 0; }

      /* ---------- reveal discs ---------- */
      #discs { z-index: 2; }
      .dsc { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; overflow: hidden; clip-path: circle(0px at 960px 540px); }
      .veil { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; background: #09090b; opacity: 0; }
      #edges { z-index: 3; }

      /* ---------- product scene ---------- */
      .psc { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 960px 540px; }
      .pbg { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; background: radial-gradient(ellipse 62% 70% at 50% 44%, #23262f 0%, #13151a 52%, #09090b 100%); }
      .pglow { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; background: radial-gradient(circle 520px at 50% 46%, rgba(143, 180, 255, 0.16) 0%, rgba(143, 180, 255, 0) 100%); }
      .pz { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 960px 540px; }
      .pf { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 960px 540px; }
      .eb { position: absolute; width: 230px; height: 414px; filter: drop-shadow(0 30px 36px rgba(0, 0, 0, 0.6)); }
      .eb svg { display: block; }
      .eb.flip svg { transform: scaleX(-1); }
      .bA { left: 701px; top: 140px; }
      .bB { left: 989px; top: 150px; }
      .cs { position: absolute; left: 760px; top: 590px; width: 400px; height: 276px; }
      .cs svg { display: block; }
      .spec { position: absolute; left: 0; top: 916px; width: 1920px; text-align: center; font-size: 26px; font-weight: 500; letter-spacing: 0.02em; color: rgba(214, 222, 236, 0.78); opacity: 0; }
      .spec b { font-weight: 650; color: #f4f6fa; }
      .spec i { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); margin: 0 18px; vertical-align: middle; }

      /* ---------- lockup ---------- */
      #lockup { z-index: 4; }
      .lk { position: absolute; left: 0; top: 395px; width: 1920px; height: 160px; display: flex; align-items: center; justify-content: center; gap: 34px; }
      .mark { width: 124px; height: 124px; }
      .mark svg { display: block; }
      .wm {
        font-weight: 700; font-size: 150px; line-height: 1; letter-spacing: -0.045em; padding-right: 0.04em; color: transparent;
        background: linear-gradient(100deg, #f5f7fb 0%, #f5f7fb 40%, #bcd0ff 46%, #ffd0e6 52%, #f5f7fb 58%, #f5f7fb 100%); background-size: 300% 100%; background-position: 100% 0;
        -webkit-background-clip: text; background-clip: text;
      }
      .tag { position: absolute; left: 0; top: 590px; width: 1920px; text-align: center; font-size: 36px; font-weight: 500; letter-spacing: -0.005em; color: rgba(222, 228, 240, 0.78); opacity: 0; }

      #vig { z-index: 5; background: radial-gradient(ellipse 85% 78% at 50% 50%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.55) 100%); pointer-events: none; }
    </style>
  </head>
  <body>
    <div id="root" data-composition-id="main" data-start="0" data-duration="10" data-width="1920" data-height="1080">
      <div id="titleScene" class="clip full" data-start="0" data-duration="10" data-track-index="0" data-layout-allow-overlap data-layout-allow-occlusion>
        <div class="tbg"></div>
        <canvas id="cvA" class="full" width="1920" height="1080"></canvas>
        <div class="ttext" id="ttext"><span id="l1">Silence,</span><span id="l2">tuned to you.</span></div>
        <div class="foot" id="foot">Noise cancellation measured in lab tests, 2026, against leading in-ear earbuds.</div>
      </div>

      <div id="discs" class="clip full" data-start="0" data-duration="10" data-track-index="1" data-layout-allow-overlap data-layout-allow-occlusion></div>

      <div id="edges" class="clip full" data-start="0" data-duration="10" data-track-index="2" data-layout-allow-overlap data-layout-allow-occlusion>
        <canvas id="cvB" class="full" width="1920" height="1080"></canvas>
      </div>

      <div id="lockup" class="clip full" data-start="0" data-duration="10" data-track-index="3" data-layout-allow-overlap data-layout-allow-occlusion>
        <div class="lk">
          <div class="mark" id="mark">
            <svg viewBox="0 0 120 120" width="124" height="124">
              <defs>
                <linearGradient id="lkg" x1="0" y1="0" x2="1" y2="1">
                  <stop offset="0" stop-color="#6fa8ff"/><stop offset="0.3" stop-color="#c58bff"/><stop offset="0.55" stop-color="#ff8fb0"/><stop offset="0.78" stop-color="#ffc47a"/><stop offset="1" stop-color="#8fe3d0"/>
                </linearGradient>
              </defs>
              <circle id="mk1" cx="60" cy="60" r="50" pathLength="1" fill="none" stroke="url(#lkg)" stroke-width="8" stroke-dasharray="1 1" stroke-dashoffset="1" opacity="0" transform="rotate(-90 60 60)"/>
              <circle id="mk2" cx="60" cy="60" r="31" fill="none" stroke="url(#lkg)" stroke-width="4" opacity="0"/>
              <circle id="mk3" cx="60" cy="60" r="8" fill="#f4f6fa" style="transform-origin: 60px 60px"/>
            </svg>
          </div>
          <span class="wm" id="wm">Hush</span>
        </div>
        <div class="tag" id="tag">Noise cancelling, tuned to you.</div>
      </div>

      <div id="vig" class="clip full" data-start="0" data-duration="10" data-track-index="4" data-layout-allow-overlap data-layout-allow-occlusion></div>
    </div>

    <script>
      const TAU = Math.PI * 2;
      const W = 1920, H = 1080, CX = 960, CY = 540;
      const cl = (x, a = 0, b = 1) => Math.min(b, Math.max(a, x));
      const eo = (p) => { p = cl(p); return p >= 1 ? 1 : 1 - Math.pow(2, -10 * p); };   // expo.out
      const cubicOut = (p) => 1 - Math.pow(1 - cl(p), 3);
      const pin = (p) => { p = cl(p); return p * p * p; };
      const sm = (a, b, x) => { const p = cl((x - a) / (b - a)); return p * p * (3 - 2 * p); };

      /* ---------- timing ---------- */
      const R0 = 380;                 // title ring radius
      const ECHO_T0 = 0.9, ECHO_GAP = 0.8, ECHO_N = 5, ECHO_LIFE = 2.8;
      const K = 5;                    // reveal rings
      const T0 = 4.7, GAP = 0.14, DUR = 2.0, RMAX = 1320;
      const discR = (k, t) => { const p = (t - (T0 + GAP * k)) / DUR; return p <= 0 ? 0 : RMAX * eo(p); };

      /* ---------- product art ---------- */
      function bud(u) {
        return '<svg viewBox="0 0 200 360" width="230" height="414">' +
          '<defs>' +
            '<radialGradient id="hd' + u + '" cx=".36" cy=".3" r=".85"><stop offset="0" stop-color="#ffffff"/><stop offset=".5" stop-color="#eef0f4"/><stop offset=".85" stop-color="#bcc3cf"/><stop offset="1" stop-color="#97a0ae"/></radialGradient>' +
            '<linearGradient id="sg' + u + '" x1="0" y1="0" x2="1" y2="0"><stop offset="0" stop-color="#c9cfd9"/><stop offset=".3" stop-color="#ffffff"/><stop offset=".7" stop-color="#e2e6ec"/><stop offset="1" stop-color="#9ea7b5"/></linearGradient>' +
            '<radialGradient id="tg' + u + '" cx=".4" cy=".35" r=".8"><stop offset="0" stop-color="#eceff3"/><stop offset=".6" stop-color="#bcc4cf"/><stop offset="1" stop-color="#7a8392"/></radialGradient>' +
            '<radialGradient id="mg' + u + '" cx=".5" cy=".5" r=".5"><stop offset="0" stop-color="#14161a"/><stop offset=".7" stop-color="#2b2f36"/><stop offset="1" stop-color="#585e6a"/></radialGradient>' +
            '<linearGradient id="rg' + u + '" x1="0" y1="0" x2="1" y2="1"><stop offset=".35" stop-color="#8fb4ff" stop-opacity="0"/><stop offset="1" stop-color="#8fb4ff" stop-opacity=".75"/></linearGradient>' +
            '<linearGradient id="hl' + u + '" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#fff" stop-opacity=".95"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient>' +
            '<radialGradient id="sh' + u + '" cx=".5" cy=".5" r=".5"><stop offset="0" stop-color="#000" stop-opacity=".3"/><stop offset="1" stop-color="#000" stop-opacity="0"/></radialGradient>' +
          '</defs>' +
          '<g transform="rotate(-5 120 150)">' +
            '<rect x="100" y="130" width="42" height="212" rx="21" fill="url(#sg' + u + ')"/>' +
            '<rect x="118" y="206" width="5" height="62" rx="2.5" fill="#000" opacity=".17"/>' +
            '<rect x="104" y="150" width="3" height="170" rx="1.5" fill="#fff" opacity=".7"/>' +
            '<rect x="112" y="327" width="18" height="3" rx="1.5" fill="#000" opacity=".35"/>' +
          '</g>' +
          '<ellipse cx="44" cy="150" rx="40" ry="42" fill="url(#tg' + u + ')"/>' +
          '<ellipse cx="36" cy="154" rx="17" ry="18" fill="url(#mg' + u + ')"/>' +
          '<ellipse cx="36" cy="154" rx="17" ry="18" fill="none" stroke="#fff" stroke-opacity=".35" stroke-width="1.2"/>' +
          '<ellipse cx="124" cy="182" rx="40" ry="13" fill="url(#sh' + u + ')"/>' +
          '<ellipse cx="112" cy="100" rx="78" ry="76" fill="url(#hd' + u + ')"/>' +
          '<ellipse cx="112" cy="100" rx="77" ry="75" fill="none" stroke="url(#rg' + u + ')" stroke-width="2.2"/>' +
          '<ellipse cx="92" cy="62" rx="40" ry="20" transform="rotate(-24 92 62)" fill="url(#hl' + u + ')" opacity=".85"/>' +
          '<circle cx="152" cy="72" r="5" fill="#20232a"/><circle cx="152" cy="72" r="5" fill="none" stroke="#fff" stroke-opacity=".4" stroke-width="1"/>' +
          '<circle cx="132" cy="168" r="3.4" fill="#20232a" opacity=".85"/>' +
        '</svg>';
      }
      function caseSvg(u) {
        return '<svg viewBox="0 0 420 290" width="400" height="276">' +
          '<defs>' +
            '<linearGradient id="cb' + u + '" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#ffffff"/><stop offset=".3" stop-color="#f0f2f5"/><stop offset=".68" stop-color="#d6dbe3"/><stop offset="1" stop-color="#a8b0bd"/></linearGradient>' +
            '<linearGradient id="cs' + u + '" x1="0" y1="0" x2="1" y2="0"><stop offset="0" stop-color="#000" stop-opacity=".24"/><stop offset=".14" stop-color="#000" stop-opacity="0"/><stop offset=".86" stop-color="#000" stop-opacity="0"/><stop offset="1" stop-color="#000" stop-opacity=".28"/></linearGradient>' +
            '<linearGradient id="ch' + u + '" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#fff" stop-opacity=".9"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient>' +
            '<radialGradient id="cg' + u + '" cx=".5" cy=".5" r=".5"><stop offset="0" stop-color="#8fb4ff" stop-opacity=".85"/><stop offset="1" stop-color="#8fb4ff" stop-opacity="0"/></radialGradient>' +
            '<filter id="cf' + u + '" x="-20%" y="-80%" width="140%" height="260%"><feGaussianBlur stdDeviation="10"/></filter>' +
          '</defs>' +
          '<ellipse cx="210" cy="264" rx="185" ry="15" fill="#000" opacity=".6" filter="url(#cf' + u + ')"/>' +
          '<rect x="10" y="10" width="400" height="244" rx="112" fill="url(#cb' + u + ')"/>' +
          '<rect x="10" y="10" width="400" height="244" rx="112" fill="url(#cs' + u + ')"/>' +
          '<path d="M 44 38 Q 210 14 376 38 Q 376 72 210 68 Q 44 72 44 38 Z" fill="url(#ch' + u + ')" opacity=".7"/>' +
          '<path d="M 12 100 Q 210 108 408 100" fill="none" stroke="#4a5160" stroke-opacity=".55" stroke-width="2.4"/>' +
          '<path d="M 14 103.5 Q 210 111.5 406 103.5" fill="none" stroke="#fff" stroke-opacity=".85" stroke-width="1.4"/>' +
          '<circle cx="210" cy="142" r="24" fill="url(#cg' + u + ')"/><circle cx="210" cy="142" r="4.5" fill="#d6e4ff"/>' +
          '<circle cx="210" cy="198" r="17" fill="none" stroke="#000" stroke-opacity=".15" stroke-width="2.6"/>' +
          '<circle cx="210" cy="199.5" r="17" fill="none" stroke="#fff" stroke-opacity=".7" stroke-width="1.2"/>' +
          '<circle cx="210" cy="198" r="3" fill="#000" opacity=".16"/>' +
        '</svg>';
      }
      function scene(k) {
        const u = "-" + k;
        return '<div class="pbg"></div><div class="pglow"></div>' +
          '<div class="pz"><div class="pf">' +
            '<div class="eb bA">' + bud(u + "a") + '</div>' +
            '<div class="eb bB flip">' + bud(u + "b") + '</div>' +
            '<div class="cs">' + caseSvg(u) + '</div>' +
          '</div></div>' +
          '<div class="spec"><b>Hush</b><i></i>45 dB adaptive noise cancelling<i></i>9 h, or 36 h with the case</div>';
      }
      let dh = "";
      for (let k = 0; k < K; k++) {
        dh += '<div class="dsc" id="dsc' + k + '"><div class="psc" id="psc' + k + '" data-layout-allow-overflow>' + scene(k) + '</div><div class="veil" id="vl' + k + '"></div></div>';
      }
      document.getElementById("discs").innerHTML = dh;
      const discEl = [], pscEl = [], veilEl = [];
      for (let k = 0; k < K; k++) {
        discEl.push(document.getElementById("dsc" + k));
        pscEl.push(document.getElementById("psc" + k));
        veilEl.push(document.getElementById("vl" + k));
      }

      /* ---------- canvas drawing from timeline time ---------- */
      const a = document.getElementById("cvA").getContext("2d");
      const b = document.getElementById("cvB").getContext("2d");

      function spectral(ctx, cx, cy, rot, hue0, alpha, light) {
        const g = ctx.createConicGradient(rot, cx, cy), n = 24;
        for (let i = 0; i <= n; i++) {
          const f = i / n;
          const h = (hue0 + f * 720) % 360;
          const L = light + 11 * Math.sin(f * TAU * 3 + 1.2);
          g.addColorStop(f, "hsla(" + h.toFixed(1) + ",82%," + L.toFixed(1) + "%," + alpha + ")");
        }
        return g;
      }
      // radius of a wobbling ring at angle th
      function rr(th, R, t, amp, ph) {
        return R + amp * (Math.sin(5 * th - 2.3 * t + ph) + 0.6 * Math.sin(8 * th + 1.7 * t + ph * 1.7) + 0.35 * Math.sin(13 * th - 3.1 * t + ph * 0.6));
      }
      function ringPath(ctx, cx, cy, R, t, amp, ph) {
        ctx.beginPath();
        const N = 300;
        for (let i = 0; i <= N; i++) {
          const th = (i / N) * TAU, r = rr(th, R, t, amp, ph);
          const x = cx + r * Math.cos(th), y = cy + r * Math.sin(th);
          if (i === 0) ctx.moveTo(x, y); else ctx.lineTo(x, y);
        }
        ctx.closePath();
      }
      // layered ring: soft glow, spectral body, bright core
      function glowRing(ctx, R, t, amp, ph, rot, hue0, k, widths) {
        ringPath(ctx, CX, CY, R, t, amp, ph);
        ctx.lineWidth = widths[0]; ctx.strokeStyle = "rgba(140,170,255," + (0.07 * k).toFixed(3) + ")"; ctx.stroke();
        ctx.lineWidth = widths[1]; ctx.strokeStyle = spectral(ctx, CX, CY, rot, hue0, (0.2 * k).toFixed(3), 62); ctx.stroke();
        ctx.lineWidth = widths[2]; ctx.strokeStyle = spectral(ctx, CX, CY, rot, hue0, (0.6 * k).toFixed(3), 66); ctx.stroke();
        ctx.lineWidth = widths[3]; ctx.strokeStyle = spectral(ctx, CX, CY, rot, hue0, k.toFixed(3), 78); ctx.stroke();
      }
      function thinRing(ctx, R, t, amp, ph, rot, hue0, alpha, w) {
        ringPath(ctx, CX, CY, R, t, amp, ph);
        ctx.lineWidth = w; ctx.strokeStyle = spectral(ctx, CX, CY, rot, hue0, alpha.toFixed(3), 70); ctx.stroke();
      }

      function drawTitle(t) {
        const g = eo((t - 0.1) / 1.6);
        const ga = cl((t - 0.08) / 0.6);
        if (ga <= 0) return;
        const ant = 1 - 0.055 * pin((t - 4.4) / 0.3);
        // each echo is born with a small push on the main ring
        let bump = 0;
        for (let e = 0; e < ECHO_N; e++) {
          const age = t - (ECHO_T0 + ECHO_GAP * e);
          if (age >= 0) bump = Math.max(bump, 7 * Math.exp(-5 * age));
        }
        const R = (R0 * (0.6 + 0.4 * g) + bump) * ant;
        const energy = (0.3 + 0.08 * Math.sin(2.1 * t)) + 0.95 * sm(3.9, 4.6, t);
        const amp = (3.2 + 2.4 * Math.pow(Math.sin(0.9 * t), 2)) * (1 + 1.3 * sm(3.9, 4.6, t)) * g;
        const rot = t * 0.55;
        const hue0 = 205 - t * 38;

        a.globalCompositeOperation = "lighter";
        // ambient light on the backdrop
        const gl = a.createRadialGradient(CX, CY, R * 0.55, CX, CY, R * 1.9);
        gl.addColorStop(0, "hsla(225,80%,62%," + (0.09 * ga).toFixed(3) + ")");
        gl.addColorStop(1, "hsla(225,80%,62%,0)");
        a.fillStyle = gl; a.fillRect(0, 0, W, H);

        // echo rings travelling outward and fading
        for (let e = 0; e < ECHO_N; e++) {
          const age = t - (ECHO_T0 + ECHO_GAP * e);
          if (age < 0 || age > ECHO_LIFE) continue;
          const u = age / ECHO_LIFE;
          const er = R0 + 22 + 330 * cubicOut(u);
          const al = 0.55 * Math.pow(1 - u, 1.6) * cl(age / 0.25) * ga;
          thinRing(a, er, t, 2 + 11 * u, e * 1.7, -rot + e, hue0 + e * 70, al, 1.7);
          thinRing(a, er + 7, t, 2 + 11 * u, e * 1.7 + 0.8, -rot + e, hue0 + e * 70 + 40, al * 0.4, 1.1);
        }

        // sound-wave fringe
        a.lineWidth = 1.5; a.lineCap = "round";
        const NT = 220;
        for (let i = 0; i < NT; i++) {
          const th = (i / NT) * TAU;
          const n = Math.sin(29 * th + 5 * t) * Math.cos(11 * th - 3.4 * t) * Math.sin(53 * th + 2 * t);
          const Ln = energy * (3 + 34 * n * n) * g;
          const r0 = rr(th, R + 5, t, amp, 0), r1 = r0 + Ln;
          const h = (hue0 + ((th - rot + TAU) % TAU) / TAU * 720) % 360;
          a.strokeStyle = "hsla(" + h.toFixed(0) + ",85%,76%," + (0.5 * ga).toFixed(2) + ")";
          a.beginPath();
          a.moveTo(CX + r0 * Math.cos(th), CY + r0 * Math.sin(th));
          a.lineTo(CX + r1 * Math.cos(th), CY + r1 * Math.sin(th));
          a.stroke();
        }

        // thin companion rings inside
        thinRing(a, R - 18, t, amp * 0.8, 1.1, -rot * 0.8, hue0 + 60, 0.5 * ga, 1.3);
        thinRing(a, R - 36, t, amp * 0.6, 2.3, rot * 0.6, hue0 + 120, 0.32 * ga, 1.2);
        thinRing(a, R - 62, t, amp * 0.4, 3.4, -rot * 0.5, hue0 + 200, 0.2 * ga, 1.1);

        // main ring
        glowRing(a, R, t, amp, 0, rot, hue0, ga * (0.85 + 0.15 * energy), [26, 11, 5, 2.2]);
        a.globalCompositeOperation = "source-over";
      }

      function drawEdge(ctx, r, t, k, p) {
        const al = cl((1250 - r) / 260) * cl(r / 24);
        if (al <= 0.01) return;
        const amp = 2 + 10 * (1 - eo(p * 1.4));
        const rot = t * 0.6 * (k % 2 ? -1 : 1) + k;
        const hue0 = 200 + 44 * k - t * 60;
        ctx.globalCompositeOperation = "lighter";
        ringPath(ctx, CX, CY, Math.max(1, r - 20), t, amp, k * 1.9);
        ctx.lineWidth = 38; ctx.strokeStyle = "rgba(170,195,255," + (0.07 * al).toFixed(3) + ")"; ctx.stroke();
        glowRing(ctx, r, t, amp, k * 1.9, rot, hue0, al, [30, 13, 5.5, 2.4]);
        thinRing(ctx, r + 11, t, amp, k * 1.9 + 0.7, -rot, hue0 + 50, 0.4 * al, 1.2);
        thinRing(ctx, r - 9, t, amp, k * 1.9 + 1.4, rot, hue0 + 100, 0.3 * al, 1.1);
        ctx.globalCompositeOperation = "source-over";
      }

      const S = { t: 0 };
      function draw() {
        const t = S.t;
        a.clearRect(0, 0, W, H);
        if (t < 6.2) drawTitle(t);

        b.clearRect(0, 0, W, H);
        for (let k = 0; k < K; k++) {
          const p = (t - (T0 + GAP * k)) / DUR;
          const r = discR(k, t);
          discEl[k].style.clipPath = "circle(" + r.toFixed(1) + "px at 960px 540px)";
          const e = eo(p);
          pscEl[k].style.transform = "scale(" + (1 + (0.3 - 0.06 * k) * (1 - e)).toFixed(4) + ")";
          veilEl[k].style.opacity = (Math.max(0, 0.55 - 0.1 * k) * (1 - e)).toFixed(3);
          if (r > 0) drawEdge(b, r, t, k, p);
        }
        // closing echo from the lockup
        const la = t - 7.5;
        if (la > 0 && la < 2.4) {
          const u = la / 2.4;
          const lr = 140 + 520 * cubicOut(u);
          b.globalCompositeOperation = "lighter";
          thinRing(b, lr, t, 2 + 8 * u, 0.5, t * 0.4, 210 - t * 40, 0.34 * Math.pow(1 - u, 1.5), 1.8);
          thinRing(b, lr + 8, t, 2 + 8 * u, 1.3, -t * 0.4, 250 - t * 40, 0.14 * Math.pow(1 - u, 1.5), 1.1);
          b.globalCompositeOperation = "source-over";
        }
      }

      /* ---------- timeline ---------- */
      const tl = gsap.timeline({ paused: true });

      // canvases and disc masks follow timeline time
      tl.to(S, { t: 10, duration: 10, ease: "none", onUpdate: draw }, 0);

      // baselines (one set per element), then .to tweens with explicit end values
      tl.set("#ttext", { "--sp": 10, scale: 1 }, 0);
      tl.set("#l1", { opacity: 0, y: 22, scale: 1.06, filter: "blur(14px)" }, 0);
      tl.set("#l2", { opacity: 0, y: 22, scale: 1.06, filter: "blur(14px)" }, 0);
      tl.set("#foot", { opacity: 0 }, 0);
      tl.set(".cs", { y: 150, scale: 0.88, rotation: -3 }, 0);
      tl.set(".bA", { y: 230, rotation: -26, scale: 0.9 }, 0);
      tl.set(".bB", { y: 250, rotation: 26, scale: 0.9 }, 0);
      tl.set(".pz", { scale: 1 }, 0);
      tl.set(".pf", { opacity: 1, scale: 1, filter: "blur(0px)" }, 0);
      tl.set(".spec", { opacity: 0, y: 14 }, 0);
      tl.set("#mark", { opacity: 0, rotation: -40 }, 0);
      tl.set("#mk1", { opacity: 0, strokeDashoffset: 1 }, 0);
      tl.set("#mk2", { opacity: 0, scale: 0.6, transformOrigin: "60px 60px" }, 0);
      tl.set("#mk3", { opacity: 0, scale: 0 }, 0);
      tl.set("#wm", { opacity: 0, y: 40, filter: "blur(16px)", backgroundPosition: "100% 0" }, 0);
      tl.set("#tag", { opacity: 0, y: 22, filter: "blur(8px)" }, 0);

      // title copy: blur-in with a brief colour split, then a slow settle
      tl.to("#l1", { opacity: 1, y: 0, scale: 1, filter: "blur(0px)", duration: 1.1, ease: "expo.out" }, 0.5);
      tl.to("#l2", { opacity: 1, y: 0, scale: 1, filter: "blur(0px)", duration: 1.1, ease: "expo.out" }, 0.64);
      tl.to("#ttext", { "--sp": 0, duration: 1.0, ease: "expo.out" }, 0.55);
      tl.to("#ttext", { scale: 1.03, duration: 3.9, ease: "sine.inOut" }, 0.8);
      tl.to("#foot", { opacity: 1, duration: 0.9, ease: "power2.out" }, 1.4);

      // product lands inside the rings, then floats
      tl.to(".cs", { y: 0, scale: 1, rotation: 0, duration: 1.8, ease: "expo.out" }, T0 + 0.05);
      tl.to(".bA", { y: 0, rotation: -8, scale: 1, duration: 1.9, ease: "expo.out" }, T0 + 0.1);
      tl.to(".bB", { y: 0, rotation: 8, scale: 1, duration: 1.9, ease: "expo.out" }, T0 + 0.2);
      tl.to(".pz", { scale: 1.05, duration: 5.2, ease: "sine.out" }, T0);
      tl.to(".bA", { y: -14, rotation: -6.5, duration: 1.5, ease: "sine.inOut" }, T0 + 2.0);
      tl.to(".bA", { y: 0, rotation: -8, duration: 1.5, ease: "sine.inOut" }, T0 + 3.5);
      tl.to(".bB", { y: -12, rotation: 6.5, duration: 1.6, ease: "sine.inOut" }, T0 + 2.1);
      tl.to(".bB", { y: 0, rotation: 8, duration: 1.6, ease: "sine.inOut" }, T0 + 3.7);
      tl.to(".cs", { y: -7, duration: 1.7, ease: "sine.inOut" }, T0 + 2.0);
      tl.to(".cs", { y: 0, duration: 1.7, ease: "sine.inOut" }, T0 + 3.7);

      // spec line
      tl.to(".spec", { opacity: 1, y: 0, duration: 0.9, ease: "expo.out" }, 5.55);
      tl.to(".spec", { opacity: 0, duration: 0.5, ease: "power2.in" }, 7.2);

      // product recedes behind the lockup
      tl.to(".pf", { opacity: 0.16, scale: 0.94, filter: "blur(5px)", duration: 1.0, ease: "power2.inOut" }, 7.3);

      // lockup: mark draws, wordmark rises, tagline follows, one spectral sweep
      tl.to("#mark", { opacity: 1, rotation: 20, duration: 2.4, ease: "expo.out" }, 7.55);
      tl.to("#mk1", { opacity: 1, strokeDashoffset: 0, duration: 1.0, ease: "expo.out" }, 7.55);
      tl.to("#mk2", { opacity: 0.65, scale: 1, duration: 0.9, ease: "expo.out" }, 7.7);
      tl.to("#mk3", { opacity: 1, scale: 1, duration: 0.7, ease: "expo.out" }, 7.75);
      tl.to("#wm", { opacity: 1, y: 0, filter: "blur(0px)", duration: 1.1, ease: "expo.out" }, 7.65);
      tl.to("#tag", { opacity: 1, y: 0, filter: "blur(0px)", duration: 1.0, ease: "expo.out" }, 7.95);
      tl.to("#wm", { backgroundPosition: "0% 0", duration: 1.0, ease: "power2.inOut" }, 8.9);

      tl.set({}, {}, 10);

      window.__timelines = window.__timelines || {};
      window.__timelines["main"] = tl;
      draw();
    </script>
  </body>
</html>
```
