Skip to content
animorio
IT
All components

Merge button

Buttons, SVG, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 8.0 KBGSAP 28 KBFreeDownload the zip

The card of a change request in Brackwater, an invented code host, like a Dribbble shot: three checks (Build, Tests, Lint) spin with their seconds counting up, then close and their tick draws itself. When the last one passes, the Merge button wakes up: its colour fills it from the left and a light crosses it. Pressed, it gives, a thin bar runs under the word Merging…, in the little graph the feature branch bends down into main, the merge commit appears and the button becomes Merged with a drawn tick; beside it Delete branch arrives.

The code

A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN. The React and Vue tabs hold the same demo as a ready component, which switches its animations off when it leaves the page.

<!doctype html>
<!--
  "Merge button" from Animorio · https://animorio.com
  License: free on your own sites and your clients’ sites, paid work included.
  Not for resale, redistribution, templates or code collections · https://animorio.com/en/license/
-->
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>The merge button with the checks that tick and the branches that join</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage">
    <!-- a change request in Brackwater, an invented code host: three checks run and tick one by one, the Merge button
         wakes up when the last one passes, and pressing it bends the feature branch into main in the little graph -->
    <section class="pr" data-pr aria-labelledby="pr-title">
      <span class="pr__light" aria-hidden="true"></span>
      <header class="pr__head">
        <span class="pr__icon" aria-hidden="true">
          <svg viewBox="0 0 20 20"><circle cx="6" cy="4.5" r="1.9"/><circle cx="6" cy="15.5" r="1.9"/><circle cx="14" cy="8" r="1.9"/><path d="M6 6.4v7.2M14 9.9c0 2.6-2.4 3.4-6.3 4.6"/></svg>
        </span>
        <span class="pr__meta">
          <span class="pr__repo">brackwater / tidepool-sync</span>
          <span class="pr__num">Change #482</span>
        </span>
        <span class="pr__state" data-state><span class="pr__state-in" data-state-word>Open</span></span>
      </header>

      <h1 class="pr__title" id="pr-title">Add offline mode to the sync worker</h1>

      <div class="pr__graph" aria-hidden="true">
        <svg viewBox="0 0 300 54" preserveAspectRatio="none" data-graph>
          <path class="g-main" d="M6 40 H294"/>
          <path class="g-feat" data-feat d="M70 40 C 96 40, 98 14, 124 14 H 206"/>
          <path class="g-join" data-join d="M206 14 C 232 14, 234 40, 260 40" pathLength="1"/>
          <circle class="g-node" cx="70" cy="40" r="4"/>
          <circle class="g-node g-node--feat" cx="150" cy="14" r="4"/>
          <circle class="g-node g-node--feat" cx="206" cy="14" r="4"/>
          <circle class="g-node g-node--merge" data-mnode cx="260" cy="40" r="5.5"/>
        </svg>
        <span class="pr__branch pr__branch--feat" data-featname>feat/offline-sync</span>
        <span class="pr__branch pr__branch--main">main</span>
      </div>

      <ul class="pr__checks" data-checks>
        <li class="check" data-check data-dur="24">
          <span class="check__icon" aria-hidden="true">
            <svg viewBox="0 0 20 20"><circle class="check__ring" cx="10" cy="10" r="7.2" pathLength="1"/><path class="check__tick" d="M6.4 10.3l2.4 2.4 4.9-5.1" pathLength="1"/></svg>
          </span>
          <span class="check__name">Build</span>
          <span class="check__time" data-time>queued</span>
        </li>
        <li class="check" data-check data-dur="51">
          <span class="check__icon" aria-hidden="true">
            <svg viewBox="0 0 20 20"><circle class="check__ring" cx="10" cy="10" r="7.2" pathLength="1"/><path class="check__tick" d="M6.4 10.3l2.4 2.4 4.9-5.1" pathLength="1"/></svg>
          </span>
          <span class="check__name">Tests <span class="check__sub">218 passed</span></span>
          <span class="check__time" data-time>queued</span>
        </li>
        <li class="check" data-check data-dur="9">
          <span class="check__icon" aria-hidden="true">
            <svg viewBox="0 0 20 20"><circle class="check__ring" cx="10" cy="10" r="7.2" pathLength="1"/><path class="check__tick" d="M6.4 10.3l2.4 2.4 4.9-5.1" pathLength="1"/></svg>
          </span>
          <span class="check__name">Lint</span>
          <span class="check__time" data-time>queued</span>
        </li>
      </ul>

      <div class="pr__actions">
        <button class="merge" type="button" data-merge disabled aria-live="polite">
          <span class="merge__fill" aria-hidden="true" data-fill></span>
          <span class="merge__shine" aria-hidden="true" data-shine></span>
          <span class="merge__icon" aria-hidden="true">
            <svg viewBox="0 0 20 20"><circle cx="6" cy="4.5" r="1.9"/><circle cx="6" cy="15.5" r="1.9"/><circle cx="14" cy="15.5" r="1.9"/><path d="M6 6.4v7.2M6 6.4c0 4.6 3.4 6.4 6.2 8.4"/></svg>
          </span>
          <span class="merge__icon merge__icon--done" aria-hidden="true">
            <svg viewBox="0 0 20 20"><path data-donetick d="M5 10.4l3.2 3.2L15 6.6" pathLength="1"/></svg>
          </span>
          <span class="merge__labels"><span class="merge__label" data-label>Waiting for checks</span></span>
          <span class="merge__bar" aria-hidden="true"><span class="merge__bar-in" data-bar></span></span>
        </button>
        <button class="del" type="button" data-del>
          <svg viewBox="0 0 20 20" aria-hidden="true"><path d="M4.5 6h11M8 6V4.5h4V6M6.2 6l.7 9.5h6.2l.7-9.5"/></svg>
          <span data-del-label>Delete branch</span>
        </button>
      </div>
      <p class="pr__note" data-note>3 checks running · 2 approvals</p>
    </section>

    <svg class="pointer" viewBox="0 0 24 24" aria-hidden="true" data-pointer><path d="M5 3.5 18.5 12 12.4 13.6 9.4 19.6z"/></svg>
  </main>
  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
  <script src="script.js"></script>
</body>
</html>

Playground

Change values, colours and text with the controls and watch the animation respond live. Or write in the code yourself. Then download the folder with your changes.

33 values to change

Or ask your AI assistant for it

With the Animorio connector, Claude Code, ChatGPT, Cursor or VS Code take it from here, guide included, and fit it into your project. Paste this request:

Take “Merge button” from Animorio and fit it into my site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On a black page sits a graphite card with soft corners, a one pixel edge, a layered shadow and at the top a soft light in the colour of the state. At the head brackwater / tidepool-sync and the Open pill, then Change #482 and the title Add offline mode to the sync worker. Below, a little graph: the straight line of main and above it the feat/offline-sync branch with its ring commits. Then three rows of checks, Build, Tests (218 passed) and Lint, each with a spinning ring and its seconds counting up from queued; they finish in a different order, the ring closes, the tick draws itself and the icon gives a small bounce, while the line below counts how many are left. When the last one passes the Waiting for checks button wakes up: blue fills it from the left, the word rolls into Merge change and a light crosses it. A drawn pointer presses it: it gives and springs back, the word becomes Merging…, a thin bar runs along its foot and in the graph the branch bends down into main. Then the button turns green with Merged and its tick, the pill at the top rolls into Merged, the card's light turns green, the merge commit opens and beside it Delete branch slides in; pressed, the branch name is struck through and the branch fades. After a pause the loop starts again. With a real mouse the drawn pointer leaves and you press it yourself.

How it works

The spinning checks

Each check is an SVG ring with pathLength=1 and stroke-dasharray .28 .72: a GSAP tween with repeat: -1 spins it, while an object { s } goes from zero to the check's seconds and writes the time on every update. The ends sit at different fractions of CHECK_TIME, so they finish in an order that feels real; at the end the spin stops, the stroke closes to 1 0 and the tick draws itself from its stroke-dashoffset.

The button that wakes up

The button starts disabled. When the last check passes it lights up: the fill is a layer with transform-origin on the left going from scaleX 0 to 1 in FILL seconds, and a slanted strip of light crosses the pill, which has overflow: hidden. The label rolls: the new one comes from below on a back.out, the old one leaves upwards, both in the same grid cell so the width never jumps.

The join in the graph

The branch going down into main is a path with pathLength=1 drawn by stroke-dashoffset together with the thin bar running under the word Merging… (scaleX over MERGE_TIME). Once done, the merge commit opens on a back.out(OVERSHOOT), the state pill rolls into Merged and the --tint variable goes from blue to green, colouring the light at the top of the card and the fill.

The pilot and the hand

A pointer drawn in SVG plays the story with a GSAP timeline that reads the buttons' positions at that moment (functions inside x and y), so it works at any size. At the first move of a real mouse or the first touch it leaves: the button waits for your click, and after nine quiet seconds, or after the merge, the pilot starts again.

Values to change

NameFileDefaultWhat it changes
CHECK_TIMEscript.js2.4Seconds the slowest check takes to pass.
FILLscript.js0.7Seconds for the colour to fill the button when it wakes up.
MERGE_TIMEscript.js1.1Seconds of the bar that runs while it merges.
PRESSscript.js0.955How much the button gives under the finger (1 never).
OVERSHOOTscript.js1.6How far the merge commit and the labels pass their mark before settling (0 none).
SHINEscript.js0.9Seconds of the light crossing the button (0 none).
HOLDscript.js2.4Seconds Merged stays before the story starts again.
SPEEDscript.js12 = everything twice as fast, 0.5 = half.
LOOPscript.jstrueThe story plays again and again.

Try them in the Playground

When to use it

On the change request page of a developer tool, in the dashboard of a continuous integration service or on the landing page of a product for people who write code: the button stays off until the checks pass and then shows the merge while it happens. The same gesture works for any action that waits for checks before it starts: a release, a deploy, a payment waiting for its verifications.

On phones

The same animation with adapted sizes: the card is 92% of the screen wide, spacing and type are sized on the height too so everything fits the phone's box, and under 380 pixels Delete branch shows only its icon. A finger presses it like the mouse.

With reduced motion

Nothing moves or spins: the checks pass with their times changing in place, the ticks and the merging branch appear already drawn, the labels swap with a fade, the thin bar fills in place while it merges, the button takes its colour without giving and without the crossing light, and the drawn pointer is not there.

Pitfalls

  • The checks inside the pilot's timeline stopped halfway when a real mouse arrived, because stopping the pilot stopped them too: the checks have their own timeline, and the pilot just waits for them in time.
  • The new and old labels side by side widened the button for a moment: both sit in the same grid cell (grid-area 1 / 1).

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 8.0 KB; the libraries: GSAP 28 KB.

Testing

Tested on 9 November 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

Use it in your own projects and in your clients’ projects. Do not resell it or redistribute it as is. GSAP stays under its own Standard license. Full license.

All components