# Line Graph Animation

Motionboard shot name: Bars to Line

A white revenue chart grows twelve bars from the baseline. Each bar shrinks to a dot at its top, a line draws left to right through the dots with a soft fill behind the pen, and a bubble over the last point counts up to $184.2k with a +38% chip.

- Position in a launch film: Features
- Slug: line-graph-animation
- Preview video: https://media.motionboard.app/bar-to-line.mp4
- Recipe page: https://motionboard.app/recipes/line-graph-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 `bar-to-line`. 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 11s. Card rises 0.1–1.1s; title 0.4s, range pill 0.5s; gridlines draw from 0.55s (0.9s each, 0.06s stagger), y labels from 0.65s, month labels from 0.85s; 12 bars grow from 1.25s, 0.065s apart, 0.95s each (last done at about 3.0s); hold 0.5s; bars shrink to dots from 3.5s, 0.035s apart, 0.8s each (done at 4.7s); pen and line appear at 4.5s and draw 4.5–5.9s (1.4s); pen fades 5.95–6.3s; last dot grows and a ring expands from 5.85s; value bubble pops at 5.95s (0.65s), the number counts 6.0–6.75s, the +38% chip pops at 6.55s (0.55s); card leaves 7.2–7.7s; lockup mark 7.8s (0.8s), wordmark 7.9s (0.85s), tagline 8.0s (0.75s), held still to 11s |
| Easing | Card rise and lockup `expo.out`; gridlines and bar growth power3.out; bar-to-dot morph power3.inOut; line, area and pen share one power2.inOut progress; bubble back.out(1.5), chip back.out(1.8); value count power3.out; card exit power2.in; the slow card drift is linear (none) |
| Camera | Flat, straight-on framing; the whole card drifts from scale 1 to 1.03 over 0.2–7.6s in a linear move, so the chart is never fully still |
| Subject | Card 1500x870px, white, corner radius 32px, at left 210px and top 105px; plot area 1300x540px at (140, 200) inside it, scale $0–$240k with gridlines every $60k and 28px axis labels; 12 slots of 108.33px, bars 60px wide with height = value / 240 × 540, values in $k: 96, 103, 101, 114, 122, 119, 133, 146, 151, 163, 171, 184.2; bars a pale tint `#c9d2fb`, December solid accent; dots 26px with a 5px white ring; line 7px with round caps through the dot centres (Catmull-Rom to cubic Bézier); area gradient from 30% to 2% accent; pen a 10px white dot with a 5px accent stroke; value bubble 500x112px, radius 26px, text 78px/800, chip 32px/700 |
| Sync | The line, the area clip and the pen come from one progress value on the same frame; each dot scales up to 1.5x while the pen is within 150px past it; the last dot grows to 1.3x and its ring starts at 5.85s, 0.1s before the bubble; the number reaches 184.2 at 6.75s, 0.2s after the chip appears |
| Style | Paper `#eceef1` with a soft radial lift, ink `#14161a`, one accent `#3b5bfd`, chip green `#4ade80`; Inter throughout, title 48px/700, wordmark 150px/700, tagline 40px; light vignette and 6% multiply grain |

## Why it works

The same twelve values stay on screen for the whole move, so the viewer watches one chart change type instead of reading a second chart. Each bar shrinks toward its own top until it is a dot, which puts every dot exactly where the line will pass; the line then joins points the eye has already read. One eased progress value drives the stroke, the area fill and the pen, so the gradient never runs ahead of the line, and each dot pulses as the pen reaches it, so the stroke seems to pick the dots up. The headline number arrives after the line stops: a dark bubble over the last point with $184.2k at 78px counting up, then the +38% chip. It is the largest element on the frame and the only dark one on a white card, so the eye lands on it. One accent, blue #3b5bfd, marks the line, the dots and the latest bar; the earlier bars are a pale tint of the same blue. The finished chart holds about 1.25s before the card clears, and the lockup follows on clean paper.

## Prompt

> Build an 11-second, 1920x1080, 30 fps light product film called Bars to Line for a fictional product, Ledger (a revenue analytics dashboard). Background paper #eceef1 with a soft radial lift in the centre, ink #14161a, one accent blue #3b5bfd, font Inter. Use HTML and one paused GSAP timeline; every change comes from the timeline, with no CSS animations. Hide everything that appears later in CSS (opacity 0) and tween to explicit end values.
>
> Chart card: 1500x870 px, white, radius 32 px, soft shadow, at left 210 and top 105. Title Monthly recurring revenue (48 px, 700) top left and a Jan – Dec 2025 pill (26 px) top right. Plot area 1300x540 px at (140, 200) inside the card, scale $0–$240k with gridlines every $60k (28 px grey labels on the left) and twelve month labels Jan–Dec (28 px) under the baseline. Values in $k: 96, 103, 101, 114, 122, 119, 133, 146, 151, 163, 171, 184.2. Slot width 108.33 px; bars 60 px wide, height = value / 240 × 540, pale tint #c9d2fb, December solid #3b5bfd.
>
> Timeline: the card rises 0.1–1.1 s (y 70 to 0, scale 0.97 to 1, expo.out). Title at 0.4 s, pill at 0.5 s. Gridlines draw left to right from 0.55 s (0.9 s power3.out, 0.06 s stagger), y labels fade in from 0.65 s, month labels from 0.85 s. Bars grow from the baseline from 1.25 s, 0.065 s apart, each 0.95 s power3.out; hold 0.5 s. At 3.5 s every bar shrinks to a 26 px dot centred on its own top (0.8 s power3.inOut, 0.035 s stagger): height to 26, bottom to bar height minus 13, width to 26, all four radii to 13, colour to #3b5bfd, and a 5 px white ring grows around it.
>
> Build the line as one SVG path through the dot centres (Catmull-Rom converted to cubic Béziers), 7 px, round caps, stroke-dasharray equal to the path length, plus an area path under it filled with a vertical gradient of the accent from 30% to 2% opacity and clipped by a rect that follows the pen. Hide the line, the area and the pen in CSS and show them at 4.5 s. From 4.5 to 5.9 s one proxy tween (power2.inOut) sets the dash offset, the clip width and the pen position from getPointAtLength; the pen is a 10 px white dot with a 5 px accent stroke. In the same update scale each dot up to 1.5x while the pen is within 150 px past it. The pen fades at 5.95 s (0.35 s).
>
> From 5.85 s the December dot grows to 1.3x and a 60 px accent ring expands to 2.6x while fading (0.9 s). At 5.95 s a dark bubble (500x112 px, #14161a, radius 26 px, a rotated 26 px square as the pointer) pops in above the December point with back.out(1.5) over 0.65 s. Its text $184.2k (78 px, 800, tabular numerals) counts up from 0 over 0.75 s from 6.0 s (power3.out); a +38% chip (32 px, 700, #4ade80 on 16% green) pops in at 6.55 s. The card drifts from scale 1 to 1.03 linearly over 0.2–7.6 s and fades up and out at 7.2 s (0.5 s power2.in).
>
> Lockup from 7.8 s on clean paper: a 150 px accent tile (radius 36 px) pops in over 0.8 s (expo.out), a white ascending polyline with an end dot draws inside it from 7.85 s (0.6 s), the word Ledger (Inter 700, 150 px) rises from a mask at 7.9 s (0.85 s expo.out) and the tagline Revenue, clear at a glance. (40 px grey) fades up at 8.0 s. Hold still to 11 s. Add a light vignette and 6% multiply film grain.

## Often confused with

- [Count Up Animation](https://motionboard.app/r/count-up-animation.md): Count Up Animation rolls digits to a target number; here the numbers are bar heights that change into a line, and only the last value counts up.
- [Morph Transition](https://motionboard.app/r/morph-transition.md): Morph Transition turns one element into the next to avoid cuts; here one chart keeps its twelve values and changes from bars to dots to a drawn line.

## Source files

Runnable HyperFrames project, 3 files.

- https://motionboard.app/source/bar-to-line/hyperframes.json (318 B)
- https://motionboard.app/source/bar-to-line/index.html (15.8 KB)
- https://motionboard.app/source/bar-to-line/package.json (300 B)

Download all of them:

```sh
curl -fsSL --create-dirs -o "bar-to-line/hyperframes.json" "https://motionboard.app/source/bar-to-line/hyperframes.json"
curl -fsSL --create-dirs -o "bar-to-line/index.html" "https://motionboard.app/source/bar-to-line/index.html"
curl -fsSL --create-dirs -o "bar-to-line/package.json" "https://motionboard.app/source/bar-to-line/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: #eceef1;
        --accent: #3b5bfd;
        --pale: #c9d2fb;
        --ink: #14161a;
        --mut: #6b7080;
        --line: rgba(20, 24, 40, 0.09);
        --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; }

      /* ---------- background + finish ---------- */
      .paper { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; background: radial-gradient(ellipse 72% 64% at 50% 46%, #f4f5f8 0%, #eceef1 55%, #e3e6eb 100%); }
      #fx { pointer-events: none; z-index: 5; }
      #fx .vig { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; background: radial-gradient(ellipse 88% 80% at 50% 48%, rgba(30,36,60,0) 56%, rgba(30,36,60,0.13) 100%); }
      #fx .grain { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; opacity: 0.06; mix-blend-mode: multiply; }

      /* ---------- chart card (local coordinates: card is 1500 x 870) ---------- */
      #cardWrap { position: absolute; left: 210px; top: 105px; width: 1500px; height: 870px; }
      #card {
        position: absolute; left: 0; top: 0; width: 1500px; height: 870px; opacity: 0; border-radius: 32px; background: #ffffff;
        border: 1px solid rgba(20, 24, 40, 0.06);
        box-shadow: 0 2px 6px rgba(30, 40, 80, 0.05), 0 44px 110px rgba(30, 40, 80, 0.16);
      }
      #title { position: absolute; left: 56px; top: 44px; opacity: 0; font-size: 48px; line-height: 58px; font-weight: 700; letter-spacing: -0.025em; color: var(--ink); white-space: nowrap; }
      #range { position: absolute; right: 56px; top: 44px; height: 58px; padding: 0 22px 0 20px; opacity: 0; border-radius: 14px; background: #f3f4f7; border: 1px solid var(--line); display: flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 600; color: #3d4252; white-space: nowrap; }
      #range svg { width: 26px; height: 26px; fill: none; stroke: #6b7080; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

      #plot { position: absolute; left: 140px; top: 200px; width: 1300px; height: 540px; }
      .gl { position: absolute; left: 0; width: 1300px; height: 2px; background: var(--line); }
      .gl.base { height: 3px; background: #c9cdd8; }
      .gy { position: absolute; left: -130px; width: 100px; height: 32px; line-height: 32px; text-align: right; font-size: 28px; font-weight: 500; color: var(--mut); font-variant-numeric: tabular-nums; opacity: 0; }
      .gx { position: absolute; top: 566px; width: 108.3333px; text-align: center; font-size: 28px; font-weight: 500; color: var(--mut); opacity: 0; }
      .gx.last { color: var(--ink); font-weight: 700; }
      #head, #line, #area { opacity: 0; visibility: hidden; }
      .ovs { position: absolute; left: 0; top: 0; width: 1300px; height: 540px; overflow: visible; }

      .bar {
        position: absolute; bottom: 0; width: 60px; height: 0; background: var(--pale);
        border-radius: 10px 10px 0 0; box-shadow: 0 0 0 0px #ffffff;
      }
      .bar.hi { background: var(--accent); }

      #halo { position: absolute; left: 1356px; top: 296px; width: 60px; height: 60px; border-radius: 50%; border: 4px solid var(--accent); opacity: 0; }
      #bubble {
        position: absolute; left: 952px; top: 172px; width: 500px; height: 112px; opacity: 0; border-radius: 26px; background: var(--ink);
        display: flex; align-items: center; padding-left: 34px; gap: 22px; color: #ffffff;
        box-shadow: 0 24px 50px rgba(20, 24, 40, 0.28);
      }
      #bubble .tip { position: absolute; left: 421px; bottom: -11px; width: 26px; height: 26px; background: var(--ink); transform: rotate(45deg); border-radius: 4px; }
      #val { position: relative; font-size: 78px; line-height: 112px; font-weight: 800; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; white-space: nowrap; }
      #chip { position: relative; height: 52px; padding: 0 18px; border-radius: 999px; display: flex; align-items: center; font-size: 32px; font-weight: 700; color: #4ade80; background: rgba(74, 222, 128, 0.16); opacity: 0; }

      /* ---------- lockup ---------- */
      #lk { display: flex; flex-direction: column; align-items: center; justify-content: center; }
      .lrow { display: flex; align-items: center; gap: 38px; }
      #lmk { position: relative; width: 150px; height: 150px; border-radius: 36px; background: var(--accent); opacity: 0; box-shadow: 0 22px 50px rgba(59, 91, 253, 0.32); }
      #lmk svg { position: absolute; left: 0; top: 0; width: 150px; height: 150px; overflow: visible; }
      .wmask { overflow: hidden; height: 190px; padding: 0 6px; }
      #wm { display: block; font-size: 150px; line-height: 190px; font-weight: 700; letter-spacing: -0.045em; color: var(--ink); }
      #tag { margin-top: 24px; font-size: 40px; font-weight: 500; letter-spacing: -0.005em; color: var(--mut); opacity: 0; }
    </style>
  </head>
  <body>
    <div id="root" data-composition-id="main" data-start="0" data-duration="11" data-width="1920" data-height="1080">

      <div id="bg" class="clip full" data-start="0" data-duration="11" data-track-index="0" data-layout-allow-overlap>
        <div class="paper"></div>
      </div>

      <div id="sceneCard" class="clip full" data-start="0" data-duration="7.8" data-track-index="1" data-layout-allow-overlap>
        <div id="cardWrap">
          <div id="card">
            <div id="title">Monthly recurring revenue</div>
            <div id="range"><svg viewBox="0 0 26 26"><rect x="3" y="5" width="20" height="18" rx="4"/><path d="M3 11h20M9 2.5v5M17 2.5v5"/></svg>Jan &ndash; Dec 2025</div>

            <div id="plot">
              <div id="grid"></div>
              <svg class="ovs" id="ov" viewBox="0 0 1300 540">
                <defs>
                  <linearGradient id="arg" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#3b5bfd" stop-opacity="0.30"/><stop offset="1" stop-color="#3b5bfd" stop-opacity="0.02"/></linearGradient>
                  <clipPath id="arc"><rect id="arcr" x="0" y="-60" width="0" height="640"/></clipPath>
                </defs>
                <path id="area" fill="url(#arg)" clip-path="url(#arc)" d=""/>
                <path id="line" fill="none" stroke="#3b5bfd" stroke-width="7" stroke-linecap="round" stroke-linejoin="round" d=""/>
              </svg>
              <div id="bars"></div>
              <svg class="ovs" id="ovTop" viewBox="0 0 1300 540">
                <g id="head">
                  <circle id="headHalo" r="20" fill="#3b5bfd" opacity="0.18"/>
                  <circle id="headDot" r="10" fill="#ffffff" stroke="#3b5bfd" stroke-width="5"/>
                </g>
              </svg>
              <div id="xl"></div>
            </div>

            <div id="halo"></div>
            <div id="bubble">
              <div id="val">$184.2k</div>
              <div id="chip">+38%</div>
              <div class="tip"></div>
            </div>
          </div>
        </div>
      </div>

      <div id="lock" class="clip full" data-start="7.8" data-duration="3.2" data-track-index="2" data-layout-allow-overlap>
        <div id="lk" class="full">
          <div class="lrow">
            <div id="lmk">
              <svg viewBox="0 0 150 150">
                <polyline id="lpoly" points="36,102 62,76 84,90 116,50" fill="none" stroke="#ffffff" stroke-width="13" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="140" stroke-dashoffset="140"/>
                <circle id="ldot" cx="116" cy="50" r="12" fill="#ffffff" opacity="0"/>
              </svg>
            </div>
            <div class="wmask"><span id="wm">Ledger</span></div>
          </div>
          <div id="tag">Revenue, clear at a glance.</div>
        </div>
      </div>

      <div id="fx" class="clip full" data-start="0" data-duration="11" data-track-index="3" data-layout-ignore>
        <div class="vig"></div>
        <svg class="grain" viewBox="0 0 1920 1080" preserveAspectRatio="none"><filter id="nz"><feTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="2" seed="7"/><feColorMatrix type="saturate" values="0"/></filter><rect width="1920" height="1080" filter="url(#nz)"/></svg>
      </div>
    </div>

    <script>
      const EXPO = "expo.out";
      const clamp = (x, a, b) => Math.min(b, Math.max(a, x));

      /* ---------- data and geometry (plot is 1300 x 540, max $240k) ---------- */
      const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
      const VALS = [96, 103, 101, 114, 122, 119, 133, 146, 151, 163, 171, 184.2];
      const PW = 1300, PH = 540, MAXV = 240, SLOT = PW / 12, BW = 60, DOT = 26;
      const px = (i) => SLOT * (i + 0.5);
      const py = (v) => PH - (v / MAXV) * PH;
      const hh = (v) => (v / MAXV) * PH;

      // gridlines + y labels
      let g = "";
      [0, 60, 120, 180, 240].forEach((v) => {
        const y = py(v);
        g += '<div class="gl' + (v === 0 ? " base" : "") + '" style="top:' + (y - (v === 0 ? 1.5 : 1)).toFixed(1) + 'px"></div>';
        g += '<div class="gy" style="top:' + (y - 16).toFixed(1) + 'px">' + (v === 0 ? "$0" : "$" + v + "k") + "</div>";
      });
      document.getElementById("grid").innerHTML = g;

      // bars + month labels
      let b = "", xl = "";
      VALS.forEach((v, i) => {
        b += '<div class="bar' + (i === 11 ? " hi" : "") + '" id="bar' + i + '" style="left:' + (SLOT * i + (SLOT - BW) / 2).toFixed(2) + 'px"></div>';
        xl += '<div class="gx' + (i === 11 ? " last" : "") + '" style="left:' + (SLOT * i).toFixed(2) + 'px">' + MONTHS[i] + "</div>";
      });
      document.getElementById("bars").innerHTML = b;
      document.getElementById("xl").innerHTML = xl;

      // smooth path through the dot centres (Catmull-Rom to cubic bezier)
      let d = "M" + px(0).toFixed(2) + " " + py(VALS[0]).toFixed(2);
      for (let i = 0; i < VALS.length - 1; i++) {
        const i0 = Math.max(0, i - 1), i3 = Math.min(VALS.length - 1, i + 2);
        const x0 = px(i0), x1 = px(i), x2 = px(i + 1), x3 = px(i3);
        const y0 = py(VALS[i0]), y1 = py(VALS[i]), y2 = py(VALS[i + 1]), y3 = py(VALS[i3]);
        d += " C" + (x1 + (x2 - x0) / 6).toFixed(2) + " " + (y1 + (y2 - y0) / 6).toFixed(2) + " " + (x2 - (x3 - x1) / 6).toFixed(2) + " " + (y2 - (y3 - y1) / 6).toFixed(2) + " " + x2.toFixed(2) + " " + y2.toFixed(2);
      }
      const lineEl = document.getElementById("line"), areaEl = document.getElementById("area");
      lineEl.setAttribute("d", d);
      areaEl.setAttribute("d", d + " L" + px(11).toFixed(2) + " " + PH + " L" + px(0).toFixed(2) + " " + PH + " Z");
      const LEN = lineEl.getTotalLength();
      lineEl.style.strokeDasharray = LEN;
      const arcr = document.getElementById("arcr");
      const headEl = document.getElementById("head"), headDot = document.getElementById("headDot"), headHalo = document.getElementById("headHalo");
      const dots = VALS.map((v, i) => document.getElementById("bar" + i));

      // one eased progress draws the line, the area, the pen and the pulse of each dot the pen passes
      function draw(p) {
        lineEl.style.strokeDashoffset = (LEN * (1 - p)).toFixed(2);
        const pt = lineEl.getPointAtLength(LEN * p);
        arcr.setAttribute("width", pt.x.toFixed(2));
        headDot.setAttribute("cx", pt.x.toFixed(2)); headDot.setAttribute("cy", pt.y.toFixed(2));
        headHalo.setAttribute("cx", pt.x.toFixed(2)); headHalo.setAttribute("cy", pt.y.toFixed(2));
        for (let i = 0; i < 11; i++) {
          const dist = pt.x - px(i);
          const k = p > 0.0001 && p < 0.9999 && dist >= 0 && dist < 150 ? 1 - dist / 150 : 0;
          gsap.set(dots[i], { scale: 1 + 0.5 * k * k });
        }
      }
      draw(0);

      /* ---------- initial states ---------- */
      gsap.set("#card", { y: 70, scale: 0.97 });
      gsap.set("#title", { y: 14 });
      gsap.set("#range", { y: 14 });
      gsap.set(".gl", { scaleX: 0, transformOrigin: "0% 50%" });
      gsap.set("#bubble", { scale: 0.55, y: 14, transformOrigin: "434px 112px" });
      gsap.set("#chip", { scale: 0.6 });
      gsap.set("#halo", { scale: 0.5 });
      gsap.set("#lmk", { scale: 0.6 });
      gsap.set("#wm", { yPercent: 105 });
      gsap.set("#tag", { y: 22 });

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

      /* ---------- card in, axes draw ---------- */
      tl.to("#card", { opacity: 1, y: 0, scale: 1, duration: 1.0, ease: EXPO }, 0.1);
      tl.to("#cardWrap", { scale: 1.03, duration: 7.4, ease: "none" }, 0.2);
      tl.to("#title", { opacity: 1, y: 0, duration: 0.9, ease: EXPO }, 0.4);
      tl.to("#range", { opacity: 1, y: 0, duration: 0.9, ease: EXPO }, 0.5);
      tl.to(".gl", { scaleX: 1, duration: 0.9, ease: "power3.out", stagger: 0.06 }, 0.55);
      tl.to(".gy", { opacity: 1, duration: 0.6, ease: "power2.out", stagger: 0.06 }, 0.65);
      tl.to(".gx", { opacity: 1, duration: 0.6, ease: "power2.out", stagger: 0.03 }, 0.85);

      /* ---------- 12 bars grow from the baseline ---------- */
      VALS.forEach((v, i) => {
        tl.to("#bar" + i, { height: hh(v), duration: 0.95, ease: "power3.out" }, 1.25 + i * 0.065);
      });

      /* ---------- bars shrink to dots at their tops ---------- */
      VALS.forEach((v, i) => {
        tl.to("#bar" + i, {
          height: DOT, bottom: hh(v) - DOT / 2, width: DOT, left: SLOT * (i + 0.5) - DOT / 2,
          borderTopLeftRadius: DOT / 2, borderTopRightRadius: DOT / 2, borderBottomLeftRadius: DOT / 2, borderBottomRightRadius: DOT / 2,
          backgroundColor: "#3b5bfd", boxShadow: "0 0 0 5px #ffffff",
          duration: 0.8, ease: "power3.inOut",
        }, 3.5 + i * 0.035);
      });

      /* ---------- line draws left to right, area fills behind the pen ---------- */
      const pen = { p: 0 };
      tl.to("#head, #line, #area", { autoAlpha: 1, duration: 0.01, ease: "none" }, 4.5);
      tl.to(pen, { p: 1, duration: 1.4, ease: "power2.inOut", onUpdate: () => draw(pen.p) }, 4.5);
      tl.to("#head", { autoAlpha: 0, duration: 0.35, ease: "power2.in" }, 5.95);

      /* ---------- end value ---------- */
      tl.to("#bar11", { scale: 1.3, duration: 0.3, ease: "power2.out" }, 5.85);
      tl.to("#halo", { opacity: 0.7, duration: 0.01, ease: "none" }, 5.9);
      tl.to("#halo", { scale: 2.6, opacity: 0, duration: 0.9, ease: "power2.out" }, 5.91);
      tl.to("#bubble", { opacity: 1, scale: 1, y: 0, duration: 0.65, ease: "back.out(1.5)" }, 5.95);
      const cnt = { v: 0 };
      tl.to(cnt, { v: 184.2, duration: 0.75, ease: "power3.out", onUpdate: () => { document.getElementById("val").textContent = "$" + cnt.v.toFixed(1) + "k"; } }, 6.0);
      tl.to("#chip", { opacity: 1, scale: 1, duration: 0.55, ease: "back.out(1.8)" }, 6.55);

      /* ---------- card clears ---------- */
      tl.to("#card", { opacity: 0, y: -46, scale: 0.98, duration: 0.5, ease: "power2.in" }, 7.2);

      /* ---------- lockup ---------- */
      tl.to("#lmk", { opacity: 1, scale: 1, duration: 0.8, ease: EXPO }, 7.8);
      tl.to("#lpoly", { strokeDashoffset: 0, duration: 0.6, ease: "power2.out" }, 7.85);
      tl.to("#ldot", { opacity: 1, duration: 0.25, ease: "power2.out" }, 8.4);
      tl.to("#wm", { yPercent: 0, duration: 0.85, ease: EXPO }, 7.9);
      tl.to("#tag", { opacity: 1, y: 0, duration: 0.75, ease: EXPO }, 8.0);

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

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