# Whip Pan Transition

A blush laptop sits on a white seamless with Hello Wren on its screen. It whips out to the left in a horizontal smear while an indigo laptop with a different screen swings in from the right and lands. A second whip brings in a closed graphite lid seen from above, and a third brings in the Wren lockup.

- Position in a launch film: Transitions
- Slug: whip-pan-transition
- Preview video: https://media.motionboard.app/whip-pan.mp4
- Recipe page: https://motionboard.app/recipes/whip-pan-transition/
- 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 `whip-pan`. 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 10.6s. Laptop A sharp 0–3.0s (the Wren line rises 0.45–1.05s, a glare sweeps the screen 1.55–2.5s). Whip 1: A out 3.0–3.32s (0.32s), laptop B in 3.2–3.54s (0.34s) with a 0.3s settle to 3.84s. B holds to 5.3s (glare 4.0–4.95s). Whip 2: B out 5.3–5.62s, the closed lid in 5.5–5.84s with a settle to 6.14s. The lid holds to 7.55s. Whip 3: lid out 7.55–7.87s, lockup in 7.75–8.09s with a settle to 8.39s. The lockup holds 8.4–10.6s (2.2s) |
| Easing | Out: power3.in on x and skew, power2.in on the blur. In: power3.out to the overshoot, then sine.inOut back to 0 over 0.3s; the blur falls with power3.out over 0.44s. The Wren line rises with expo.out, wallpaper pills drift with sine.inOut, the glare uses power2.inOut, the lid roll uses power3.out; all slow drifts are linear (none) |
| Camera | Locked frame; the whip is the subject sliding left across it. Travel ±2800px, skewX −9° at the ends relaxing to 0 on the way in. Motion blur: 7 stacked copies (main plus 6 ghosts, each delayed 5.5ms more, ghost opacity 0.55 − 0.07·i for i = 1–6) and one horizontal Gaussian blur on the group, stdDeviation 0.1 → 56px in x and 0 in y, applied only during a whip. Landing overshoot 26px, then settle to 0. Slow drifts on landed subjects: laptop A scale 1.03 over 0–3.0s, laptop B 1.03 over 3.5–5.35s, the lid 1.03 over 5.85–7.55s |
| Subject | Laptop front view: lid 1100x690px at (410, 120) with a 2px edge and a 10px camera dot, screen 1064x652px with 12px corners, base 1240x34px at (340, 810) with a 320x11px notch and a soft elliptical shadow. A: blush base #f0b4a2, wallpaper of ten 100px-wide pills with 50px radius in magenta, orange and pale pink gradients, text Hello and Wren at 196px weight 800 in near-black. B: indigo base #5470f0, wallpaper of a teal-to-cobalt radial glow with white rings every 60px, text Go and anywhere. at 196px and 188px in white. C: closed lid 1120x720px with 46px corners, graphite #4a4f5a → #1c1e23, a hinge band 46px tall, a 190px W mark embossed at the centre, rotated −5°. Lockup: 190px coral mark, Wren at 190px weight 700, tagline A laptop that keeps up. at 48px |
| Sync | The next subject enters 0.2s after the previous one starts to leave (3.2 vs 3.0s, 5.5 vs 5.3s, 7.75 vs 7.55s), so for about 0.12s both are in motion with white between them. Ghosts of the arriving subject fade out over 0.14s starting 0.1s before the landing, so the landing is sharp. The Wren line has appeared at 1.05s, well before whip 1. The lid roll from −16° to −5° runs with its slide in, 5.5–6.0s. The lockup is still for the last 2.2s |
| Style | Pure white seamless with a floor gradient down to `#eceef1`, a vignette reaching 7% at the edges and static grain at 7% opacity. One accent colour, coral `#ff5a36` (mark gradient #ff7a4d → #ee3f1e), used only on the lockup mark. Inter throughout, wallpaper text 800, wordmark 700, tagline 500 in #646a73; the product is the only subject, no hands |

## Why it works

A viewer reads a whip pan from three things on the same frames: the smear runs only along the direction of travel, the speed peaks as the subject crosses the frame edge, and the next subject arrives from the opposite side in the same direction. Each subject here is seven stacked copies of one layer, the main copy and six ghosts, and every ghost runs the same move 5.5ms later than the one before it. The ghosts trail the leading edge, so the text on the laptop screen stretches into streaks. One horizontal-only Gaussian blur on the group adds the rest, and it is switched off at rest so every landing is sharp. Out uses power3.in, so speed peaks at the edge of the frame; in uses power3.out into a 26px overshoot and a 0.3s settle, which reads as a camera catching its subject. All three whips go right to left, so they read as one camera swinging past three subjects: a blush laptop, an indigo laptop with a different screen, and a closed graphite lid seen from above. The lockup arrives by the same whip, so the ending belongs to the same move. The white seamless hides the cut, each subject holds still for 1.7–3.0s so there is time to read it, and the one accent colour, coral #ff5a36, appears only on the lockup mark.

## Prompt

> Build a 10.6-second, 1920x1080, 30 fps light product film called Whip Pan Transition for a fictional product, Wren (a laptop). Background is pure white with a floor gradient down to #eceef1, a vignette reaching 7% and static grain at 7%; one accent colour coral #ff5a36 used only on the lockup mark; font Inter. Use HTML, CSS and one paused GSAP timeline. Do not use CSS animations or Math.random. There are four subjects, each a full-frame wrapper holding 7 identical copies of its content (the main copy on top and 6 ghosts underneath). A is a laptop in front view: lid 1100x690px at (410, 120), screen 1064x652px, base 1240x34px at (340, 810) in blush #f0b4a2 with a soft elliptical shadow; the screen shows ten pastel-pink, magenta and orange pill columns and the text Hello and Wren at 196px weight 800. B is the same laptop with an indigo base #5470f0 and a cobalt radial wallpaper with white rings and the text Go and anywhere. in white. C is a closed graphite lid seen from above, 1120x720px with 46px corners, a hinge band and a W mark embossed at the centre, rotated −5°. D is the lockup: a 190px coral W mark, Wren at 190px weight 700 and the tagline A laptop that keeps up. at 48px. Place B, C and D at x = +2800px and skewX −9° at time 0. A whip out moves every copy of a subject to x = −2800px and skewX −9° in 0.32s with power3.in; copy i starts 0.0055·i s after the main copy, and ghost i (i = 1–6) is set to opacity 0.55 − 0.07·i when the whip starts. During the whip put a horizontal-only SVG Gaussian blur (feGaussianBlur stdDeviation animated from 0.1 0 to 56 0 with power2.in) on the wrapper through filter: url(#id), and set filter to none when it ends. A whip in moves a subject from x = +2800px to −26px with skewX −9° → 0 in 0.34s with power3.out, then back to 0 over 0.3s with sine.inOut, with the same per-copy delays; its blur falls from 56 to 0.1 with power3.out over 0.44s, and its ghosts fade to 0 over 0.14s starting 0.1s before the main copy lands. Timeline: A is sharp from 0 to 3.0s with Wren rising 40px with expo.out at 0.45s and a white glare band sweeping across the screen 1.55–2.5s with power2.inOut. Whip 1: A out at 3.0s, B in at 3.2s. B holds to 5.3s with a glare at 4.0s. Whip 2: B out at 5.3s, C in at 5.5s while its rotation goes from −16° to −5° over 0.5s with power3.out. C holds to 7.55s. Whip 3: C out at 7.55s, D in at 7.75s. D stays perfectly still from 8.4s to 10.6s. Give landed subjects a linear 1.03x scale drift over their hold. Make the whip the only fast motion, keep every landing sharp and keep each subject still for at least 1.5s.

## Often confused with

- [Match Cut Transition](https://motionboard.app/r/match-cut-transition.md): Match Cut Transition keeps one anchor in the same place while the scenes change around it with hard cuts; in Whip Pan Transition every change is a fast sideways move with motion blur and the subject itself leaves and arrives.
- [Wipe and Flash Transition](https://motionboard.app/r/wipe-flash-transition.md): Wipe and Flash Transition covers the change with a sweeping ball and a white flash; in Whip Pan Transition the subject is the thing that swings, smeared along its path, and no extra object covers the cut.

## Source files

Runnable HyperFrames project, 3 files.

- https://motionboard.app/source/whip-pan/hyperframes.json (318 B)
- https://motionboard.app/source/whip-pan/index.html (15.1 KB)
- https://motionboard.app/source/whip-pan/package.json (297 B)

Download all of them:

```sh
curl -fsSL --create-dirs -o "whip-pan/hyperframes.json" "https://motionboard.app/source/whip-pan/hyperframes.json"
curl -fsSL --create-dirs -o "whip-pan/index.html" "https://motionboard.app/source/whip-pan/index.html"
curl -fsSL --create-dirs -o "whip-pan/package.json" "https://motionboard.app/source/whip-pan/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 {
        --acc: #ff5a36;
        --inter: "Inter", sans-serif;
      }
      * { margin: 0; padding: 0; box-sizing: border-box; }
      html, body { width: 1920px; height: 1080px; overflow: hidden; background: #ffffff; }
      #root { position: relative; width: 1920px; height: 1080px; overflow: hidden; background: #ffffff; -webkit-font-smoothing: antialiased; font-family: var(--inter); }
      #stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; overflow: hidden; }

      /* white seamless: soft floor, nothing else */
      #bg { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px;
        background:
          radial-gradient(ellipse 80% 60% at 50% 42%, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%),
          linear-gradient(180deg, #ffffff 0%, #fdfdfd 62%, #eceef1 100%); }
      #vig { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; pointer-events: none; z-index: 40;
        background: radial-gradient(ellipse 75% 80% at 50% 48%, rgba(0,0,0,0) 62%, rgba(20,24,34,0.07) 100%); }
      #grain { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; pointer-events: none; z-index: 41; mix-blend-mode: multiply; }

      /* one swung subject = filter wrapper + 7 full-frame copies (main + 6 trailing ghosts) */
      .sj { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; overflow: visible; }
      .cp { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; overflow: visible; }
      .lp { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }
      .ab { position: absolute; }

      /* laptop, front view */
      .shadow { left: 360px; top: 826px; width: 1200px; height: 86px; background: radial-gradient(ellipse at 50% 18%, rgba(20,24,34,0.34) 0%, rgba(20,24,34,0.14) 45%, rgba(20,24,34,0) 72%); }
      .lid { left: 410px; top: 120px; width: 1100px; height: 690px; border-radius: 30px 30px 6px 6px; background: #0b0b0d; box-shadow: inset 0 0 0 2px #2b2c31, 0 -2px 0 rgba(255,255,255,0.5); }
      .dot { left: 955px; top: 126px; width: 10px; height: 10px; border-radius: 50%; background: #1d1f25; box-shadow: inset 0 0 0 2px #2f3138; }
      .scr { left: 428px; top: 140px; width: 1064px; height: 652px; border-radius: 12px; overflow: hidden; }
      .base { left: 340px; top: 810px; width: 1240px; height: 34px; border-radius: 0 0 44px 44px / 0 0 24px 24px; }
      .notch { left: 800px; top: 810px; width: 320px; height: 11px; border-radius: 0 0 16px 16px; background: linear-gradient(180deg, rgba(0,0,0,0.26), rgba(0,0,0,0.08)); }
      .baseA { background: linear-gradient(180deg, #f9d4c8 0%, #f0b4a2 55%, #dd9683 100%); box-shadow: inset 0 2px 0 rgba(255,255,255,0.7); }
      .baseB { background: linear-gradient(180deg, #8da0ff 0%, #5470f0 55%, #3a50d0 100%); box-shadow: inset 0 2px 0 rgba(255,255,255,0.55); }

      .txt { position: absolute; left: 64px; font: 800 196px/1 var(--inter); letter-spacing: -0.055em; white-space: nowrap; }
      #sjA .aw2 { opacity: 0; }
      .pill { position: absolute; width: 100px; border-radius: 50px; }
      .gl { position: absolute; left: -460px; top: -60px; width: 360px; height: 800px; background: linear-gradient(100deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.38) 50%, rgba(255,255,255,0) 100%); }

      /* closed lid from above */
      .lid2 { left: 400px; top: 170px; width: 1120px; height: 720px; border-radius: 46px;
        background: radial-gradient(900px 600px at 18% 8%, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0) 60%), linear-gradient(140deg, #4a4f5a 0%, #2c2f36 48%, #1c1e23 100%);
        box-shadow: inset 0 0 0 2px rgba(255,255,255,0.10), inset 0 2px 0 rgba(255,255,255,0.22), 0 60px 80px -24px rgba(20,24,34,0.42), 0 14px 26px rgba(20,24,34,0.22); }
      .hinge { left: 0; top: 0; width: 1120px; height: 46px; border-radius: 46px 46px 0 0; background: linear-gradient(180deg, #17191d 0%, #24272d 100%); border-bottom: 2px solid rgba(255,255,255,0.10); }

      /* lockup */
      .lockrow { left: 0; top: 380px; width: 1920px; height: 190px; display: flex; align-items: center; justify-content: center; gap: 40px; }
      .mk { width: 190px; height: 190px; border-radius: 48px; background: linear-gradient(145deg, #ff7a4d 0%, #ff5a36 55%, #ee3f1e 100%); box-shadow: 0 22px 40px -16px rgba(238,63,30,0.55), inset 0 2px 0 rgba(255,255,255,0.35); }
      .wm { font: 700 190px/1 var(--inter); letter-spacing: -0.045em; color: #0d0e11; }
      .tag { left: 0; top: 628px; width: 1920px; text-align: center; font: 500 48px/1 var(--inter); letter-spacing: -0.01em; color: #646a73; }

      svg.defs { position: absolute; width: 0; height: 0; }
    </style>
  </head>
  <body>
    <div id="root" data-composition-id="main" data-start="0" data-duration="10.6" data-width="1920" data-height="1080">
      <div id="stage" class="clip" data-start="0" data-duration="10.6" data-track-index="0" data-layout-allow-overlap>
        <svg class="defs" width="0" height="0" aria-hidden="true">
          <defs>
            <filter id="fA" x="-100%" y="-20%" width="300%" height="140%" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="0.1 0" /></filter>
            <filter id="fB" x="-100%" y="-20%" width="300%" height="140%" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="0.1 0" /></filter>
            <filter id="fC" x="-100%" y="-20%" width="300%" height="140%" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="0.1 0" /></filter>
            <filter id="fD" x="-100%" y="-20%" width="300%" height="140%" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="0.1 0" /></filter>
          </defs>
        </svg>
        <div id="bg" data-layout-allow-overlap></div>
        <!-- subjects are built by the script below, in z order -->
        <div id="vig" data-layout-allow-overlap data-layout-ignore></div>
        <svg id="grain" width="1920" height="1080" viewBox="0 0 1920 1080" data-layout-allow-overlap data-layout-ignore>
          <filter id="gn"><feTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="2" seed="7" /><feColorMatrix type="saturate" values="0" /></filter>
          <rect width="1920" height="1080" filter="url(#gn)" opacity="0.07" />
        </svg>
      </div>
    </div>

    <script>
      const N = 6;            /* ghost copies */
      const LAG = 0.0055;     /* seconds of lag per ghost */
      const OFF = 2800;       /* px offscreen */
      const SKEW = -9;

      function mulberry32(a) { return function () { a |= 0; a = (a + 0x6D2B79F5) | 0; let t = Math.imul(a ^ (a >>> 15), 1 | a); t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t; return ((t ^ (t >>> 14)) >>> 0) / 4294967296; }; }

      /* W mark, 100 grid */
      const wMark = (stroke, w, extra) => '<svg width="100%" height="100%" viewBox="0 0 100 100" fill="none" style="' + (extra || "") + '"><path d="M21 33 L36 69 L50 43 L64 69 L79 33" stroke="' + stroke + '" stroke-width="' + w + '" stroke-linecap="round" stroke-linejoin="round"/></svg>';

      /* ---------- subject A: laptop, blush case, magenta wallpaper ---------- */
      function pillsA() {
        const rnd = mulberry32(11);
        const pal = [["#ff2d8f", "#ffd0e6"], ["#ff8a3d", "#fff0e4"], ["#d4249b", "#ff9bd0"], ["#ffe6f2", "#ff8fc6"], ["#ff4fa6", "#ffc4e0"], ["#ff9a4a", "#ffe3cc"], ["#c61f9a", "#ffa6d6"], ["#fff0f7", "#ff7fbf"], ["#ff3a98", "#ffd4e8"], ["#ff7b45", "#ffeadd"]];
        let h = "";
        for (let i = 0; i < 10; i++) {
          const top = -30 + Math.round(rnd() * 120) - (i % 2) * 30;
          const ht = 560 + Math.round(rnd() * 90);
          h += '<span class="pill ' + (i % 2 ? "pam" : "pap") + '" style="left:' + (i * 107 - 1) + "px;top:" + top + "px;height:" + ht + "px;background:linear-gradient(180deg," + pal[i][0] + " 0%," + pal[i][1] + ' 100%);"></span>';
        }
        return h;
      }
      function laptopA() {
        return '<div class="lp lpA">' +
          '<div class="ab shadow"></div>' +
          '<div class="ab lid"></div><div class="ab dot"></div>' +
          '<div class="ab scr" style="background:linear-gradient(160deg,#ff3d8b,#ff9a4a 60%,#ffd9bd)">' + pillsA() +
            '<div class="txt aw1" style="top:118px;color:#0a0a0c">Hello</div>' +
            '<div class="txt aw2" style="top:318px;color:#0a0a0c">Wren</div>' +
            '<div class="gl glA"></div>' +
          '</div>' +
          '<div class="ab base baseA"></div><div class="ab notch"></div>' +
        '</div>';
      }

      /* ---------- subject B: laptop, indigo case, ring wallpaper ---------- */
      function laptopB() {
        return '<div class="lp lpB">' +
          '<div class="ab shadow"></div>' +
          '<div class="ab lid"></div><div class="ab dot"></div>' +
          '<div class="ab scr" style="background:linear-gradient(180deg,#0d1456,#0a0f40)">' +
            '<div class="ab rb" style="left:300px;top:-420px;width:1600px;height:1600px;border-radius:50%;background:radial-gradient(circle at 50% 50%, #8ff5dc 0%, #46c6ee 12%, #2f68ee 30%, #2338b8 52%, #131a74 74%, rgba(13,20,86,0) 100%)"></div>' +
            '<div class="ab rb" style="left:300px;top:-420px;width:1600px;height:1600px;border-radius:50%;background:repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,0) 0px, rgba(255,255,255,0) 54px, rgba(255,255,255,0.20) 55px, rgba(255,255,255,0.20) 60px)"></div>' +
            '<div class="txt" style="top:118px;color:#ffffff">Go</div>' +
            '<div class="txt" style="top:318px;color:#ffffff;font-size:188px">anywhere.</div>' +
            '<div class="gl glB"></div>' +
          '</div>' +
          '<div class="ab base baseB"></div><div class="ab notch"></div>' +
        '</div>';
      }

      /* ---------- subject C: closed lid from above ---------- */
      function lidC() {
        return '<div class="lp">' +
          '<div class="ab lid2">' +
            '<div class="ab hinge"></div>' +
            '<div class="ab" style="left:465px;top:268px;width:190px;height:190px;transform:translate(2px,3px)">' + wMark("rgba(0,0,0,0.55)", 8) + '</div>' +
            '<div class="ab" style="left:465px;top:268px;width:190px;height:190px">' + wMark("rgba(255,255,255,0.30)", 8) + '</div>' +
          '</div>' +
        '</div>';
      }

      /* ---------- subject D: lockup ---------- */
      function lockD() {
        return '<div class="lp">' +
          '<div class="ab lockrow"><div class="mk">' + wMark("#ffffff", 9) + '</div><div class="wm">Wren</div></div>' +
          '<div class="ab tag">A laptop that keeps up.</div>' +
        '</div>';
      }

      const stage = document.getElementById("stage");
      const vig = document.getElementById("vig");
      function build(id, html) {
        const sj = document.createElement("div");
        sj.className = "sj"; sj.id = "sj" + id;
        sj.setAttribute("data-layout-allow-overlap", ""); sj.setAttribute("data-layout-ignore", "");
        for (let i = N; i >= 0; i--) {
          const cp = document.createElement("div");
          cp.className = "cp c" + i; cp.innerHTML = html;
          sj.appendChild(cp);
        }
        stage.insertBefore(sj, vig);
      }
      build("A", laptopA()); build("B", laptopB()); build("C", lidC()); build("D", lockD());

      /* ---------- timeline ---------- */
      const tl = gsap.timeline({ paused: true });
      const cps = (id, i) => "#sj" + id + " .c" + i;
      const blur = (id) => "#f" + id + " feGaussianBlur";

      /* baselines (once) */
      ["A", "B", "C", "D"].forEach((id) => {
        const x0 = id === "A" ? 0 : OFF, sk0 = id === "A" ? 0 : SKEW;
        for (let i = 0; i <= N; i++) tl.set(cps(id, i), { x: x0, skewX: sk0, opacity: i === 0 ? 1 : 0 }, 0);
        tl.set(blur(id), { attr: { stdDeviation: "0.1 0" } }, 0);
      });
      tl.set("#sjC .lid2", { rotation: -16, scale: 1, transformOrigin: "50% 50%" }, 0);
      tl.set("#sjA .aw2", { opacity: 0, y: 40 }, 0);
      tl.set(".glA, .glB", { x: 0 }, 0);

      /* whip out: subject swung left out of frame with trailing copies and horizontal blur */
      function whipOut(id, t, dur) {
        tl.set("#sj" + id, { filter: "url(#f" + id + ")" }, t);
        tl.to(blur(id), { attr: { stdDeviation: "56 0" }, duration: dur, ease: "power2.in" }, t);
        for (let i = 0; i <= N; i++) {
          tl.to(cps(id, i), { x: -OFF, skewX: SKEW, duration: dur, ease: "power3.in" }, t + i * LAG);
          if (i > 0) {
            tl.to(cps(id, i), { opacity: 0.55 - 0.07 * i, duration: 0.05, ease: "none" }, t);
            tl.set(cps(id, i), { opacity: 0 }, t + dur + 0.25);
          }
        }
        tl.set("#sj" + id, { filter: "none" }, t + dur + 0.1);
      }
      /* whip in: subject arrives from the right, smeared, lands with a small overshoot */
      function whipIn(id, t, dur) {
        tl.set("#sj" + id, { filter: "url(#f" + id + ")" }, t - 0.02);
        tl.set(blur(id), { attr: { stdDeviation: "56 0" } }, t - 0.02);
        tl.to(blur(id), { attr: { stdDeviation: "0.1 0" }, duration: dur + 0.1, ease: "power3.out" }, t);
        for (let i = 0; i <= N; i++) {
          tl.to(cps(id, i), { x: -26, skewX: 0, duration: dur, ease: "power3.out" }, t + i * LAG);
          tl.to(cps(id, i), { x: 0, duration: 0.3, ease: "sine.inOut" }, t + dur + i * LAG);
          if (i > 0) {
            tl.set(cps(id, i), { opacity: 0.55 - 0.07 * i }, t - 0.02);
            tl.to(cps(id, i), { opacity: 0, duration: 0.14, ease: "power2.out" }, t + dur - 0.1);
          }
        }
        tl.set("#sj" + id, { filter: "none" }, t + dur + 0.14);
      }

      /* ===== A (0 - 3.0): blush Wren, "Hello" then "Wren" ===== */
      tl.to("#sjA .aw2", { opacity: 1, y: 0, duration: 0.6, ease: "expo.out" }, 0.45);
      tl.to("#sjA .pap", { y: 18, duration: 3.0, ease: "sine.inOut" }, 0);
      tl.to("#sjA .pam", { y: -18, duration: 3.0, ease: "sine.inOut" }, 0);
      tl.to("#sjA .lpA", { scale: 1.03, duration: 3.0, ease: "none" }, 0);
      tl.to("#sjA .glA", { x: 1950, duration: 0.95, ease: "power2.inOut" }, 1.55);

      /* ===== whip 1 (3.0 - 3.85): A out, B in ===== */
      whipOut("A", 3.0, 0.32);
      whipIn("B", 3.2, 0.34);

      /* ===== B (3.55 - 5.3): indigo Wren ===== */
      tl.to("#sjB .rb", { scale: 1.14, duration: 1.9, ease: "none" }, 3.5);
      tl.to("#sjB .lpB", { scale: 1.03, duration: 1.85, ease: "none" }, 3.5);
      tl.to("#sjB .glB", { x: 1950, duration: 0.95, ease: "power2.inOut" }, 4.0);

      /* ===== whip 2 (5.3 - 6.15): B out, closed lid in ===== */
      whipOut("B", 5.3, 0.32);
      whipIn("C", 5.5, 0.34);
      tl.to("#sjC .lid2", { rotation: -5, duration: 0.5, ease: "power3.out" }, 5.5);

      /* ===== C (5.85 - 7.55): closed lid from above ===== */
      tl.to("#sjC .lid2", { scale: 1.03, duration: 1.7, ease: "none" }, 5.85);

      /* ===== whip 3 (7.55 - 8.4): lid out, lockup in ===== */
      whipOut("C", 7.55, 0.32);
      whipIn("D", 7.75, 0.34);

      /* ===== lockup holds still 8.4 - 10.6 ===== */

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

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