# QR Code Animation

Motionboard shot name: QR End Card

A light end card for Tide: the mark, the name, a two-line pitch and two store buttons on the left, a large white card on the right. The three corner squares of a QR code land, the rest of the code fills in along a diagonal, the Tide mark pops in at its centre, and one scan beam sweeps it from top to bottom before the card holds still. The code is real and opens motionboard.app; the Linear card in the original is static, so the build-in is our recreation.

- Position in a launch film: Ending
- Slug: qr-code-animation
- Preview video: https://media.motionboard.app/qr-endcard.mp4
- Recipe page: https://motionboard.app/recipes/qr-code-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 `qr-endcard`. 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.5s. Card rises 0.2–1.3s; mark tile 0.5–1.3s, the word Tide 0.7–1.6s, pitch lines 1.1–2.0s and 1.3–2.2s, store buttons 1.8–2.6s and 1.95–2.75s; three finder patterns land at 1.4s, 1.55s and 1.7s (0.6s each); data modules build 2.4–3.65s; centre tile pops in 4.1–4.8s; scan beam 5.2–7.2s; ring pulse 7.1–8.0s; the card holds still from 8.0s to the end |
| Easing | Card rise, word, pitch lines and buttons use expo.out; mark tile uses back.out(1.6); finder patterns use back.out(1.8); modules use back.out(2) over 0.3s each; centre tile uses back.out(2.2); scan beam uses power1.inOut over 2.0s; ring pulse and halo use power2.out |
| Camera | Locked camera with no drift or zoom. The 29x29 matrix is generated from a constant of 29 strings, and a seeded PRNG (mulberry32) gives each module a small start offset, so every frame is repeatable |
| Subject | White card 700x700px with 56px corners at (1070, 190). QR 580x580px inside it: 29x29 modules on a 20px grid, each an 18px rounded square with a 5px radius, with a 3-module (60px) quiet zone. The matrix encodes https://motionboard.app with error correction H. Centre tile 128px with 36px corners holding a 94px teal tile and a 62px wave mark, inside the middle 7x7 modules (140px). Left column at x=140: 132px mark tile with 38px corners, Tide at 132px weight 800, a two-line pitch at 54px weight 700, two pill buttons 104px high with 32px labels and 46px icons |
| Sync | The finder patterns settle at 2.3s, before any data module, so the shape reads as a QR code at once; the data modules start 0.1s later at 2.4s; the centre tile pops 0.45s after the last module settles (3.65s to 4.1s); the scan starts 0.4s after the tile settles (4.8s to 5.2s); the ring pulses as the beam leaves at 7.1s; the line Scan to download. is on screen from 2.2s, so the words are already there when the code is built |
| Style | Paper `#eceef1`, ink `#0d0f13`, one accent teal `#0d9488` (`#0b7f75` for the second pitch line); Inter, weights 600–800; card shadow 0 50px 110px at 16% ink; a teal halo behind the card at 20% and a vignette at 7% at the edges; no grain |

## Why it works

The code is the subject and it builds in the order a scanner finds it. The three finder patterns land first, so the viewer reads a QR code before it is complete. The data modules then fill in along a diagonal from the top left, which reads as one wave that ends in the bottom right corner. The centre tile pops in after the pattern is already readable, and one scan beam sweeps the code once to say what it is for. The code is real and scannable at every moment it is complete: dark modules on white, a 3-module quiet zone, error correction H, and the centre tile covers no more than the middle 7x7 modules. The text sits left and the code right, so the eye reads the pitch while the code builds, and the card holds still for the last 2.5s, long enough to point a phone at it. Two colours carry the frame, ink #0d0f13 and one teal accent #0d9488, on paper #eceef1.

## Prompt

> Build a 10.5-second, 1920x1080, 30 fps light product end card called QR Code Animation for a fictional product, Tide (a mobile task app). Paper #eceef1, ink #0d0f13, one accent teal #0d9488, font Inter. Left column at x=140, centred vertically: a 132px teal mark tile (38px corners, three white wave strokes) next to the word Tide at 132px, weight 800, letter-spacing -0.045em; below it two pitch lines at 54px, weight 700: Your tasks, in your pocket. in ink and Scan to download. in #0b7f75; below that two ink pill buttons, 104px high, each with a 46px download-arrow icon and a 32px white label (Download for iOS, Get it for Android), generic shapes with no store logos. Right: a white card 700x700px with 56px corners at (1070, 190) and a soft shadow (0 50px 110px at 16% ink). Inside it a QR code 580x580px with 60px of padding, which leaves a 3-module quiet zone. Generate a real QR code for your own URL with error correction H (this film uses https://motionboard.app, 29x29 modules) and paste its rows into the file as a constant of 29 strings of 0 and 1. Draw each dark module as an 18px rounded square (5px radius) on a 20px grid, and put each of the three 7x7 finder patterns in its own wrapper so it can scale as one. Use one paused GSAP timeline, hide everything in CSS with opacity 0 and tween to explicit end values. Card rises from 56px below 0.2–1.3s (expo.out); a teal halo (radial gradient, 1240px, 20% opacity, centred behind the card) fades in 0.4–2.4s; the mark tile scales 0.5→1 at 0.5s (0.8s, back.out(1.6)); Tide, the two pitch lines and the two buttons rise 44px and fade in at 0.7s, 1.1s, 1.3s, 1.8s and 1.95s (0.8–0.9s each, expo.out); the three finder patterns scale 0.2→1 at 1.4s, 1.55s and 1.7s (0.6s each, back.out(1.8)); every other dark module scales 0→1 over 0.3s (back.out(2)) starting at 2.4s + ((row + col) / 56) × 0.82s + a seeded random (mulberry32) × 0.12s, so a diagonal wave crosses the code and finishes at about 3.65s. At 4.1s a 128px white tile with 36px corners, holding a 94px teal tile and a 62px wave mark, pops in at the centre (0.7s, back.out(2.2)); it covers no more than the middle 7x7 modules. Scan: a 240px tall band across the card, clipped to the card, with a gradient from transparent to 30% teal and a 5px solid teal edge with an 18px glow, moves from above the card to below it over 5.2–7.2s (power1.inOut), fading in at the start and out from 6.95s. At 7.1s a 5px teal ring the size of the card scales to 1.07 and fades from 55% to 0 over 0.9s (power2.out). From 8.0s to 10.5s nothing moves: the held card is the lockup. Keep the code dark on white so it scans, and test it with a phone. Add a vignette at 7%, no grain, and no CSS transforms on elements that GSAP animates.

## Often confused with

- [Dot Matrix Animation](https://motionboard.app/r/dot-matrix-animation.md): Dot Matrix Animation snaps a graphic onto a round dot display that keeps changing; in QR Code Animation the grid is a real, scannable code that builds in once on a diagonal and then holds still as the end card.
- [Logo Wordmark Reveal](https://motionboard.app/r/logo-wordmark-reveal.md): Mark-to-Wordmark Unfold ends on a mark and a name; here the end card also carries a two-line pitch, two store buttons and a QR code that builds in module by module next to the mark.

## Source files

Runnable HyperFrames project, 3 files.

- https://motionboard.app/source/qr-endcard/hyperframes.json (318 B)
- https://motionboard.app/source/qr-endcard/index.html (12.5 KB)
- https://motionboard.app/source/qr-endcard/package.json (299 B)

Download all of them:

```sh
curl -fsSL --create-dirs -o "qr-endcard/hyperframes.json" "https://motionboard.app/source/qr-endcard/hyperframes.json"
curl -fsSL --create-dirs -o "qr-endcard/index.html" "https://motionboard.app/source/qr-endcard/index.html"
curl -fsSL --create-dirs -o "qr-endcard/package.json" "https://motionboard.app/source/qr-endcard/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 {
        --paper: #eceef1;
        --ink: #0d0f13;
        --acc: #0d9488;
        --acc-deep: #0b7f75;
        --mute: #566069;
        --font-ui: "Inter", sans-serif;
      }
      * { margin: 0; padding: 0; box-sizing: border-box; }
      html, body { width: 1920px; height: 1080px; overflow: hidden; background: var(--paper); }
      #root { position: relative; width: 1920px; height: 1080px; overflow: hidden; background: var(--paper); font-family: var(--font-ui); color: var(--ink); -webkit-font-smoothing: antialiased; }
      .full { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }

      #bg { background: radial-gradient(1400px 900px at 62% 50%, #f4f5f7 0%, #eceef1 55%, #e4e6ea 100%); }
      #halo { opacity: 0; }
      #halo .h { position: absolute; left: 1420px; top: 540px; width: 0; height: 0; }
      #halo .h i { position: absolute; left: -620px; top: -620px; width: 1240px; height: 1240px; border-radius: 50%; background: radial-gradient(circle, rgba(13,148,136,0.20) 0%, rgba(13,148,136,0.08) 42%, rgba(13,148,136,0) 70%); }
      #vig { background: radial-gradient(ellipse at 50% 50%, rgba(13,15,19,0) 58%, rgba(13,15,19,0.07) 100%); }

      /* ---------- left column ---------- */
      #left { position: absolute; left: 140px; top: 0; width: 900px; height: 1080px; display: flex; flex-direction: column; justify-content: center; }
      .brand { display: flex; align-items: center; gap: 36px; }
      .mk { width: 132px; height: 132px; border-radius: 38px; background: linear-gradient(160deg, #14b0a1 0%, #0d9488 55%, #0a766d 100%); box-shadow: 0 18px 40px rgba(13,148,136,0.30), inset 0 2px 0 rgba(255,255,255,0.28); display: flex; align-items: center; justify-content: center; opacity: 0; }
      .mk svg { width: 86px; height: 86px; }
      .wm { font-size: 132px; font-weight: 800; letter-spacing: -0.045em; line-height: 1; color: var(--ink); opacity: 0; }
      .pitch { margin-top: 64px; }
      .pitch div { font-size: 54px; line-height: 1.28; letter-spacing: -0.02em; opacity: 0; white-space: nowrap; }
      .p1 { font-weight: 700; color: var(--ink); }
      .p2 { font-weight: 700; color: var(--acc-deep); }
      .badges { margin-top: 60px; display: flex; gap: 20px; }
      .badge { height: 104px; padding: 0 34px 0 28px; border-radius: 52px; background: var(--ink); color: #fff; display: flex; align-items: center; gap: 16px; font-size: 32px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; opacity: 0; box-shadow: 0 10px 24px rgba(13,15,19,0.18); }
      .badge svg { width: 46px; height: 46px; flex: none; }

      /* ---------- card + QR ---------- */
      #card { position: absolute; left: 1070px; top: 190px; width: 700px; height: 700px; border-radius: 56px; background: #fff; box-shadow: 0 50px 110px rgba(13,15,19,0.16), 0 3px 8px rgba(13,15,19,0.07); opacity: 0; }
      #ring { position: absolute; left: 1070px; top: 190px; width: 700px; height: 700px; border-radius: 56px; border: 5px solid var(--acc); opacity: 0; }
      #qr { position: absolute; left: 60px; top: 60px; width: 580px; height: 580px; }
      .m { position: absolute; width: 18px; height: 18px; border-radius: 5px; background: var(--ink); opacity: 0; }
      .fnd { position: absolute; width: 140px; height: 140px; opacity: 0; }
      .fnd .m { opacity: 1; }
      #tileWrap { position: absolute; left: 286px; top: 286px; width: 128px; height: 128px; }
      .tile { width: 128px; height: 128px; border-radius: 36px; background: #fff; box-shadow: 0 8px 22px rgba(13,15,19,0.18), 0 0 0 1px rgba(13,15,19,0.06); display: flex; align-items: center; justify-content: center; opacity: 0; }
      .tile .in { width: 94px; height: 94px; border-radius: 28px; background: linear-gradient(160deg, #14b0a1 0%, #0d9488 55%, #0a766d 100%); display: flex; align-items: center; justify-content: center; }
      .tile svg { width: 62px; height: 62px; }
      #scanClip { position: absolute; left: 0; top: 0; width: 700px; height: 700px; border-radius: 56px; overflow: hidden; pointer-events: none; }
      .band { position: absolute; left: 0; top: 0; width: 700px; height: 240px; opacity: 0; background: linear-gradient(to bottom, rgba(13,148,136,0) 0%, rgba(13,148,136,0.10) 55%, rgba(13,148,136,0.30) 100%); }
      .band b { position: absolute; left: 24px; right: 24px; bottom: 0; height: 5px; border-radius: 3px; background: var(--acc); box-shadow: 0 0 18px 3px rgba(13,148,136,0.45); }
    </style>
  </head>
  <body>
    <div id="root" data-composition-id="main" data-start="0" data-duration="10.5" data-width="1920" data-height="1080">
      <div id="bg" class="clip full" data-start="0" data-duration="10.5" data-track-index="0" data-layout-ignore></div>
      <div id="halo" class="clip full" data-start="0" data-duration="10.5" data-track-index="1" data-layout-ignore><div class="h"><i></i></div></div>

      <div id="stage" class="clip full" data-start="0" data-duration="10.5" data-track-index="2" data-layout-allow-overlap>
        <div id="left">
          <div class="brand">
            <div class="mk">
              <svg viewBox="0 0 100 100" fill="none" stroke="#fff" stroke-width="9" stroke-linecap="round"><path d="M16 30 C26 18 38 18 50 30 S74 42 84 30"/><path d="M16 52 C26 40 38 40 50 52 S74 64 84 52"/><path d="M16 74 C26 62 38 62 50 74 S74 86 84 74" opacity="0.62"/></svg>
            </div>
            <div class="wm">Tide</div>
          </div>
          <div class="pitch">
            <div class="p1">Your tasks, in your pocket.</div>
            <div class="p2">Scan to download.</div>
          </div>
          <div class="badges">
            <div class="badge b1">
              <svg viewBox="0 0 40 40" fill="none" stroke="#fff" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"><circle cx="20" cy="20" r="16"/><path d="M20 11v13M14 19l6 6 6-6"/></svg>
              <span>Download for iOS</span>
            </div>
            <div class="badge b2">
              <svg viewBox="0 0 40 40" fill="none" stroke="#fff" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="4" width="32" height="32" rx="9"/><path d="M20 11v13M14 19l6 6 6-6"/></svg>
              <span>Get it for Android</span>
            </div>
          </div>
        </div>

        <div id="ring"></div>
        <div id="card">
          <div id="qr"></div>
          <div id="tileWrap">
            <div class="tile"><div class="in">
              <svg viewBox="0 0 100 100" fill="none" stroke="#fff" stroke-width="10" stroke-linecap="round"><path d="M16 30 C26 18 38 18 50 30 S74 42 84 30"/><path d="M16 52 C26 40 38 40 50 52 S74 64 84 52"/><path d="M16 74 C26 62 38 62 50 74 S74 86 84 74" opacity="0.62"/></svg>
            </div></div>
          </div>
          <div id="scanClip"><div class="band"><b></b></div></div>
        </div>
      </div>

      <div id="vig" class="clip full" data-start="0" data-duration="10.5" data-track-index="3" data-layout-ignore></div>
    </div>

    <script>
      // real QR matrix: 29x29, error correction H, encodes https://motionboard.app (row 0 top, column 0 left)
      const ROWS = [
        "11111110001111100010101111111",
        "10000010000001110010101000001",
        "10111010100000011110101011101",
        "10111010011010010001101011101",
        "10111010000001001000101011101",
        "10000010101000100001101000001",
        "11111110101010101010101111111",
        "00000000101110011110000000000",
        "01111110111011001111011100100",
        "11111101101010001001010111000",
        "11010011100010101110000000011",
        "11010101001101010001100101001",
        "11000010010111111110000011011",
        "10101100111000110110010100000",
        "01100011010101110011010101110",
        "00111000101010111011111010010",
        "00110010111010001010010101110",
        "10110101110111110010110101001",
        "11111110001010001111110011000",
        "10100001011011100110100111000",
        "10110111011011010100111111011",
        "00000000101010001001100010111",
        "11111110010111101101101010010",
        "10000010111000000100100011001",
        "10111010100000000010111111101",
        "10111010111111110011111101011",
        "10111010110000100000001001000",
        "10000010110010010001000111100",
        "11111110011001110111111000101",
      ];
      const N = 29, CELL = 20;

      // seeded PRNG for the small per-module jitter of the build-in
      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; }; }
      const rnd = mulberry32(2931);

      // ---------- build the DOM from the matrix ----------
      const qr = document.getElementById("qr");
      const finderOrigins = [[0, 0], [0, N - 7], [N - 7, 0]]; // [row, col] of each 7x7 finder pattern
      const fnds = finderOrigins.map(([r0, c0]) => {
        const w = document.createElement("div");
        w.className = "fnd";
        w.style.left = c0 * CELL + "px";
        w.style.top = r0 * CELL + "px";
        qr.appendChild(w);
        return w;
      });
      const mods = [];
      for (let r = 0; r < N; r++) {
        for (let c = 0; c < N; c++) {
          if (ROWS[r][c] !== "1") continue;
          const el = document.createElement("i");
          el.className = "m";
          let host = qr, ox = 0, oy = 0;
          finderOrigins.forEach(([r0, c0], k) => {
            if (r >= r0 && r < r0 + 7 && c >= c0 && c < c0 + 7) { host = fnds[k]; ox = c0 * CELL; oy = r0 * CELL; }
          });
          el.style.left = c * CELL - ox + 1 + "px";
          el.style.top = r * CELL - oy + 1 + "px";
          host.appendChild(el);
          if (host === qr) mods.push({ el, r, c, j: rnd() });
        }
      }

      // ---------- timeline ----------
      const EXPO = "expo.out";
      const tl = gsap.timeline({ paused: true });

      // baselines (visibility is hidden in CSS; tweens carry explicit end values)
      tl.set("#card", { y: 56 }, 0);
      tl.set("#halo", { opacity: 0 }, 0);
      tl.set(".mk", { scale: 0.5 }, 0);
      tl.set(".wm, .p1, .p2, .badge", { y: 44 }, 0);
      tl.set(".fnd", { scale: 0.2 }, 0);
      tl.set(mods.map((m) => m.el), { scale: 0 }, 0);
      tl.set(".tile", { scale: 0 }, 0);
      tl.set(".band", { y: -240 }, 0);
      tl.set("#ring", { scale: 1 }, 0);

      // 0.2 - 1.3  the card and the glow arrive
      tl.to("#card", { opacity: 1, y: 0, duration: 1.1, ease: EXPO }, 0.2);
      tl.to("#halo", { opacity: 1, duration: 2.0, ease: "power2.out" }, 0.4);

      // 0.5 - 2.3  left column staggers in (mark, wordmark, pitch, badges)
      tl.to(".mk", { opacity: 1, scale: 1, duration: 0.8, ease: "back.out(1.6)" }, 0.5);
      tl.to(".wm", { opacity: 1, y: 0, duration: 0.9, ease: EXPO }, 0.7);
      tl.to(".p1", { opacity: 1, y: 0, duration: 0.9, ease: EXPO }, 1.1);
      tl.to(".p2", { opacity: 1, y: 0, duration: 0.9, ease: EXPO }, 1.3);
      tl.to(".b1", { opacity: 1, y: 0, duration: 0.8, ease: EXPO }, 1.8);
      tl.to(".b2", { opacity: 1, y: 0, duration: 0.8, ease: EXPO }, 1.95);

      // 1.4 - 2.3  the three finder patterns land first
      [1.4, 1.55, 1.7].forEach((t, k) => {
        tl.to(fnds[k], { opacity: 1, scale: 1, duration: 0.6, ease: "back.out(1.8)" }, t);
      });

      // 2.4 - 3.65  the remaining modules build in on a diagonal, each from scale 0 (about 1.2 s overall)
      mods.forEach((m) => {
        const d = ((m.r + m.c) / (2 * (N - 1))) * 0.82 + m.j * 0.12;
        tl.to(m.el, { opacity: 1, scale: 1, duration: 0.3, ease: "back.out(2)" }, 2.4 + d);
      });

      // 4.1 - 4.8  the Tide tile pops in at the centre
      tl.to(".tile", { opacity: 1, scale: 1, duration: 0.7, ease: "back.out(2.2)" }, 4.1);

      // 5.2 - 7.2  one soft scan sweeps top to bottom
      tl.to(".band", { opacity: 1, duration: 0.25, ease: "power1.out" }, 5.2);
      tl.to(".band", { y: 700, duration: 2.0, ease: "power1.inOut" }, 5.2);
      tl.to(".band", { opacity: 0, duration: 0.3, ease: "power1.in" }, 6.95);

      // 7.1 - 8.0  one ring pulses out of the card, then everything holds still
      tl.to("#ring", { opacity: 0.55, duration: 0.01, ease: "none" }, 7.1);
      tl.to("#ring", { scale: 1.07, duration: 0.9, ease: "power2.out" }, 7.1);
      tl.to("#ring", { opacity: 0, duration: 0.9, ease: "power2.out" }, 7.11);

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