
The elastic button
Buttons, Hover, Text
One piece, one gesture, in the simple style of real product interface pieces: the «Ships today» box of a product page in an online shop, on white. The time left to ship today drops in steps with rolling digits, while the now mark walks along a thin ruler of the day up to the 4 pm cutoff; when it passes, the ruler widens to tomorrow, the promise becomes Ships tomorrow, the delivery slips by one day and an accent line redraws up to the new cutoff.
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>
<!--
"Shipping cutoff timer" 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 ships-today timer with the day widening to tomorrow</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">
<!-- one gesture: the cutoff passes. The time left to ship today counts down while the now mark walks to the
cutoff on a ruler of the day; at the cutoff the ruler widens to tomorrow and the promise rolls over -->
<section class="ship" data-ship data-inquadra tabindex="0" role="timer" aria-label="Dispatch cutoff timer">
<div class="ship__top">
<span class="ship__ico" data-ico aria-hidden="true">
<svg viewBox="0 0 20 20"><path class="ico__box" d="M3.6 6.6 10 3.6l6.4 3v7.2L10 16.8l-6.4-3Z"></path><path class="ico__seam" d="M3.6 6.6 10 9.6l6.4-3M10 9.6v7.2"></path><path class="ico__lid" data-lid d="M6.8 5.1l6.4 3"></path></svg>
</span>
<span class="swap swap--ships" data-swap="ships">
<span class="swap__t" data-k="today">Ships today</span>
<span class="swap__t" data-k="tomorrow">Ships tomorrow</span>
</span>
<span class="swap swap--date" data-swap="date">
<span class="swap__t" data-k="today">Arrives Tue, Nov 3</span>
<span class="swap__t" data-k="tomorrow">Arrives Wed, Nov 4</span>
</span>
</div>
<p class="ship__left" aria-live="off">
<span class="ship__lead">Order within</span>
<span class="time" data-time>
<span class="time__h" data-hgroup><span class="odo" data-odo-h></span><span class="time__u"> hr </span></span><span class="odo" data-odo-m></span><span class="time__u"> min</span>
</span>
</p>
<div class="track" data-track aria-hidden="true">
<span class="track__base"></span>
<span class="track__ticks" data-ticks></span>
<span class="track__rest" data-rest></span>
<span class="cut" data-cut="16"><span class="cut__bar"></span></span>
<span class="cut" data-cut="40"><span class="cut__bar"></span></span>
<span class="track__cutlabel" data-cutlabel>4 pm cutoff</span>
<span class="now" data-now><span class="now__bar" data-nowbar></span></span>
<span class="track__nowlabel" data-nowlabel>2:48 pm</span>
</div>
<span class="measure" data-measure aria-hidden="true"></span>
</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>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.
23 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 “Shipping cutoff timer” from Animorio and fit it into my siteThe whole ruler comes from a single object: the current time, the start of the view, its span in hours and how far the accent line is drawn. One function turns hours into pixels ((t minus start) over span times width) and on every frame, only when something changed, places with a translateX the ticks, the now mark, the two cutoffs and the labels, and the accent line with translateX and scaleX.
The day widening to tomorrow is not a CSS scale: GSAP takes the view start from 10 to 13.2 and the span from 7 to 29.2 hours with expo.inOut, so the ticks draw closer while staying thin and sharp, and the opacity of the hour ticks drops with the space between them. The line to the new cutoff starts a little later with its own tween from 0 to 1.
Each digit sits in a window with hidden overflow, aligned from the right: where a digit changes the old one falls and the new one drops in from above with back.out, 40 milliseconds after the column to its right, and the window goes to the width of the new digit, measured once for each digit from 0 to 9. The hours sit in a group that folds to zero width when they are no longer needed.
The steps of the time are 72 per cent of the previous one while more than six minutes are left, then one at a time; each is a call in a repeating GSAP timeline, together with the passing of the cutoff and the fade of the return: no setTimeout, so the site’s bench can pause and scrub it.
On mouse hover (only inside hover: hover), on focus or with a tap the box takes the is-open class: the exact time appears above the mark and the accent line goes from 2 to 3 pixels on a bouncing curve. The ruler labels are kept inside the edges, so they never spill out sideways.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #ff4d12 | The colour of the cutoff and of the time left. |
START_MIN | script.js | 72 | The minutes left to ship today when the loop starts. |
URGENT_MIN | script.js | 10 | Under these minutes the time takes the accent colour. |
STEP | script.js | 0.62 | The seconds between one step of the time and the next. |
BOUNCE | script.js | 1.6 | How much the now mark and the digits bounce. |
ZOOM | script.js | 1.25 | The seconds the day takes to widen to tomorrow. |
PAUSE | script.js | 2.6 | The seconds the loop shows Ships tomorrow before starting again. |
On the product page or in the cart of an online shop that ships the same day before a cutoff: clothing, books, electronics, flowers, last-minute gifts. It makes the time feel like it is passing without rushing anyone with an alarm, and when the cutoff has gone it shows the new promise straight away instead of disappearing.
The box is at most 90% of the screen wide, with margins and type in clamp; the ruler takes the width it has and is measured again on resize, and the labels stay inside the edges. A tap does what hovering does: it shows the exact time and thickens the line, another tap closes it.
No springs, rolls or zoom: digits and labels change with a fade, the now mark moves on the step without gliding, and when the cutoff passes the ruler fades out and back in already widened to tomorrow.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.0 KB; the libraries: GSAP 28 KB.
Tested on 1 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.