
The elastic button
Buttons, Hover, Text
A chess clock in a card on white: two halves, White and Black, each with its time in large figures and its move count. The dark ground sits under whoever is to move; a tap on your own half passes the turn: the ground slides across with a bounce, a green “+2” chip adds the increment and the other’s time starts going down. Under ten seconds the figures turn red with tenths; at zero the flag falls, the ground turns red and you read who wins on 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>
<!--
"Chess clock" 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>Chess clock</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 chess clock: two halves with each player's time, a tap on your own half to pass the turn, the dark
ground sliding to the other side, the increment added and red tenths under ten seconds -->
<section class="cc" data-cc aria-label="Chess clock">
<header class="cc__head">
<div class="cc__what"><strong>Chess clock</strong><span data-outmode>Bullet, 12 s and 2 s a move</span></div>
<span class="cc__state"><span class="cc__clip"><span data-outstate>Paused</span></span></span>
</header>
<div class="cc__clock" data-clock>
<span class="cc__thumb" data-thumb></span>
<button type="button" class="cc__side" data-side aria-label="White, pass the turn"><span class="cc__name">White</span><span class="cc__time" role="timer"><b data-outtime>0:12</b></span><span class="cc__moves"><span class="cc__clip"><span data-outmoves>No moves yet</span></span></span><i class="cc__inc" data-inc>+2</i></button>
<button type="button" class="cc__side" data-side aria-label="Black, pass the turn"><span class="cc__name">Black</span><span class="cc__time" role="timer"><b data-outtime>0:12</b></span><span class="cc__moves"><span class="cc__clip"><span data-outmoves>No moves yet</span></span></span><i class="cc__inc" data-inc>+2</i></button>
</div>
<div class="cc__row">
<span class="cc__hint"><span class="cc__clip"><span data-outhint>Press play to start</span></span></span>
<button type="button" class="cc__btn" data-play aria-label="Start the clock"><svg viewBox="0 0 16 16" aria-hidden="true"><path class="cc__ic-play" d="M5.200 3.400v9.200l7.400-4.600Z"></path><path class="cc__ic-pause" d="M5 3.500v9M11 3.500v9"></path></svg></button>
<button type="button" class="cc__btn" data-reset aria-label="Reset the clock"><svg viewBox="0 0 16 16" aria-hidden="true" data-reseticon><path class="cc__ic-line" d="M3.200 8a4.800 4.800 0 1 0 1.500-3.500M3 2.600v2.600h2.600"></path></svg></button>
</div>
</section>
<span class="live" aria-live="polite" data-live></span>
<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.
21 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 “Chess clock” from Animorio and fit it into my siteEach side’s seconds, the moves, whose turn it is, whether the clock runs and who ran out: only the time of the side to move goes down.
The tap only counts on the half to move and with the clock running: it adds the increment to the mover, counts the move and changes turn.
The dark ground is one element sliding between the two halves; its place is worked out from the panel’s width and worked out again on resize.
Above the threshold the time is written rounded up to the second; below it, with the tenths cut off: so zero only appears when it is really over.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #e0452f | The colour of time running out and of the fallen flag. |
SECONDS | script.js | 12 | How many seconds each player has at the start. |
INC | script.js | 2 | How many seconds are gained with every move. |
LOW | script.js | 10 | Under how many seconds the time turns red and shows tenths. |
LOOP | script.js | true | Left alone, the demo’s pointer plays a few moves, pauses and resets. |
On the site or in the app of a chess club, a tournament or a board game platform, and as a tool to keep open on the table; the same two-half clock carries the speaking turns of a debate, the times of a card game, the answers of a two-player quiz or two speakers’ minutes.
The card is at most 348 pixels wide and about 300 tall. The two halves are 130 pixels tall and half the panel wide, all tappable; under 350 pixels the figures go down to 38 pixels. The play and reset keys are 40-pixel circles.
Time still runs, but the dark ground changes half in one step, without sliding or bouncing; no increment chip, no starts, texts change in one step. The demo’s pointer does not start.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.9 KB; the libraries: GSAP 28 KB.
Tested on 2 December 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.