
The elastic button
Buttons, Hover, Text
The stopwatch of a clock app, on black: Start sets the time running with its hundredths, Lap drops the row of the lap just closed on top of the list and the others make room. A thin strip measures the lap in progress against the best one, the fastest lap turns green and the slowest red, and Reset takes everything back to zero.
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>
<!--
"Lap stopwatch" 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>Lap stopwatch</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 stopwatch of a clock app: the time runs, Lap drops a new row on top of the list,
the strip measures the lap against the best one and the fastest and slowest laps take a colour -->
<section class="sw" data-sw aria-label="Stopwatch">
<p class="sw__time" role="timer" aria-label="Elapsed time" data-time></p>
<p class="sw__now"><span class="sw__nowname"><span data-lapname>Lap 1</span></span><span class="sw__nowtime" data-laptime></span></p>
<div class="sw__strip" aria-hidden="true">
<span class="sw__fill sw__fill--echo" data-echo></span>
<span class="sw__fill" data-fill></span>
<span class="sw__best" data-best></span>
</div>
<div class="sw__keys">
<button class="sw__key" type="button" data-lap disabled><span class="sw__keytext"><span data-laplabel>Lap</span></span></button>
<button class="sw__key sw__key--go" type="button" data-go><span class="sw__keytext"><span data-golabel>Start</span></span></button>
</div>
<ol class="sw__list" data-list aria-label="Laps"></ol>
<span class="sw__say" data-say aria-live="polite"></span>
</section>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></path></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>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.
17 values to change
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
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 “Lap stopwatch” from Animorio and fit it into my siteStart launches a linear tween on one number, the seconds gone by; Stop kills it. Everything else is drawn from it on every frame.
Every digit sits in a fixed-width cell and is rewritten only when it changed: the time does not tremble and tabular figures are not needed.
Lap puts the new row on top: the old ones start one row higher and come back to their place on a spring, the new one drops in and gains opacity.
At every lap the lowest and the highest times are found and the two classes moved; the strip widens to the slowest lap and the notch marks the fastest.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #35d980 | The colour of Start, of the strip and of the fastest lap. |
SLOW | script.js | #ff6f61 | The colour of Stop and of the slowest lap. |
ROWS | script.js | 3 | How many laps show in the list: 2 to 4. |
DELTA | script.js | true | Next to each lap, the difference from the lap before. |
SPRING | script.js | 1 | How much the rows and the buttons bounce: 0.3 = a little, 2 = a lot. |
LOOP | script.js | true | Left alone, the demo’s pointer starts the time, marks three laps, stops and resets. |
In a clock app, in a running, swimming or training app, in a timekeeper’s or a track’s panel, and anywhere split times are measured one after the other.
The same card, 276 pixels wide at most: the big time narrows with the width, the two buttons are 44 pixels tall and the list keeps three rows, so everything fits a short screen.
The time still runs, because it is the data; no springs and no dropping rows: the laps appear in place, the button labels change at once and Reset zeroes in one step. The demo does not move by itself.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.2 KB; the libraries: GSAP 28 KB.
Tested on 23 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.
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.