# Sticker Animation

Motionboard shot name: Sticker Slap

A closed slate laptop lid sits on white. Twelve die-cut stickers drop onto it one by one, each squashing on contact and leaving a soft shadow, until the lid is nearly covered. A white card with the Nimbus mark, wordmark and tagline slaps on last and holds still.

- Position in a launch film: Ending
- Slug: sticker-animation
- Preview video: https://media.motionboard.app/sticker-slap.mp4
- Recipe page: https://motionboard.app/recipes/sticker-animation/
- 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 `sticker-slap`. 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.4s. Lid rises 0.05–1.2s. Twelve stickers make contact every 0.42s from 1.10s to 5.72s; each falls for 0.22s before contact, squashes for 0.07s, rebounds for 0.1s and settles over 0.25s. Pause 5.72–6.6s. The card makes contact at 6.6s (fall 0.26s). The mark pops in at 6.9s (0.55s), the wordmark slides in at 7.02s (0.6s) and the tagline rises at 7.32s (0.55s). The lockup is still from 7.9s to 10.4s (2.5s) |
| Easing | Fall power2.in; squash power1.out; rebound, settle and shadow tightening power2.out; lid rise, wordmark and tagline expo.out; mark pop back.out(1.8); camera push power1.inOut; sheen linear |
| Camera | Flat top-down view, centred. One slow push from 1.00x to 1.03x over 0–7.9s (power1.inOut), then the frame holds still for the last 2.5s. The lid drops 3px on each sticker contact (0.05s down, 0.3s back, power2.out) and 7px on the card |
| Subject | Lid 1320x850px, corner radius 46px, at left 300px and top 110px, a matte slate gradient at 160° from `#5b6b8e` through `#4b5979` to `#3f4c69`, a 2px light top edge and a darker `#2f3a54` edge 12px lower for thickness. A debossed cloud mark, 200x140px, sits in the centre. Twelve die-cut stickers drawn in SVG with a 13px white border, a hairline at 16% black and a diagonal gloss: smiley, coffee cup, hello bubble, rainbow with clouds, ringed planet, pixel heart, lightning bolt, SHIP IT label, cat face, star, v2 badge and cloud face, 190–400px wide, turned -12° to 14°. Final card 880x380px, radius 46px, white, with a 144px mark, the 168px wordmark nimbus and the 42px tagline Make it yours. |
| Sync | On every landing the squash, the shadow reaching its darkest opacity (50%) and the lid drop start on the same contact frame. The card's mark, wordmark and tagline arrive 0.3s, 0.42s and 0.72s after the card lands, and the camera push ends as the tagline finishes at 7.9s |
| Style | Seamless white floor, a radial gradient from `#ffffff` to `#eceef3`, with a soft shadow under the lid; one slate lid colour, ink `#14161f` and grey `#6b7185` for the card text, a blue mark gradient from `#7db3ff` to `#3a63f0`; Inter 700 for the wordmark and Inter 800 for sticker text (hello 96px italic, SHIP IT 72px, v2 112px); static film grain at 5% and a vignette at 11% |

## Why it works

The stickers land one at a time on a fixed 0.42s beat, so the viewer gets one clear event per beat and can count the pile growing. Each landing carries the same cues in the same order: a fall from above at 1.28x scale with a slight turn, a 2-frame squash (scaleX 1.07, scaleY 0.90) on contact, a small rebound and a settle, and a shadow that goes from large and faint to tight and dark on the contact frame. The lid drops 3px on the same frame, which tells the eye the stickers have weight. The twelve designs differ in shape, colour and outline (a round smiley, a wide bubble, a tall bolt, a pixel heart), so no two landings look alike, and all share a white die-cut border and a gloss highlight, so they read as one set of vinyl stickers. They land around a clear centre, which keeps the embossed mark visible until the last beat. The final slap is a white card, larger and heavier than the stickers with a 7px jolt, and it carries the lockup, so the product name arrives with the same gesture as everything before it.

## Prompt

> Build a 10.4-second, 1920x1080, 30 fps product film called Sticker Slap for a fictional laptop brand, Nimbus. Use one paused GSAP 3.14.2 timeline in HyperFrames; every change comes from the timeline. The frame is a seamless white floor (radial gradient from #ffffff to #eceef3) and the subject is a closed laptop lid seen from above, centred: 1320x850 px, corner radius 46 px, a matte slate gradient at 160° from #5b6b8e through #4b5979 to #3f4c69, a 2 px light line on the top edge, a darker #2f3a54 edge 12 px lower for thickness and a soft shadow on the floor. A debossed cloud mark (200x140 px) sits in the middle of the lid, and a faint white diagonal sheen (10% opacity) drifts across the lid for the whole film. Draw twelve die-cut stickers in SVG, each with a 13 px white border, a hairline at 16% black and a gloss gradient in the upper left: a smiley, a coffee cup, a speech bubble saying hello, a rainbow between two clouds, a ringed planet, a pixel heart, a lightning bolt, a SHIP IT label, a cat face, a star, a v2 badge and a cloud face, 190–400 px wide, in varied colours and turned between -12° and 14°. Give each sticker its own blurred shadow element (5 px blur) under it. Place them around the edges and corners and keep the centre free so the mark stays visible; landing order is stacking order, and each sticker lands in a different part of the lid than the one before. Timeline: the lid rises from 60 px below at 0.94x and fades in over 0.05–1.2 s (expo.out). Sticker i makes contact at 1.10 + 0.42·i s (last at 5.72 s). Each falls 80 px over 0.22 s (power2.in) from 1.28x scale with 12° extra rotation, fading in during the first 0.08 s; on contact it squashes to scaleX 1.07 and scaleY 0.90 in 0.07 s (2 frames), rebounds to scaleX 0.965 and scaleY 1.03 with 1.4° of counter-rotation in 0.1 s, then settles in 0.25 s (power2.out). The shadow starts at 1.4x scale, offset down and right, and rises to 16% opacity during the fall; at contact it goes to scale 1.02, 3 px below the sticker and 50% opacity, then relaxes to 36% over 0.3 s. On every contact the whole lid drops 3 px in 0.05 s and returns in 0.3 s (power2.out). Hold from 5.72 to 6.6 s. At 6.6 s a white 880x380 px card (radius 46 px, a 2 px #e9ebf2 inner outline) lands in the centre, falling 150 px from 1.4x scale and -5° over 0.26 s, with a squash of 1.035 and 0.94, a 7 px lid drop and a larger shadow (9 px blur). Then the mark (a 144 px rounded square with a blue gradient from #7db3ff to #3a63f0 and a white cloud) pops in at 6.9 s (0.55 s, back.out(1.8)), the wordmark nimbus (Inter 700, 168 px, letter-spacing -0.055em, #14161f) slides in 28 px from the left at 7.02 s (0.6 s, expo.out) and the tagline Make it yours. (Inter 500, 42 px, #6b7185) rises 16 px at 7.32 s (0.55 s, expo.out). A slow camera push from 1.00x to 1.03x runs 0–7.9 s (power1.inOut), and the film holds still for the last 2.5 s. Add a static film grain at 5% opacity and a vignette that darkens the corners by 11%. Hide every element in CSS with opacity 0 and reveal it with .to() tweens that name the final opacity. Use Inter for all text. For your own product, replace the lid colour, the mark, the wordmark, the tagline and the sticker designs.

## Often confused with

- [Pile-up and Clear](https://motionboard.app/r/pile-up-and-clear.md): Pile-up and Clear stacks items on a screen until it is full and then wipes it in one step; here the stickers land on one product surface and stay, and the last slap is the lockup card.
- [Dispense Line-up](https://motionboard.app/r/dispense-line-up.md): Dispense Line-up slides accessories out of one object into a tidy row; here the stickers drop in from above on a beat, overlap at different angles and cover the surface.

## Source files

Runnable HyperFrames project, 3 files.

- https://motionboard.app/source/sticker-slap/hyperframes.json (318 B)
- https://motionboard.app/source/sticker-slap/index.html (24.4 KB)
- https://motionboard.app/source/sticker-slap/package.json (301 B)

Download all of them:

```sh
curl -fsSL --create-dirs -o "sticker-slap/hyperframes.json" "https://motionboard.app/source/sticker-slap/hyperframes.json"
curl -fsSL --create-dirs -o "sticker-slap/index.html" "https://motionboard.app/source/sticker-slap/index.html"
curl -fsSL --create-dirs -o "sticker-slap/package.json" "https://motionboard.app/source/sticker-slap/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 {
        --ink: #14161f;
        --sub: #6b7185;
        --font-ui: "Inter", -apple-system, "SF Pro Text", "Helvetica Neue", sans-serif;
      }
      * { margin: 0; padding: 0; box-sizing: border-box; }
      html, body { width: 1920px; height: 1080px; overflow: hidden; background: #f4f5f8; }
      #root {
        position: relative; width: 1920px; height: 1080px; overflow: hidden;
        font-family: var(--font-ui); color: var(--ink); -webkit-font-smoothing: antialiased;
        background: radial-gradient(ellipse 75% 70% at 50% 46%, #ffffff 0%, #fbfbfc 45%, #eceef3 100%);
      }
      .full { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }
      svg { display: block; flex: none; }

      /* ---------- laptop ---------- */
      #lapIn { opacity: 0; }
      #floor {
        position: absolute; left: 300px; top: 122px; width: 1320px; height: 850px; border-radius: 46px; background: #2f3a54;
        box-shadow: 0 44px 80px -10px rgba(25, 35, 65, 0.30), 0 18px 30px rgba(25, 35, 65, 0.20), 0 3px 6px rgba(25, 35, 65, 0.28), 0 0 110px rgba(25, 35, 65, 0.10);
      }
      #jolt { position: absolute; left: 300px; top: 110px; width: 1320px; height: 850px; }
      #lid {
        position: absolute; left: 0; top: 0; width: 1320px; height: 850px; border-radius: 46px; overflow: hidden;
        background:
          radial-gradient(ellipse 60% 50% at 24% 12%, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0) 70%),
          linear-gradient(160deg, #5b6b8e 0%, #4b5979 55%, #3f4c69 100%);
        box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.26), inset 0 0 0 1px rgba(255, 255, 255, 0.07), inset 0 -3px 6px rgba(10, 15, 35, 0.22);
      }
      #sheenR { position: absolute; left: 0; top: -300px; width: 1320px; height: 1450px; transform: rotate(22deg); }
      #sheen { position: absolute; left: 480px; top: 0; width: 360px; height: 100%; background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.10) 50%, rgba(255, 255, 255, 0) 100%); }
      #emb { position: absolute; left: 560px; top: 355px; width: 200px; height: 140px; }

      /* ---------- stickers ---------- */
      .stk, .sh { position: absolute; opacity: 0; }
      .sh { filter: blur(5px); }

      /* ---------- lockup card ---------- */
      #h12 { background: #0b1124; border-radius: 46px; filter: blur(9px); }
      #s12 { background: #ffffff; border-radius: 46px; box-shadow: 0 0 0 1px rgba(10, 15, 35, 0.14); }
      #s12 .in { position: absolute; left: 14px; top: 14px; right: 14px; bottom: 14px; border: 2px solid #e9ebf2; border-radius: 34px; }
      #cRow { position: absolute; left: 0; top: 70px; width: 880px; display: flex; justify-content: center; align-items: center; gap: 38px; }
      #cMark { opacity: 0; }
      #cWm { font-size: 168px; line-height: 168px; font-weight: 700; letter-spacing: -0.055em; color: var(--ink); padding-bottom: 12px; opacity: 0; }
      #cTag { position: absolute; left: 0; top: 262px; width: 880px; text-align: center; font-size: 42px; line-height: 50px; font-weight: 500; color: var(--sub); letter-spacing: -0.01em; opacity: 0; }

      /* ---------- finish ---------- */
      #vig { pointer-events: none; z-index: 5; background: radial-gradient(ellipse at 50% 48%, rgba(25, 35, 65, 0) 62%, rgba(25, 35, 65, 0.11) 100%); }
      #grain { pointer-events: none; z-index: 6; opacity: 0.05; }
    </style>
  </head>
  <body>
    <div id="root" data-composition-id="main" data-start="0" data-duration="10.4" data-width="1920" data-height="1080">
      <div id="scene" class="clip full" data-start="0" data-duration="10.4" data-track-index="0">
        <div id="stage" class="full" data-layout-allow-overlap data-layout-ignore>
          <div id="lapIn" class="full" data-layout-allow-overlap data-layout-ignore>
            <div id="floor"></div>
            <div id="jolt" data-layout-allow-overlap data-layout-ignore>
              <div id="lid">
                <div id="sheenR"><div id="sheen"></div></div>
              </div>
              <svg id="emb" viewBox="-60 -48 120 84"></svg>
            </div>
          </div>
        </div>
      </div>

      <div id="vig" class="clip full" data-start="0" data-duration="10.4" data-track-index="1"></div>
      <div id="grain" class="clip full" data-start="0" data-duration="10.4" data-track-index="2"></div>
    </div>

    <script>
      const EXPO = "expo.out";
      const DK = "#1b1d2b";
      const BW = 26;

      /* ---------- shared shapes ---------- */
      const CLOUD = '<circle cx="-30" cy="2" r="22"/><circle cx="0" cy="-10" r="30"/><circle cx="30" cy="0" r="22"/><rect x="-52" y="0" width="104" height="28" rx="14"/>';
      const HEARTP = "M12 21s-7-4.6-9.3-9.2C1 8.3 3 5 6.4 5c2 0 3.6 1.2 5.6 3.2C14 6.2 15.6 5 17.6 5 21 5 23 8.3 21.3 11.8 19 16.4 12 21 12 21z";
      const pts = (a) => a.map((p) => p[0].toFixed(1) + "," + p[1].toFixed(1)).join(" ");
      const starPts = (cx, cy, R, r, n, a0) => {
        const o = [];
        for (let i = 0; i < n * 2; i++) {
          const a = a0 + (Math.PI * i) / n, rr = i % 2 ? r : R;
          o.push([cx + rr * Math.cos(a), cy + rr * Math.sin(a)]);
        }
        return o;
      };

      /* ---------- sticker designs: { sil, art } in art coordinates 0..w, 0..h ---------- */
      function smiley(p) {
        return {
          sil: '<circle cx="135" cy="135" r="135"/>',
          art:
            '<defs><radialGradient id="' + p + 'g" cx=".35" cy=".28" r=".85"><stop offset="0" stop-color="#ffe985"/><stop offset="1" stop-color="#ffbf14"/></radialGradient></defs>' +
            '<circle cx="135" cy="135" r="135" fill="url(#' + p + 'g)"/>' +
            '<ellipse cx="95" cy="108" rx="15" ry="27" fill="#2b2118"/><ellipse cx="175" cy="108" rx="15" ry="27" fill="#2b2118"/>' +
            '<ellipse cx="100" cy="95" rx="5" ry="8" fill="#fff" opacity=".85"/><ellipse cx="180" cy="95" rx="5" ry="8" fill="#fff" opacity=".85"/>' +
            '<circle cx="56" cy="164" r="18" fill="#ff8f6b" opacity=".55"/><circle cx="214" cy="164" r="18" fill="#ff8f6b" opacity=".55"/>' +
            '<path d="M68 166 Q135 244 202 166" fill="none" stroke="#2b2118" stroke-width="15" stroke-linecap="round"/>',
        };
      }
      function cup(p) {
        const body = "M20 80 H190 V170 Q190 240 120 240 H90 Q20 240 20 170 Z";
        const handle = "M190 105 H208 Q238 105 238 138 Q238 172 208 172 H190";
        const steam = [70, 105, 140].map((x) => "M" + x + " 60 q -12 -14 0 -28 t 0 -28");
        return {
          sil:
            '<path d="' + body + '"/><ellipse cx="105" cy="80" rx="85" ry="20"/>' +
            '<path d="' + handle + '" fill="none" stroke-width="56"/>' +
            steam.map((d) => '<path d="' + d + '" fill="none" stroke-width="34"/>').join(""),
          art:
            steam.map((d) => '<path d="' + d + '" fill="none" stroke="#8f98b3" stroke-width="10" stroke-linecap="round"/>').join("") +
            '<path d="' + handle + '" fill="none" stroke="#ff8a3d" stroke-width="22"/>' +
            '<path d="' + body + '" fill="#ff8a3d"/>' +
            '<path d="M40 112 V170" stroke="#fff" stroke-opacity=".38" stroke-width="9" stroke-linecap="round"/>' +
            '<ellipse cx="105" cy="80" rx="85" ry="20" fill="#5b341f" stroke="#ffb27a" stroke-width="5"/>' +
            '<g transform="translate(75 134) scale(2.5)"><path d="' + HEARTP + '" fill="#fff" transform="translate(0 -4)"/></g>',
        };
      }
      function hello(p) {
        const squig = "M96 126" + " q10 -12 20 0" + " t20 0".repeat(9);
        return {
          sil: '<rect x="0" y="0" width="400" height="150" rx="75"/><path d="M70 130 L48 178 L118 140 Z"/>',
          art:
            '<rect x="0" y="0" width="400" height="150" rx="75" fill="#ff4d6d"/><path d="M70 130 L48 178 L118 140 Z" fill="#ff4d6d"/>' +
            '<text x="200" y="104" text-anchor="middle" font-family="Inter, sans-serif" font-weight="800" font-style="italic" font-size="96" letter-spacing="-2" fill="#fff">hello</text>' +
            '<path d="' + squig + '" fill="none" stroke="#ffe066" stroke-width="6" stroke-linecap="round"/>',
        };
      }
      function rainbow(p) {
        const R = [[175, "#ff4d6d"], [149, "#ff9f1c"], [123, "#ffd43b"], [97, "#2ec27e"], [71, "#3d8bff"], [45, "#8b5cf6"]];
        const arcs = R.map(([r, c]) => '<path d="M' + (200 - r) + " 200 A" + r + " " + r + " 0 0 1 " + (200 + r) + ' 200" fill="none" stroke="' + c + '" stroke-width="29"/>').join("");
        const cl = (x) => 'transform="translate(' + x + ' 190) scale(1.2)"';
        return {
          sil: '<path d="M11 200 A189 189 0 0 1 389 200 Z"/><g ' + cl(58) + ' stroke-width="21.7">' + CLOUD + "</g><g " + cl(342) + ' stroke-width="21.7">' + CLOUD + "</g>",
          art: arcs + "<g " + cl(58) + ' fill="#dcebff">' + CLOUD + "</g><g " + cl(342) + ' fill="#dcebff">' + CLOUD + "</g>",
        };
      }
      function planet(p) {
        const rot = 'transform="rotate(-20 140 125)"';
        return {
          sil: '<circle cx="140" cy="125" r="80"/><ellipse cx="140" cy="125" rx="130" ry="34" fill="none" stroke-width="54" ' + rot + "/>",
          art:
            '<defs><clipPath id="' + p + 'c"><circle cx="140" cy="125" r="80"/></clipPath></defs>' +
            "<g " + rot + '><ellipse cx="140" cy="125" rx="130" ry="34" fill="none" stroke="' + DK + '" stroke-width="30"/><ellipse cx="140" cy="125" rx="130" ry="34" fill="none" stroke="#ffc857" stroke-width="20"/></g>' +
            '<circle cx="140" cy="125" r="80" fill="#6c5ce7"/>' +
            '<g clip-path="url(#' + p + 'c)"><g ' + rot + '><rect x="40" y="80" width="200" height="16" fill="#8977f5"/><rect x="40" y="110" width="200" height="22" fill="#5a49d6"/><rect x="40" y="146" width="200" height="12" fill="#8977f5"/></g>' +
            '<circle cx="112" cy="95" r="24" fill="#fff" opacity=".22"/></g>' +
            '<circle cx="140" cy="125" r="80" fill="none" stroke="' + DK + '" stroke-width="8"/>' +
            "<g " + rot + '><path d="M10 125 A130 34 0 0 0 270 125" fill="none" stroke="' + DK + '" stroke-width="30"/><path d="M10 125 A130 34 0 0 0 270 125" fill="none" stroke="#ffc857" stroke-width="20"/></g>',
        };
      }
      const HEART = ["01110001110", "11111011111", "11111111111", "11111111111", "11111111111", "01111111110", "00111111100", "00011111000", "00001110000", "00000100000"];
      function heart(p) {
        const C = 20, ox = 1, oy = 1, cols = 13, rows = 12;
        const on = (r, c) => { const rr = r - oy, cc = c - ox; return rr >= 0 && rr < 10 && cc >= 0 && cc < 11 && HEART[rr][cc] === "1"; };
        const cell = (r, c) => "M" + c * C + " " + r * C + "h" + C + "v" + C + "h-" + C + "Z";
        let fill = "", hi = "", lo = "", out = "", all = "";
        for (let r = 0; r < rows; r++) {
          for (let c = 0; c < cols; c++) {
            const rr = r - oy, cc = c - ox;
            if (on(r, c)) {
              all += cell(r, c);
              if ((rr === 1 && (cc === 1 || cc === 2)) || (rr === 2 && cc === 1)) hi += cell(r, c);
              else if ((rr >= 5 && cc >= 6) || (rr >= 3 && cc >= 9)) lo += cell(r, c);
              else fill += cell(r, c);
            } else {
              let n = false;
              for (let dr = -1; dr <= 1; dr++) for (let dc = -1; dc <= 1; dc++) if ((dr || dc) && on(r + dr, c + dc)) n = true;
              if (n) { out += cell(r, c); all += cell(r, c); }
            }
          }
        }
        return {
          sil: '<path d="' + all + '"/>',
          art:
            '<path d="' + out + '" fill="#4a0f26" stroke="#4a0f26" stroke-width="1"/>' +
            '<path d="' + fill + '" fill="#ff3b5c" stroke="#ff3b5c" stroke-width="1"/>' +
            '<path d="' + lo + '" fill="#d11f45" stroke="#d11f45" stroke-width="1"/>' +
            '<path d="' + hi + '" fill="#ff8fa3" stroke="#ff8fa3" stroke-width="1"/>',
        };
      }
      function bolt(p) {
        const d = "M125 0 L8 165 H84 L52 290 L182 108 H104 Z";
        return {
          sil: '<path d="' + d + '"/>',
          art:
            '<defs><linearGradient id="' + p + 'g" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#ffee62"/><stop offset="1" stop-color="#ffb300"/></linearGradient></defs>' +
            '<path d="' + d + '" fill="url(#' + p + 'g)" stroke="' + DK + '" stroke-width="9" stroke-linejoin="round"/>',
        };
      }
      function ship(p) {
        return {
          sil: '<rect x="0" y="0" width="380" height="130" rx="26"/>',
          art:
            '<rect x="0" y="0" width="380" height="130" rx="26" fill="#c4f53d"/>' +
            '<rect x="10" y="10" width="360" height="110" rx="17" fill="none" stroke="' + DK + '" stroke-width="3" stroke-dasharray="12 9"/>' +
            '<text x="190" y="89" text-anchor="middle" font-family="Inter, sans-serif" font-weight="800" font-size="72" letter-spacing="3" fill="' + DK + '">SHIP IT</text>',
        };
      }
      function cat(p) {
        const head = '<ellipse cx="130" cy="142" rx="108" ry="88"/><polygon points="38,100 34,14 112,58"/><polygon points="222,100 226,14 148,58"/>';
        return {
          sil: head,
          art:
            '<g fill="' + DK + '" stroke="' + DK + '" stroke-width="14" stroke-linejoin="round">' + head + "</g>" +
            '<g fill="#ffb347">' + head + "</g>" +
            '<polygon points="50,86 48,38 88,62" fill="#ff8fa3"/><polygon points="210,86 212,38 172,62" fill="#ff8fa3"/>' +
            '<g stroke="#e07a1f" stroke-width="9" stroke-linecap="round" fill="none"><path d="M130 62 V84"/><path d="M104 66 L110 86"/><path d="M156 66 L150 86"/></g>' +
            '<ellipse cx="130" cy="176" rx="38" ry="28" fill="#fff3e0"/>' +
            '<circle cx="62" cy="170" r="14" fill="#ff8fa3" opacity=".6"/><circle cx="198" cy="170" r="14" fill="#ff8fa3" opacity=".6"/>' +
            '<ellipse cx="90" cy="136" rx="11" ry="15" fill="' + DK + '"/><ellipse cx="170" cy="136" rx="11" ry="15" fill="' + DK + '"/>' +
            '<circle cx="94" cy="130" r="4" fill="#fff"/><circle cx="174" cy="130" r="4" fill="#fff"/>' +
            '<path d="M119 160 H141 L130 173 Z" fill="#ff7a93"/>' +
            '<path d="M130 173 V181 M130 181 Q119 195 106 183 M130 181 Q141 195 154 183" fill="none" stroke="' + DK + '" stroke-width="5" stroke-linecap="round"/>' +
            '<path d="M40 150 L74 156 M38 174 L72 172 M220 150 L186 156 M222 174 L188 172" fill="none" stroke="' + DK + '" stroke-width="4" stroke-linecap="round"/>',
        };
      }
      function star(p) {
        const sp = pts(starPts(140, 148, 122, 56, 5, -Math.PI / 2));
        return {
          sil: '<polygon points="' + sp + '" stroke-width="52"/>',
          art:
            '<polygon points="' + sp + '" fill="' + DK + '" stroke="' + DK + '" stroke-width="26" stroke-linejoin="round"/>' +
            '<polygon points="' + sp + '" fill="#ff4fa3" stroke="#ff4fa3" stroke-width="12" stroke-linejoin="round"/>' +
            '<path d="M108 116 Q110 128 122 130 Q110 132 108 144 Q106 132 94 130 Q106 128 108 116 Z" fill="#fff" opacity=".9"/>' +
            '<circle cx="124" cy="152" r="7" fill="' + DK + '"/><circle cx="156" cy="152" r="7" fill="' + DK + '"/>' +
            '<path d="M126 168 Q140 183 154 168" fill="none" stroke="' + DK + '" stroke-width="6" stroke-linecap="round"/>',
        };
      }
      function badge(p) {
        const sp = pts(starPts(115, 115, 114, 102, 16, -Math.PI / 2));
        return {
          sil: '<polygon points="' + sp + '"/>',
          art:
            '<polygon points="' + sp + '" fill="#2f7bff" stroke="#2f7bff" stroke-width="8" stroke-linejoin="round"/>' +
            '<circle cx="115" cy="115" r="88" fill="none" stroke="#fff" stroke-opacity=".85" stroke-width="4" stroke-dasharray="2 10" stroke-linecap="round"/>' +
            '<text x="115" y="154" text-anchor="middle" font-family="Inter, sans-serif" font-weight="800" font-size="112" letter-spacing="-4" fill="#fff">v2</text>',
        };
      }
      function cloud(p) {
        const tr = 'transform="translate(125 98) scale(2.4)"';
        return {
          sil: "<g " + tr + ' stroke-width="16.7">' + CLOUD + "</g>",
          art:
            "<g " + tr + ' fill="' + DK + '" stroke="' + DK + '" stroke-width="6" stroke-linejoin="round">' + CLOUD + "</g>" +
            "<g " + tr + ' fill="#bfe3ff">' + CLOUD + "</g>" +
            '<ellipse cx="100" cy="100" rx="7" ry="10" fill="' + DK + '"/><ellipse cx="150" cy="100" rx="7" ry="10" fill="' + DK + '"/>' +
            '<circle cx="84" cy="122" r="10" fill="#ff8fa3" opacity=".65"/><circle cx="166" cy="122" r="10" fill="#ff8fa3" opacity=".65"/>' +
            '<path d="M110 122 Q125 140 140 122" fill="none" stroke="' + DK + '" stroke-width="5" stroke-linecap="round"/>',
        };
      }

      /* landing order is also stacking order */
      const ST = [
        { w: 270, h: 270, cx: 190, cy: 185, r: -8, build: smiley },
        { w: 250, h: 250, cx: 1160, cy: 485, r: 8, build: cup },
        { w: 400, h: 180, cx: 905, cy: 130, r: 5, build: hello },
        { w: 400, h: 225, cx: 440, cy: 695, r: -6, build: rainbow },
        { w: 280, h: 250, cx: 900, cy: 700, r: -10, build: planet },
        { w: 260, h: 240, cx: 160, cy: 505, r: -6, build: heart },
        { w: 190, h: 290, k: 0.85, cx: 610, cy: 160, r: 12, build: bolt },
        { w: 380, h: 130, cx: 1090, cy: 305, r: -5, build: ship },
        { w: 260, h: 240, k: 0.95, cx: 1160, cy: 690, r: 6, build: cat, bw: 40 },
        { w: 280, h: 280, k: 0.9, cx: 420, cy: 195, r: 14, build: star },
        { w: 230, h: 230, cx: 140, cy: 710, r: -12, build: badge },
        { w: 250, h: 170, cx: 1185, cy: 120, r: -4, build: cloud, bw: 40 },
      ];

      function svgOf(d, p, shadow) {
        const vw = d.w + 30, vh = d.h + 30, k = d.k || 1, sw = d.bw || BW;
        const head = '<svg width="' + (vw * k).toFixed(1) + '" height="' + (vh * k).toFixed(1) + '" viewBox="-15 -15 ' + vw + " " + vh + '">';
        const g = (fill, extra) => '<g fill="' + fill + '" stroke="' + fill + '" stroke-width="' + sw + '" stroke-linejoin="round" stroke-linecap="round" ' + (extra || "") + ">" + d.sil + "</g>";
        const b = d.build(p);
        if (shadow) return head + g("#0b1124") + "</svg>";
        return (
          head +
          '<g fill="#000" stroke="#000" opacity=".16" stroke-width="' + (sw + 3) + '" stroke-linejoin="round" stroke-linecap="round">' + d.sil + "</g>" +
          g("#fff") +
          b.art +
          '<defs><mask id="' + p + 'm" maskUnits="userSpaceOnUse" x="-15" y="-15" width="' + vw + '" height="' + vh + '">' + g("#fff") + "</mask>" +
          '<linearGradient id="' + p + 'gl" gradientUnits="userSpaceOnUse" x1="-15" y1="-15" x2="' + (vw - 15) + '" y2="' + (vh - 15) + '"><stop offset="0" stop-color="#fff" stop-opacity=".30"/><stop offset=".42" stop-color="#fff" stop-opacity="0"/></linearGradient></defs>' +
          '<rect x="-15" y="-15" width="' + vw + '" height="' + vh + '" fill="url(#' + p + 'gl)" mask="url(#' + p + 'm)"/></svg>'
        );
      }

      /* ---------- build the DOM ---------- */
      const CLOUDG = (fill) => '<g fill="' + fill + '">' + CLOUD + "</g>";
      document.getElementById("emb").innerHTML =
        '<g transform="translate(0 -1.6)">' + CLOUDG("rgba(10,15,35,.38)") + "</g>" +
        '<g transform="translate(0 1.6)">' + CLOUDG("rgba(255,255,255,.2)") + "</g>" +
        CLOUDG("#4b5a7a");

      let html = "";
      ST.forEach((d, i) => {
        const k = d.k || 1, bw = (d.w + 30) * k, bh = (d.h + 30) * k;
        const pos = "left:" + (d.cx - bw / 2).toFixed(1) + "px;top:" + (d.cy - bh / 2).toFixed(1) + "px;width:" + bw.toFixed(1) + "px;height:" + bh.toFixed(1) + "px;";
        html += '<div class="sh" id="h' + i + '" style="' + pos + '" data-layout-allow-overlap data-layout-ignore>' + svgOf(d, "p" + i, true) + "</div>";
        html += '<div class="stk" id="s' + i + '" style="' + pos + '" data-layout-allow-overlap data-layout-ignore>' + svgOf(d, "p" + i, false) + "</div>";
      });
      const CARD = { x: 220, y: 235, w: 880, h: 380 };
      const cardPos = "left:" + CARD.x + "px;top:" + CARD.y + "px;width:" + CARD.w + "px;height:" + CARD.h + "px;";
      html += '<div class="sh" id="h12" style="' + cardPos + '" data-layout-allow-overlap data-layout-ignore></div>';
      html +=
        '<div class="stk" id="s12" style="' + cardPos + '" data-layout-allow-overlap data-layout-ignore>' +
        '<div class="in"></div>' +
        '<div id="cRow"><div id="cMark"></div><div id="cWm">nimbus</div></div>' +
        '<div id="cTag">Make it yours.</div></div>';
      document.getElementById("jolt").insertAdjacentHTML("beforeend", html);

      document.getElementById("cMark").innerHTML =
        '<svg width="144" height="144" viewBox="0 0 100 100"><defs><linearGradient id="mkg" x1="0" y1="0" x2="0" y2="100" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7db3ff"/><stop offset="1" stop-color="#3a63f0"/></linearGradient></defs>' +
        '<rect width="100" height="100" rx="27" fill="url(#mkg)"/><g transform="translate(50 54) scale(.6)" fill="#fff">' + CLOUD + "</g></svg>";

      /* film grain, static */
      const noise =
        "<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(#n)'/></svg>";
      document.getElementById("grain").style.backgroundImage = 'url("data:image/svg+xml,' + encodeURIComponent(noise) + '")';

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

      /* one slap: fall, squash on contact, rebound, settle; shadow tightens on contact; the lid jolts */
      function slap(i, T, o) {
        const st = "#s" + i, sh = "#h" + i;
        tl.set(st, { y: -o.fall, scale: o.s0, rotation: o.r + o.rf, transformOrigin: "50% 60%" }, 0);
        tl.set(sh, { x: o.fall * 0.2, y: o.fall * 0.5, scale: 1.4, rotation: o.r }, 0);
        tl.to(st, { opacity: 1, duration: 0.08, ease: "none" }, T - o.air);
        tl.to(st, { y: 0, scale: 1, rotation: o.r, duration: o.air, ease: "power2.in" }, T - o.air);
        tl.to(sh, { opacity: 0.16, x: o.fall * 0.08, y: o.fall * 0.22, scale: 1.18, duration: o.air, ease: "power2.in" }, T - o.air);
        tl.to(st, { scaleX: o.sqx, scaleY: o.sqy, duration: 0.07, ease: "power1.out" }, T);
        tl.to(sh, { opacity: 0.5, x: 0, y: 3, scale: 1.02, duration: 0.07, ease: "power2.out" }, T);
        tl.to(st, { scaleX: 2 - o.sqx * 0.5 - 0.5, scaleY: 1.03, rotation: o.r - 1.4, duration: 0.1, ease: "power2.out" }, T + 0.07);
        tl.to(sh, { opacity: 0.36, scale: 1, duration: 0.3, ease: "power2.out" }, T + 0.07);
        tl.to(st, { scaleX: 1, scaleY: 1, rotation: o.r, duration: 0.25, ease: "power2.out" }, T + 0.17);
        tl.to("#jolt", { y: o.jolt, duration: 0.05, ease: "power1.out" }, T);
        tl.to("#jolt", { y: 0, duration: 0.3, ease: "power2.out" }, T + 0.05);
      }

      /* 0. camera push over the whole build, then it holds still */
      tl.set("#stage", { transformOrigin: "50% 50%" }, 0);
      tl.to("#stage", { scale: 1.03, duration: 7.9, ease: "power1.inOut" }, 0);

      /* 1. the lid rises into the seamless white (0.05 – 1.2) */
      tl.set("#lapIn", { y: 60, scale: 0.94, transformOrigin: "50% 50%" }, 0);
      tl.to("#lapIn", { opacity: 1, y: 0, scale: 1, duration: 1.15, ease: EXPO }, 0.05);
      tl.set("#sheen", { x: -900 }, 0);
      tl.to("#sheen", { x: 900, duration: DUR, ease: "none" }, 0);

      /* 2. twelve stickers on a steady beat (contact at 1.10, 1.52 ... 5.72) */
      ST.forEach((d, i) => {
        const T = 1.1 + 0.42 * i;
        slap(i, T, { r: d.r, rf: i % 2 ? -12 : 12, fall: 80, s0: 1.28, air: 0.22, sqx: 1.07, sqy: 0.9, jolt: 3 });
      });

      /* 3. the Nimbus card slaps on last (contact 6.6), then its content settles (by 7.9) and holds */
      const TC = 6.6;
      slap(12, TC, { r: 0, rf: -5, fall: 150, s0: 1.4, air: 0.26, sqx: 1.035, sqy: 0.94, jolt: 7 });
      tl.set("#cMark", { scale: 0.55 }, 0);
      tl.set("#cWm", { x: -28 }, 0);
      tl.set("#cTag", { y: 16 }, 0);
      tl.to("#cMark", { opacity: 1, scale: 1, duration: 0.55, ease: "back.out(1.8)" }, TC + 0.3);
      tl.to("#cWm", { opacity: 1, x: 0, duration: 0.6, ease: EXPO }, TC + 0.42);
      tl.to("#cTag", { opacity: 1, y: 0, duration: 0.55, ease: EXPO }, TC + 0.72);

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