Skip to content
animorio
IT
All components

Shipping cutoff timer

Timers, HoverGSAP, CSS onlyMediumCompressed weight: Demo 7.0 KBGSAP 28 KBFreeDownload the zip

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.

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>
<!--
  "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">&nbsp;hr&nbsp;</span></span><span class="odo" data-odo-m></span><span class="time__u">&nbsp;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>

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.

23 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 “Shipping cutoff timer” 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 white, a box with round corners and a barely visible border: at the top the small line-drawn box, Ships today and on the right, in grey, Arrives Tue, Nov 3; below, Order within 1 hr 12 min; at the bottom a thin ruler of the day, with the hour ticks, the black now mark and the orange cutoff tick, 4 pm cutoff, joined by an accent line: the time left. The time drops in steps, wide at first and then minute by minute: at each step the digits that change roll down from the right, each in its own window that narrows or widens to the new digit, the hours leave folding sideways, and the now mark slides towards the cutoff on a spring, bends slightly and straightens, while the accent line gets shorter. Under ten minutes the time turns orange and the cutoff tick jumps at each step. At zero the tick stretches and comes back on an elastic, turns grey, the lid of the small box lifts and drops, Ships today leaves upwards narrowing on the wdth axis and Ships tomorrow comes in, the date slides to Wed, Nov 4, the time rolls to 23 hr 59 min; meanwhile the ruler widens from the day to a day and a half, the ticks get denser, midnight appears with Wed, and the accent line redraws from now to tomorrow’s cutoff. On mouse hover, keyboard focus or a tap, the exact time appears above the mark and the time-left line gets thicker with a bounce. The loop starts again by itself.

How it works

A ruler drawn from four numbers

The 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 zoom is a tween of numbers

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.

An odometer with windows as wide as the digit

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 in a timeline

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.

The second state

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.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#ff4d12The colour of the cutoff and of the time left.
START_MINscript.js72The minutes left to ship today when the loop starts.
URGENT_MINscript.js10Under these minutes the time takes the accent colour.
STEPscript.js0.62The seconds between one step of the time and the next.
BOUNCEscript.js1.6How much the now mark and the digits bounce.
ZOOMscript.js1.25The seconds the day takes to widen to tomorrow.
PAUSEscript.js2.6The seconds the loop shows Ships tomorrow before starting again.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

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.

Pitfalls

  • With the digits in absolutely positioned windows the line lost its baseline and the digits rose above Order within: the line is aligned to the centre, with the same line height for digits and words.
  • With every window as wide as the zero, the 1 and the 2 stood apart as in a table: each digit is measured on its own and the window goes to the new digit’s width along with the roll.
  • The ruler labels follow their tick and tomorrow’s cutoff sits a few pixels from the right edge: without keeping them inside the edges, 4 pm cutoff spilled out sideways.

Libraries

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.

Testing

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