Skip to content
animorio
IT
All components

Run tests button

Buttons, HoverGSAP, Canvas, CSS onlyMediumCompressed weight: Demo 9.9 KBGSAP 28 KBFreeDownload the zip

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.

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>
<!--
  "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>

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.

31 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 “Run tests 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 an almost black page, with a soft light in the middle and a very fine grain, a pill button 60 pixels tall in brushed graphite sits alone: very thin horizontal lines in the metal, a slanted band of light, the top edge catching the light in one pixel and the bottom one in shadow. On the left a round icon with the play triangle, then the words Run tests and under them, small, «128 tests · main»; a thin cut in the metal and on the right a matrix of forty eight cells in three rows, each in its dark slot, barely visible. With the mouse over it, a stretched light follows the pointer on the metal and the cells near the pointer brighten and rise by a hair, as under a lens. Pressed, the button sinks by a pixel, narrows a little and the cells dim; on release it springs back. Then the tests run: the play becomes a turning amber arc, the words become Running with a band of light crossing them and below the count climbs towards 128. The cells light up from left to right, column after column with a little disorder: amber and flickering while their file runs, then a white flash turning mint with a small hop when it passes; an amber scan line runs on the front. Two thirds of the way a cell turns coral and shakes, the button gives a little jolt and «1 retry» appears below; the cell turns amber again, retries and passes. The glow under the button turns greener and greener. At the end every cell flashes together, a wave of white light crosses the matrix diagonally, the metal swells by a hair and springs back, a reflection crosses it, the arc becomes a mint check that draws itself, the words become 128 passed and below «in 2.4s». After a moment the cells go dark from right to left and the button is ready again. Until someone touches it, it goes round by itself.

How it works

Brushed metal in CSS

The 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 matrix on a canvas

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.

One clock for every file

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.

The success

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.

It draws only when needed

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.

Values to change

NameFileDefaultWhat it changes
LABEL_RESTscript.jsRun testsThe word at rest.
LABEL_BUSYscript.jsRunningThe word while the tests run.
BRANCHscript.jsmainThe branch written in the small line at rest.
TESTSscript.js128How many tests the suite has.
COLUMNSscript.js16How many columns of cells.
ROWSscript.js3How many rows of cells.
DURATIONscript.js3.2How many seconds the tests take.
FLAKYscript.jstrueOne file fails, turns coral and passes on its retry.
GLOWscript.js1How much the cells glow.
SPRINGscript.js1How springy the press is: 0.4 calm, 2 very bouncy.
HOLDscript.js1.8How many seconds 128 passed stays before going back to rest.
AUTOscript.jstrueThe button goes round by itself until someone touches it.

Try them in the Playground

When to use 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 phones

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.

With reduced motion

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.

Pitfalls

  • The glow of the cells with a canvas as large as the matrix was cut at the edges: the canvas reaches eight pixels past every side and draws with a translation.
  • The random generator without a seed changed the order of the cells on every lap and the poster fell on a different moment each time: the seed is reset on every run, and the loop starts from the load event.
  • Drawing continuously in the ticker kept the processor busy even at rest: it redraws only while the tests run or while something keeps it awake.

Libraries

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.

Testing

Tested on 3 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