Skip to content
animorio
IT
All components

Rollback button

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

The Roll back button of the panel of an invented developer platform, Halyard, in dark glass: version v2.14.0 throws errors in four regions. Pressed, the light button turns dark and walks the regions one after the other: a light runs backwards along each line, the time in milliseconds is written, the version tag rolls to v2.13.2 and the error chart falls. It lands on Rolled back with a self-drawing check and the panel cooling down.

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>
<!--
  "Rollback 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 Rollback button with the regions going back to the last version</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/geist-mono@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage">
    <!-- the release panel of Halyard, an invented hosting platform: version v2.14.0 is throwing errors. The Roll back
         button walks the four regions one after the other, a light runs back along each line, the version tag rolls
         to v2.13.2 and the time in milliseconds is written; the error rate falls and the button lands on Rolled back -->
    <section class="card" data-card aria-label="atlas-api, production">
      <header class="head">
        <span class="mark" aria-hidden="true">
          <svg viewBox="0 0 24 24"><path d="M12 3.5 19.5 8v8L12 20.5 4.5 16V8z"/><path d="M12 8.2v7.6M8.6 10.2 12 8.2l3.4 2"/></svg>
        </span>
        <div class="head__name">
          <p class="head__title">atlas-api</p>
          <p class="head__sub">Production <span class="mono" data-current>v2.14.0</span></p>
        </div>
        <div class="errs" data-errs>
          <svg class="errs__spark" viewBox="0 0 64 22" preserveAspectRatio="none" aria-hidden="true">
            <path class="errs__area" data-spark-area d=""/>
            <polyline class="errs__line" data-spark points=""/>
          </svg>
          <div class="errs__text">
            <span class="errs__num mono" data-errs-num>4.8%</span>
            <span class="errs__label">errors</span>
          </div>
        </div>
      </header>

      <ul class="regions" data-regions>
        <li class="region" data-region data-ms="38">
          <span class="region__name">Frankfurt <span class="mono">fra1</span></span>
          <span class="region__line" aria-hidden="true"><i class="region__glow" data-glow></i><i class="region__comet" data-comet></i></span>
          <span class="region__ms mono" data-ms-out></span>
          <span class="ver mono" data-ver><span class="ver__in">v2.14.0</span></span>
        </li>
        <li class="region" data-region data-ms="71">
          <span class="region__name">Virginia <span class="mono">iad1</span></span>
          <span class="region__line" aria-hidden="true"><i class="region__glow" data-glow></i><i class="region__comet" data-comet></i></span>
          <span class="region__ms mono" data-ms-out></span>
          <span class="ver mono" data-ver><span class="ver__in">v2.14.0</span></span>
        </li>
        <li class="region" data-region data-ms="118">
          <span class="region__name">Singapore <span class="mono">sin1</span></span>
          <span class="region__line" aria-hidden="true"><i class="region__glow" data-glow></i><i class="region__comet" data-comet></i></span>
          <span class="region__ms mono" data-ms-out></span>
          <span class="ver mono" data-ver><span class="ver__in">v2.14.0</span></span>
        </li>
        <li class="region" data-region data-ms="164">
          <span class="region__name">Sydney <span class="mono">syd1</span></span>
          <span class="region__line" aria-hidden="true"><i class="region__glow" data-glow></i><i class="region__comet" data-comet></i></span>
          <span class="region__ms mono" data-ms-out></span>
          <span class="ver mono" data-ver><span class="ver__in">v2.14.0</span></span>
        </li>
      </ul>

      <button class="rb" type="button" data-rb data-autoclic aria-label="Roll back production to v2.13.2">
        <span class="rb__fill" data-fill aria-hidden="true"></span>
        <span class="rb__shine" aria-hidden="true"></span>
        <span class="rb__face rb__face--idle" data-idle>
          <svg class="ico" data-undo viewBox="0 0 24 24" aria-hidden="true"><path d="M5.5 9.5a7.2 7.2 0 1 1-.6 5.6"/><path d="M5 4.8v4.9h4.9"/></svg>
          <span>Roll back to <span class="mono">v2.13.2</span></span>
        </span>
        <span class="rb__face rb__face--busy" data-busy>
          <svg class="ico ico--spin" data-spin viewBox="0 0 24 24" aria-hidden="true"><path d="M5.5 9.5a7.2 7.2 0 1 1-.6 5.6"/><path d="M5 4.8v4.9h4.9"/></svg>
          <span class="rb__words">Rolling back <span class="where" data-where><span class="where__in">Frankfurt</span></span></span>
          <span class="rb__clock mono" data-clock>0 ms</span>
        </span>
        <span class="rb__face rb__face--done" data-done>
          <svg class="ico ico--ok" viewBox="0 0 24 24" aria-hidden="true"><path data-check d="m5.5 12.5 4.2 4.2 8.8-9.4"/></svg>
          <span class="rb__words">Rolled back to <span class="mono">v2.13.2</span></span>
          <span class="rb__clock mono" data-total>164 ms</span>
        </span>
      </button>
      <p class="sr" aria-live="polite" data-say></p>
    </section>
  </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.

44 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 “Rollback 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 pure black sits the dark glass panel of atlas-api, an invented service on the Halyard platform, with a one pixel edge catching the light at the top, a fine grain and a warm orange in the corner. At the top the mark, the name and «Production v2.14.0» with the version in orange; on the right a small tag with the error line chart that has just jumped and the number, 4.8%. Below, four regions in a row (Frankfurt, Virginia, Singapore, Sydney, each with its code), each with a thin line and the version tag, v2.14.0, in orange; on hover the row takes a slightly lighter background. At the bottom the light «Roll back to v2.13.2» button with the arrow turning back: on hover the arrow turns back a little and a light follows the pointer along the top edge; pressed it drops by a pixel, squeezes and its shadow gets shorter. On release the label rises and disappears, the button turns dark and «Rolling back» arrives with the arrow spinning backwards, the region name rolling and the time. Region after region a teal light runs backwards along the line, from the version tag to the name, leaving the line softly lit; meanwhile the milliseconds are written, 38, 71, 118, 164, and at the end the tag rolls to v2.13.2, turns teal and makes a little jump. The error number falls at each region and the chart slides right with the line coming down. At the end «Rolled back to v2.13.2» with the teal check drawing itself and the total time, the button drops by a pixel and comes back, the version at the top turns teal and the panel cools down: the orange in the corner goes out and a teal veil rises from below. After a couple of seconds everything goes back to rest for the next round. The button presses itself; it also works with mouse, finger and keyboard.

How it works

One button, three faces

There is only one button and on top of its light background sits a dark one that GSAP turns on at the click. The three faces, rest, work and done, are stacked: the hidden ones also get visibility: hidden, so screen readers skip them.

The light that goes back

Each line has a CSS property --p that GSAP takes from 0 to 1: the comet (a gradient with a light head and a drop-shadow) sits at right: calc(var(--p) * (100% - its width)), so it follows the line whatever its length, even if the window changes halfway. Behind it the crossed part lights up with a scaleX starting from the right.

Tags and words that roll

Each new version and region name is born below the old one: it comes in from yPercent 100 with back.out, the old one leaves to -100 and is removed. The tag changes colour with a CSS transition and makes a 6% scale jump there and back.

The chart that slides

The error line is a window of twelve points over a longer series: a single number, the position of the window, goes from 0 to 6 and on every frame the interpolated points of the polyline and of the area below are worked out again. So the chart really slides right and the peak comes down, instead of warping.

Values to change

NameFileDefaultWhat it changes
STEPscript.js0.7The seconds for each region: the light, the time and the new version.
BOUNCEscript.js1.8How much the springs of the button and of the tags overshoot (0 = none).
HOLDscript.js2.6The seconds the button stays on Rolled back before going back to rest.
ERRORS_BEFOREscript.js4.8The error rate of the broken version, in percent.
ERRORS_AFTERscript.js0.2The error rate once every region is back.
FROM_VERSIONscript.jsv2.14.0The broken version.
TO_VERSIONscript.jsv2.13.2The version the button rolls back to.
LIGHTscript.js#5eead4The colour of the light running back and of the good version.

Try them in the Playground

When to use it

For the panel of a hosting platform, a cloud service, a release tool or any app where an important action has to be undone in several places: the person pressing sees where it has got to, how long each place takes and that the problem is going away.

On phones

The panel is 92% of the screen wide and the rows are sized on the height too; under 380 pixels the region codes hide, the chart narrows and the line keeps at least 14 pixels. The button stays 56 pixels tall and a tap does what a click does.

With reduced motion

Nothing moves: the button changes face with a fade, the arrow does not spin, the light does not run and the line lights up at once, versions and names change with a fade, the check appears already drawn.

Pitfalls

  • The comet cannot go to an x in pixels measured once: the demo window changes width while you watch it. With the --p variable and calc() in right the position works itself out again.
  • On the short phone lines a 34 pixel comet was longer than the line: its width is min(34px, 70%) and the same min sits in the calc.
  • The chart tweened as a string of points warped: interpolating the polyline numbers moves the points up and down but does not make time slide. The window position is tweened and the points worked out again.
  • The check draws itself by animating the stroke-dashoffset attribute, not the CSS property.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, Geist Mono (font variabile) 5.3.0.

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

Testing

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