# Button Click Animation

Motionboard shot name: Publish Press

Three words, Design. Build. Launch., cut in one after another on white. A large blue Publish button scales in, a cursor arrow glides to it, and the click squashes the button and sends ripples out. The label turns into a spinner, then a check with Live, and the film ends on the Plume lockup.

- Position in a launch film: Ending
- Slug: button-click-animation
- Preview video: https://media.motionboard.app/publish-press.mp4
- Recipe page: https://motionboard.app/recipes/button-click-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 `publish-press`. 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. Design. 0–1.0s (scale settle 1.04→1 over 0.6s), Build. 1.0–1.9s, Launch. 1.9–2.95s; button scales in 3.0–3.7s; cursor glides in 3.5–4.7s (1.2s); hover brightening 4.5–4.8s; press at 5.0s (0.07s squash, release from 5.12s over 0.45s); ripples 5.0–5.9s; cursor clears 5.5–5.8s; label to spinner 5.1–5.4s and spins 5.2–6.0s; spinner to check and Live 5.9–6.43s; URL line 6.2–6.7s; button clears 6.85–7.05s; lockup 7.1–8.3s and holds still to 11s |
| Easing | Verbs, button scale-in, Live label, URL line and lockup use expo.out; cursor x uses power3.out and cursor y uses power2.inOut so the path curves; the press squash uses power2.in; release uses back.out(2.2); ripples use power2.out for size and power1.in for fade; hover and colour changes use power1.out; the spinner turns 900° with linear ease (none); the check stroke uses power2.out; the button exit uses power2.in |
| Camera | Locked camera at 1920x1080 with no push-in or pan. The only camera-like move is a 1.06 scale push on the last verb at 2.8–2.95s and a 1.08 scale on the button as it clears at 6.85–7.05s |
| Subject | Verbs at 240px weight 800, letter-spacing −0.045em, centred; Launch. in accent `#3b5bff`. Button 640x200px, 100px radius, centred at (960, 540), label 96px weight 700 white, shadow 0 34px 64px rgba(59,91,255,0.34) plus a 12px/22px contact shadow. Cursor arrow about 46x66px (a black body with a 4px white outline), tip travelling from (1580, 1010) to the click point (1100, 600). Ripples: a 200px white disc at 40% opacity inside the button growing to 6x, and a 200px ring with a 6px blue border outside the button growing to 4.2x. Spinner 100px with a 12px arc; check 84px with a 12px stroke next to Live at 96px; URL line studio-nine.plume.site is live at 36px. Lockup mark 176px, wordmark Plume 188px, tagline 56px |
| Sync | Hover brightening finishes 0.2s before the press; the squash, the darker blue, the cursor shrink to 0.86 and both ripples start on the same frame at 5.0s; the label starts leaving 0.1s after the press; the spinner turns for 0.8s, then the check begins drawing 0.07s after the Live label starts to appear; the URL line follows 0.15s later; the lockup starts 0.05s after the button has left |
| Style | White frame with a soft blue-tinted radial gradient at the centre (`#f3f5ff` to `#ffffff`) and a vignette reaching 6% at the edges; ink `#101522` and secondary text `#4a5163`; one accent blue `#3b5bff` with hover `#5873ff` and pressed `#2a43d6`; Inter throughout; no grain |

## Why it works

A button press is a short chain of cause and effect, and the film makes each link visible in order: hover, press, ripple, wait, result. The cursor arrives on a curve (x eases out while y eases in and out) so it reads as a hand and stops on the button, and the button brightens a moment before the click, which tells the viewer the pointer is on target. The press is a 0.07s squash to 0.94 with a darker blue, followed by a springy release, and the ripples start on the same frame at the click point, so the press and the result are tied to one instant. Then the label changes in two states, a spinner and a check with the word Live, each readable for about 0.7–0.9s, so the viewer sees the click do something. The opening is three one-word beats, Design. Build. Launch., on a white frame at 240px, so the Publish button is the only large shape in the second half and every part of the frame is either a word or the button. The final verb is in the accent color and the button repeats it, which links the verbs to the action. There is one accent color, blue #3b5bff, and the film ends on a still lockup.

## Prompt

> Build an 11-second, 1920x1080, 30 fps light product film called Publish Press for a fictional product, Plume (a website builder). White background with a soft radial gradient from #f3f5ff at the centre to #ffffff, a 6% vignette, font Inter, one accent color blue #3b5bff, ink #101522. Use HTML plus one paused GSAP timeline, no CSS animations. Beat 1: three one-word cuts centred at 240px, weight 800, letter-spacing −0.045em: Design. 0–1.0s (it is on screen at frame 0 and settles from scale 1.04 to 1 over 0.6s), Build. 1.0–1.9s, Launch. 1.9–2.95s in accent blue; each next word scales 0.9→1 and fades in over 0.4s with expo.out, each word fades out over 0.1s before the next, and Launch. pushes to 1.06 at 2.8–2.95s. Beat 2: a pill button 640x200px with a 100px radius, blue #3b5bff, centred at (960, 540), label Publish at 96px weight 700 white, shadow 0 34px 64px rgba(59,91,255,0.34) and a contact shadow 0 12px 22px rgba(59,91,255,0.22); it scales 0.7→1 and fades in 3.0–3.7s with expo.out. A cursor arrow about 46x66px (black body, 4px white outline) starts at (1580, 1010), fades in over 0.25s at 3.5s and glides 1.2s to the click point (1100, 600), with x on power3.out and y on power2.inOut so the path curves. At 4.5s the button brightens to #5873ff over 0.3s. At 5.0s press: the button scales to 0.94 over 0.07s with power2.in and turns #2a43d6, the cursor shrinks to 0.86, and from the same frame a 200px white disc at 40% opacity inside the button (clip it with overflow hidden) grows to 6x over 0.8s while fading from 5.1s, and a 200px ring with a 6px blue border at 55% opacity outside the button grows to 4.2x over 0.9s and fades. At 5.12s the button springs back to 1 over 0.45s with back.out(2.2) and returns to #3b5bff; the cursor fades out over 0.3s from 5.5s while drifting to (1140, 650). The label has three states stacked in the button. Publish fades out over 0.15s at 5.1s; a 100px spinner (a faint ring with a 12px white arc) fades in at 5.2s and turns 900° over 0.8s with no easing; at 5.9s it fades out and, from 5.98s, a 84px check plus the word Live at 96px fade and rise 16px in 0.45s with expo.out, the check path drawing over 0.35s from 6.05s with power2.out (keep the path at opacity 0 until it starts). The line studio-nine.plume.site is live at 36px appears below at 6.2s. At 6.85s the button grows to 1.08 and fades out over 0.2s and the line fades out. Beat 3: the lockup starts at 7.1s: a 176px rounded-square mark with a blue gradient and a white feather, the wordmark Plume at 188px weight 800 sliding in 60px from the left, and the tagline Your site, one click away. at 56px, all settled by 8.3s and then completely still until 11s. Hide every element in CSS (opacity 0) and animate with .to() tweens that state their end values. Finish with the timeline ending at 11s.

## Often confused with

- [Zoom-to-Cursor Effect](https://motionboard.app/r/zoom-to-cursor.md): Auto Zoom / Zoom-to-Cursor pushes the camera onto a small control in a real interface; here the camera stays locked and the control is the whole frame, a button large enough to show its press, ripples and label states.
- [Checkmark Animation](https://motionboard.app/r/checkmark-animation.md): Checkmark Animation plays a completion on a green circle after a connecting phase; here the check is the last label state of a button the cursor has just pressed, and a hover and a press come first.

## Source files

Runnable HyperFrames project, 3 files.

- https://motionboard.app/source/publish-press/hyperframes.json (318 B)
- https://motionboard.app/source/publish-press/index.html (11.4 KB)
- https://motionboard.app/source/publish-press/package.json (302 B)

Download all of them:

```sh
curl -fsSL --create-dirs -o "publish-press/hyperframes.json" "https://motionboard.app/source/publish-press/hyperframes.json"
curl -fsSL --create-dirs -o "publish-press/index.html" "https://motionboard.app/source/publish-press/index.html"
curl -fsSL --create-dirs -o "publish-press/package.json" "https://motionboard.app/source/publish-press/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: #101522;
        --sub: #4a5163;
        --mut: #868da0;
        --accent: #3b5bff;
        --accent-hi: #5873ff;
        --accent-lo: #2a43d6;
        --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: #ffffff; }
      #root {
        position: relative; width: 1920px; height: 1080px; overflow: hidden; background: #ffffff;
        font-family: var(--font-ui); color: var(--ink); -webkit-font-smoothing: antialiased;
      }
      .full { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }
      .a { position: absolute; }
      svg { display: block; flex: none; }

      /* ---------- backdrop ---------- */
      #bg { background: radial-gradient(ellipse 62% 66% at 50% 48%, #f3f5ff 0%, #f9faff 42%, #ffffff 80%); }
      #vig { pointer-events: none; z-index: 6; background: radial-gradient(ellipse at 50% 50%, rgba(20, 24, 40, 0) 62%, rgba(20, 24, 40, 0.06) 100%); }

      /* ---------- verbs ---------- */
      #verbs { z-index: 2; }
      .verb {
        left: 0; top: 0; width: 1920px; height: 1080px; display: flex; align-items: center; justify-content: center;
        font-size: 240px; line-height: 260px; font-weight: 800; letter-spacing: -0.045em; color: var(--ink);
        white-space: nowrap; opacity: 0;
      }
      #v1 { opacity: 1; }
      #v3 { color: var(--accent); }

      /* ---------- button scene ---------- */
      #press { z-index: 3; }
      #btnw { left: 640px; top: 440px; width: 640px; height: 200px; opacity: 0; }
      #btn {
        position: absolute; left: 0; top: 0; width: 640px; height: 200px; border-radius: 100px; overflow: hidden;
        background: var(--accent);
        box-shadow: 0 34px 64px rgba(59, 91, 255, 0.34), 0 12px 22px rgba(59, 91, 255, 0.22), inset 0 3px 0 rgba(255, 255, 255, 0.22);
      }
      #ripin { position: absolute; left: 360px; top: 60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255, 255, 255, 0.4); opacity: 0; }
      .state { position: absolute; left: 0; top: 0; width: 640px; height: 200px; display: flex; align-items: center; justify-content: center; }
      #s1 { font-size: 96px; font-weight: 700; letter-spacing: -0.03em; color: #ffffff; }
      #s2, #s3 { opacity: 0; }
      #s3 { gap: 24px; font-size: 96px; font-weight: 700; letter-spacing: -0.03em; color: #ffffff; }
      #spin { width: 100px; height: 100px; }
      #chk { stroke-dasharray: 100; stroke-dashoffset: 100; opacity: 0; }

      #ripout { left: 1000px; top: 500px; width: 200px; height: 200px; border-radius: 50%; border: 6px solid var(--accent); opacity: 0; }
      #live { left: 0; top: 724px; width: 1920px; text-align: center; font-size: 36px; line-height: 50px; font-weight: 500; color: var(--sub); opacity: 0; white-space: nowrap; }
      #live b { font-weight: 700; color: var(--ink); }

      #cur { left: 0; top: 0; width: 60px; height: 70px; opacity: 0; z-index: 5; }
      #curi { position: absolute; left: -3px; top: -3px; }

      /* ---------- lockup ---------- */
      #end { z-index: 4; }
      #endcol { left: 0; top: 340px; width: 1920px; display: flex; flex-direction: column; align-items: center; }
      #lockup { display: flex; align-items: center; gap: 40px; }
      #markwrap { position: relative; width: 176px; height: 176px; }
      #markwrap svg { position: absolute; left: 0; top: 0; }
      #mkw { opacity: 0; }
      #wm { font-size: 188px; line-height: 200px; font-weight: 800; letter-spacing: -0.05em; color: var(--ink); opacity: 0; }
      #tag { margin-top: 46px; font-size: 56px; line-height: 70px; font-weight: 500; letter-spacing: -0.02em; color: var(--sub); 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"></div>

      <div id="verbs" class="clip full" data-start="0" data-duration="3.1" data-track-index="1" data-layout-ignore data-layout-allow-overlap>
        <div id="v1" class="a verb">Design.</div>
        <div id="v2" class="a verb">Build.</div>
        <div id="v3" class="a verb">Launch.</div>
      </div>

      <div id="press" class="clip full" data-start="2.9" data-duration="4.3" data-track-index="2" data-layout-ignore data-layout-allow-overlap>
        <div id="btnw" class="a" data-layout-allow-overlap>
          <div id="btn" data-layout-allow-overlap>
            <div id="ripin"></div>
            <div id="s1" class="state">Publish</div>
            <div id="s2" class="state">
              <svg id="spin" viewBox="0 0 100 100" fill="none">
                <circle cx="50" cy="50" r="38" stroke="#ffffff" stroke-opacity="0.28" stroke-width="12" />
                <path d="M50 12 A38 38 0 0 1 88 50" stroke="#ffffff" stroke-width="12" stroke-linecap="round" />
              </svg>
            </div>
            <div id="s3" class="state">
              <svg width="84" height="84" viewBox="0 0 84 84" fill="none">
                <path id="chk" d="M14 44 L34 64 L70 22" pathLength="100" stroke="#ffffff" stroke-width="12" stroke-linecap="round" stroke-linejoin="round" />
              </svg>
              <span id="s3t">Live</span>
            </div>
          </div>
        </div>
        <div id="ripout" class="a"></div>
        <div id="live" class="a"><b>studio-nine.plume.site</b> is live</div>
        <div id="cur" class="a" data-layout-ignore data-layout-allow-overlap>
          <svg id="curi" width="46" height="66" viewBox="0 0 46 66" fill="none">
            <path d="M5 4 L5 52 L17 41 L26 62 L35 58 L26 38 L42 38 Z" fill="#101522" stroke="#ffffff" stroke-width="4" stroke-linejoin="round" />
          </svg>
        </div>
      </div>

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

      <div id="end" class="clip full" data-start="7.0" data-duration="4" data-track-index="4" data-layout-ignore data-layout-allow-overlap>
        <div id="endcol" class="a" data-layout-allow-overlap>
          <div id="lockup" data-layout-allow-overlap>
            <div id="markwrap">
                            <svg id="mkw" width="176" height="176" viewBox="0 0 176 176">
                <defs>
                  <linearGradient id="mkg" x1="0" y1="0" x2="0.4" y2="1"><stop offset="0" stop-color="#6a83ff" /><stop offset="1" stop-color="#2a43d6" /></linearGradient>
                </defs>
                <rect width="176" height="176" rx="50" fill="url(#mkg)" />
                <path d="M128 46 C 76 44, 46 82, 50 134 C 100 134, 134 100, 128 46 Z" fill="#ffffff" />
                <path d="M58 128 C 78 100, 98 80, 116 62" stroke="#3b5bff" stroke-width="7" stroke-linecap="round" fill="none" />
              </svg>
            </div>
            <div id="wm">Plume</div>
          </div>
          <div id="tag">Your site, one click away.</div>
        </div>
      </div>
    </div>

    <script>
      const EXPO = "expo.out";

      /* initial states that cannot live in CSS opacity alone */
      gsap.set(["#v2", "#v3"], { scale: 0.9 });
      gsap.set("#v1", { scale: 1.04 });
      gsap.set("#btnw", { scale: 0.7 });
      gsap.set("#cur", { x: 1580, y: 1010 });
      gsap.set("#curi", { transformOrigin: "3px 3px" });
      gsap.set("#s3", { y: 16 });
      gsap.set("#spin", { transformOrigin: "50% 50%", rotation: 0 });
      gsap.set("#ripin", { scale: 0 });
      gsap.set("#ripout", { scale: 0.3 });
      gsap.set("#live", { y: 16 });
      gsap.set("#mkw", { scale: 0.82 });
      gsap.set("#wm", { x: -60 });
      gsap.set("#tag", { y: 22 });

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

      /* 1. three verbs, one cut each (0 - 3.0) */
      tl.to("#v1", { scale: 1, duration: 0.6, ease: EXPO }, 0);
      tl.to("#v1", { opacity: 0, duration: 0.1, ease: "power1.in" }, 0.9);
      const verbs = [["#v2", 1.0, 1.9], ["#v3", 1.9, 2.95]];
      verbs.forEach(([id, a, b]) => {
        tl.to(id, { opacity: 1, scale: 1, duration: 0.4, ease: EXPO }, a);
        tl.to(id, { opacity: 0, duration: 0.1, ease: "power1.in" }, b - 0.1);
      });
      tl.to("#v3", { scale: 1.06, duration: 0.15, ease: "power1.in" }, 2.8);

      /* 2. button scales in (3.0) */
      tl.to("#btnw", { opacity: 1, scale: 1, duration: 0.7, ease: EXPO }, 3.0);

      /* cursor glides in from the bottom right on a curve (3.5 - 4.7) */
      tl.to("#cur", { opacity: 1, duration: 0.25, ease: "power1.out" }, 3.5);
      tl.to("#cur", { x: 1100, duration: 1.2, ease: "power3.out" }, 3.5);
      tl.to("#cur", { y: 600, duration: 1.2, ease: "power2.inOut" }, 3.5);

      /* hover: button brightens (4.5) */
      tl.to("#btn", { backgroundColor: "#5873ff", duration: 0.3, ease: "power1.out" }, 4.5);

      /* press (5.0): squash, darken, ripples */
      const P = 5.0;
      tl.to("#btnw", { scale: 0.94, duration: 0.07, ease: "power2.in" }, P);
      tl.to("#btn", { backgroundColor: "#2a43d6", duration: 0.07, ease: "power1.in" }, P);
      tl.to("#curi", { scale: 0.86, duration: 0.07, ease: "power2.in" }, P);
      tl.to("#btnw", { scale: 1, duration: 0.45, ease: "back.out(2.2)" }, P + 0.12);
      tl.to("#btn", { backgroundColor: "#3b5bff", duration: 0.3, ease: "power1.out" }, P + 0.12);
      tl.to("#curi", { scale: 1, duration: 0.2, ease: "power2.out" }, P + 0.12);
      tl.set("#ripin", { opacity: 1 }, P);
      tl.to("#ripin", { scale: 6, duration: 0.8, ease: "power2.out" }, P);
      tl.to("#ripin", { opacity: 0, duration: 0.7, ease: "power1.in" }, P + 0.1);
      tl.set("#ripout", { opacity: 0.55 }, P);
      tl.to("#ripout", { scale: 4.2, duration: 0.9, ease: "power2.out" }, P);
      tl.to("#ripout", { opacity: 0, duration: 0.8, ease: "power1.in" }, P + 0.1);

      /* cursor clears (5.5 - 5.8) */
      tl.to("#cur", { opacity: 0, duration: 0.3, ease: "power1.out" }, 5.5);
      tl.to("#cur", { x: 1140, y: 650, duration: 0.4, ease: "power1.out" }, 5.5);

      /* label: Publish -> spinner (5.15 - 5.95) */
      tl.to("#s1", { opacity: 0, duration: 0.15, ease: "power1.out" }, 5.1);
      tl.to("#s2", { opacity: 1, duration: 0.2, ease: "power1.out" }, 5.2);
      tl.to("#spin", { rotation: 900, duration: 0.8, ease: "none" }, 5.2);

      /* spinner -> check + Live (5.95 - 6.85) */
      tl.to("#s2", { opacity: 0, duration: 0.12, ease: "power1.out" }, 5.9);
      tl.to("#s3", { opacity: 1, y: 0, duration: 0.45, ease: EXPO }, 5.98);
      tl.set("#chk", { opacity: 1 }, 6.05);
      tl.to("#chk", { strokeDashoffset: 0, duration: 0.35, ease: "power2.out" }, 6.05);
      tl.to("#live", { opacity: 1, y: 0, duration: 0.5, ease: EXPO }, 6.2);

      /* 3. press clears, lockup (6.85 - 8.3), then still */
      tl.to("#btnw", { opacity: 0, scale: 1.08, duration: 0.2, ease: "power2.in" }, 6.85);
      tl.to("#live", { opacity: 0, duration: 0.15, ease: "power1.in" }, 6.85);

      tl.to("#mkw", { opacity: 1, scale: 1, duration: 0.7, ease: EXPO }, 7.1);
      tl.to("#wm", { opacity: 1, x: 0, duration: 0.8, ease: EXPO }, 7.25);
      tl.to("#tag", { opacity: 1, y: 0, duration: 0.7, ease: EXPO }, 7.6);

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