
The elastic button
Buttons, Hover, Text
The Run tests button of a developer tool, in brushed graphite on an almost black page, like a Dribbble shot: on the right a small matrix of cells, one per test file, dark at rest, brightening under the pointer as under a lens. Pressed, the metal gives and springs back and the tests run inside the button: the cells light up column after column, amber while their file runs and mint when it passes, with a scan line on the front; one file fails, turns coral and shakes, then retries and passes. The count climbs, at the end every cell flashes, a wave of light crosses the matrix and the button says 128 passed with the time.
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>
<!--
"Run tests 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 Run tests button with the cells that light up</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">
<!-- the Run tests button of a developer tool, in brushed graphite. On the right a small matrix of cells, one per
test file: at rest they are dark, on hover they brighten under the pointer. Pressed, the suite runs inside the
button: the cells light up column by column, amber while a file runs, mint when it passes; one fails, turns
coral, retries and passes. At the end every cell flashes, a wave of light crosses the matrix, a reflection
crosses the metal and the button says 128 passed with the time it took -->
<div class="tb" data-wrap>
<span class="tb__spill" data-spill aria-hidden="true"></span>
<button class="tb__btn" type="button" data-btn aria-label="Run tests, 128 tests on main">
<span class="tb__body" data-body>
<span class="tb__metal" aria-hidden="true"></span>
<span class="tb__shine" data-shine aria-hidden="true"></span>
<span class="tb__sweep" aria-hidden="true"><span class="tb__sweep-band" data-sweep></span></span>
<span class="tb__row">
<span class="tb__icon" aria-hidden="true">
<svg viewBox="0 0 24 24">
<circle class="tb__ring" cx="12" cy="12" r="9.2"/>
<path class="tb__play" data-play d="M10.2 8.6v6.8c0 .5.5.8.9.5l5-3.4c.4-.2.4-.8 0-1l-5-3.4c-.4-.3-.9 0-.9.5z"/>
<circle class="tb__spin" data-spin cx="12" cy="12" r="9.2" pathLength="1"/>
<path class="tb__check" data-check pathLength="1" d="M8.2 12.3l2.6 2.6 5-5.4"/>
</svg>
</span>
<span class="tb__text" aria-hidden="true">
<span class="tb__labels">
<span class="tb__label" data-label>Run tests</span>
<span class="tb__label tb__label--busy" data-label>Running</span>
<span class="tb__label" data-label>128 passed</span>
</span>
<span class="tb__subs">
<span class="tb__sub" data-sub>128 tests · main</span>
<span class="tb__sub" data-sub><span data-count>0</span> / <span data-total>128</span><span class="tb__retry" data-retry> · 1 retry</span></span>
<span class="tb__sub tb__sub--ok" data-sub>in 2.4s</span>
</span>
</span>
<span class="tb__rule" aria-hidden="true"></span>
<span class="tb__matrix" data-matrix aria-hidden="true"><canvas data-canvas></canvas></span>
</span>
</span>
</button>
</div>
<p class="sr" aria-live="polite" data-live></p>
</main>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
<script src="script.js"></script>
</body>
</html>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.
31 values to change
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 “Run tests button” from Animorio and fit it into my siteThe graphite is a single box with three stacked backgrounds: a vertical repeating-linear-gradient with one light and one dark pixel every three (the brushing lines), a slanted band of light and the top to bottom gradient; four inner shadows make the one pixel edge, the light at the top, the shadow at the bottom and the hollow at the base. Above, a wide and low radial-gradient follows the pointer through two CSS variables moved by gsap.quickTo, like the stretched light on brushed metal.
The cells are drawn on a canvas eight pixels larger on every side (so the glow is not cut), with the devicePixelRatio and the sizes recomputed by a ResizeObserver. Every cell has its dark slot with a thread of light below, then its colour with shadowBlur for the glow and a highlight on top. The colours are read from the :root variables with getComputedStyle, so the Playground palette changes them.
On click every cell gets a start and an end (the column gives the start, a seeded generator adds the disorder), and a single GSAP tween runs the clock from 0 to the duration. From that clock every cell knows whether it is off, running (amber flickering with an offset sine), just passed (white to mint with a hop) or, for the flaky file, failed (coral with a damped shake) and then running again. The count is the number of passed cells scaled to 128.
At the end of the run every cell takes the mint and flashes together, a wave variable crosses the matrix diagonally and brightens the cells near it, the body goes to 1.016 and comes back on an elastic spring, a band of light crosses it with xPercent and the check draws itself with pathLength 1 and strokeDashoffset. On the way back a single dark variable turns the cells off from right to left.
The canvas is redrawn in the GSAP ticker only while the tests run or while a poke function keeps the drawing awake (hover, press, wave, switching off): at rest and with no pointer nothing is redrawn.
| Name | File | Default | What it changes |
|---|---|---|---|
LABEL_REST | script.js | Run tests | The word at rest. |
LABEL_BUSY | script.js | Running | The word while the tests run. |
BRANCH | script.js | main | The branch written in the small line at rest. |
TESTS | script.js | 128 | How many tests the suite has. |
COLUMNS | script.js | 16 | How many columns of cells. |
ROWS | script.js | 3 | How many rows of cells. |
DURATION | script.js | 3.2 | How many seconds the tests take. |
FLAKY | script.js | true | One file fails, turns coral and passes on its retry. |
GLOW | script.js | 1 | How much the cells glow. |
SPRING | script.js | 1 | How springy the press is: 0.4 calm, 2 very bouncy. |
HOLD | script.js | 1.8 | How many seconds 128 passed stays before going back to rest. |
AUTO | script.js | true | The button goes round by itself until someone touches it. |
For the main action of a developer tool or a work app that checks something for a few seconds: running the tests, checking the links of a site, validating a file, auditing a project. The matrix tells at a glance how far it has gone and where something went wrong, without an extra bar.
On the phone the button is at most 88% of the screen wide and the cells redraw to their size; there is no hover, so the lens on the cells and the light on the metal turn on at the touch and fade shortly after, and the rest is the same.
Nothing moves: the cells change colour in a fade without flickering or hopping, there is no scan line and no wave, the button does not sink or shake, the icon and the words swap in place and the check fades in.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 9.9 KB; the libraries: GSAP 28 KB.
Tested on 3 November 2026
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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.