Skip to content
animorio
IT
All components

Pre-order counter

Counters, PhysicsGSAP, CSS onlyMediumCompressed weight: Demo 9.7 KBGSAP 28 KBFreeDownload the zip

The pre-order card of a small batch of stoneware, on white, in the style of real product interface pieces: the batch is fired only once 24 pre-orders are in. At every pre-order the big number rolls up, only in the digits that change, one mark per piece lights up from the bottom with a little hop and a toast rises from behind the card with who has just ordered. For the last four the number and the marks turn amber in a wave and «Almost there» slides in; with the batch full the marks all hop together and the black pill squashes into the light amber tile of «Join batch two», with its bell swinging.

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>
<!--
  "Pre-order counter" 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 pre-order counter with the batch that fills up</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 pre-order card of a small batch of stoneware: a big number counts the pre-orders and rolls up every time
         someone joins, one small mark per piece of the batch lights up with a hop, the last few turn amber with
         «Almost there», and when the batch is full the button changes shape and becomes «Join batch two».
         A small toast says who has just pre-ordered. -->
    <div class="po" data-po>
      <div class="po__toast-lane" aria-hidden="true">
        <div class="po__toast" data-toast>
          <span class="po__avatar" data-avatar>M</span>
          <span class="po__toast-text"><b data-who>Mara</b> just pre-ordered</span>
          <span class="po__toast-time">now</span>
        </div>
      </div>

      <article class="po__card" data-card>
        <span class="po__sheen" aria-hidden="true"></span>
        <span class="po__glow" data-glow aria-hidden="true"></span>

        <header class="po__head">
          <span class="po__mark" aria-hidden="true">
            <svg viewBox="0 0 40 40">
              <path class="po__mark-body" d="M11 15.5h18l-1.6 13.2a3 3 0 0 1-3 2.6h-8.8a3 3 0 0 1-3-2.6Z"/>
              <path class="po__mark-rim" d="M10 15.5h20"/>
              <path class="po__mark-glaze" d="M12.2 21.5c2.6 1.4 5.2 1.4 7.8 0s5.2-1.4 7.8 0"/>
              <path class="po__mark-steam" data-steam d="M17.5 11.5c-1-1.4 1-2.4 0-4M22.5 11.5c-1-1.4 1-2.4 0-4"/>
            </svg>
          </span>
          <span class="po__title">
            <span class="po__name">Tide pour-over set</span>
            <span class="po__maker">Ashby Clay · small batch</span>
          </span>
          <span class="po__chip" data-chip>
            <span class="po__chip-in" data-chip-in>
              <svg class="po__chip-check" viewBox="0 0 12 12" aria-hidden="true"><path data-chip-check pathLength="1" d="M2.6 6.3l2.2 2.2 4.6-4.9"/></svg>
              <span data-chip-text>Almost there</span>
            </span>
          </span>
        </header>

        <div class="po__count">
          <p class="po__num" data-num aria-hidden="true"></p>
          <p class="po__of"><span>of</span> <span data-goal>24</span></p>
        </div>
        <p class="po__sub" data-sub-box>
          <span class="po__sub-t" data-sub="open">pre-orders to fire the batch</span>
          <span class="po__sub-t" data-sub="full">The kiln is booked for March</span>
        </p>

        <div class="po__marks" data-marks aria-hidden="true"></div>

        <p class="po__meta">
          <span class="po__left" data-left-box><span data-left>7</span>&nbsp;<span data-left-word>to go</span></span>
          <span class="po__sep">·</span>
          <span data-closes>Closes Sunday</span>
        </p>

        <button class="po__btn" type="button" data-btn>
          <span class="po__btn-bg" data-btn-bg aria-hidden="true"></span>
          <span class="po__btn-labels" data-labels>
            <span class="po__btn-l" data-l="order">Pre-order <span class="po__btn-price">$68</span></span>
            <span class="po__btn-l" data-l="mine">
              <svg class="po__btn-icon" viewBox="0 0 16 16" aria-hidden="true"><path data-btn-check pathLength="1" d="M3.4 8.4l3 3 6.2-6.6"/></svg>
              You’re in
            </span>
            <span class="po__btn-l" data-l="wait">
              <svg class="po__btn-icon po__bell" data-bell viewBox="0 0 16 16" aria-hidden="true"><path d="M4.2 11.2V7.4a3.8 3.8 0 0 1 7.6 0v3.8l1.2 1.3H3Z"/><path d="M6.6 13.6a1.5 1.5 0 0 0 2.8 0"/></svg>
              Join batch two
            </span>
            <span class="po__btn-l" data-l="listed">
              <svg class="po__btn-icon" viewBox="0 0 16 16" aria-hidden="true"><path data-btn-check2 pathLength="1" d="M3.4 8.4l3 3 6.2-6.6"/></svg>
              On the list
            </span>
          </span>
        </button>
      </article>
    </div>
    <p class="sr" aria-live="polite" data-live></p>
  </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.

46 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 “Pre-order counter” 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, alone in the middle, there is the pre-order card of the «Tide pour-over set» of an invented ceramics workshop, Ashby Clay: on top the little cup drawn in a thin line with its steam slowly rising, the name and «small batch». Below, a big number, 17, with «of 24» beside it, then «pre-orders to fire the batch»: the batch goes in the kiln only once all 24 pieces are taken. Further down a row of 24 marks, one per piece, the taken ones filled with black, and the line «7 to go · Closes Sunday»; at the bottom the black pill «Pre-order $68». Every second and a half someone pre-orders: the number rolls up only in the digits that change and lands a pixel past, the new mark fills from the bottom and gives a little hop its neighbours barely feel, and from behind the card’s edge the toast «Mara just pre-ordered» rises with its avatar, then goes. For the last four the number and the marks turn amber in a wave, a warm glow lights up behind the number and «Almost there» slides in beside the name. At 24 the marks all hop, left to right, the number swells and settles, the tag becomes «Batch full» with a check drawing itself, the line below becomes «The kiln is booked for March» and the black pill squashes and spreads into a light tile with tighter corners, «Join batch two», with its bell swinging. Then the batch starts again. The button can be pressed: it is one pre-order more, with «You’re in» and a check; with the batch full it joins the waitlist.

How it works

Only the digits that change

The number is a row of slots, one per digit, each a grid with its texts in the same cell. At every pre-order the old string is compared with the new one: only the slot that changes rolls, the old digit leaves upwards with power2.in and the new one arrives from below with back.out, a pixel past. If a slot gets another digit while it is still rolling, the oldest one is dropped at once and never lags behind.

The marks that hop

Every mark is two pieces: the shell, which GSAP hops by six pixels and brings back with elastic.out, and the fill inside, which grows from the bottom with scaleY. Its two neighbours hop a pixel and a half, a moment later: that is what makes the row feel like one thing.

Three moods

The card has three states, open, nearly full and full, worked out from the count and LOW. On a change the lit marks take the new colour in a wave starting from the newest, the glow behind the number lights up, and the tag comes in by widening its clip on a spring to the measured width of its text.

The shape that changes

The button’s background is an element of its own: with the batch full GSAP takes its corners from 999 to 14 pixels, its colour from black to light amber and its shadow to a hairline, squashing it meanwhile (0.94 by 1.08) and letting it spring back with elastic.out. The labels swap on top, the old one up and the new one from below.

The toast from behind

The toast lives in a lane over the card, under it in the layers: it rises 26 pixels from behind the edge, the avatar swells with back.out(3), it stays and leaves upwards. So it never covers a word.

Values to change

NameFileDefaultWhat it changes
GOALscript.js24The pieces in the batch: one mark each.
STARTscript.js17The pre-orders when the page opens.
LOWscript.js4From how many pieces left the number and the marks turn amber.
PRICEscript.js$68The price on the button.
GAPscript.js1.5The seconds between one pre-order and the next.
HOLDscript.js3.4The seconds the full batch stays before starting again.
BOUNCEscript.js1.6How far the digits, the marks and the button overshoot (1 a little, 3 a lot).
NAMESscript.js['Mara', 'Jonas', 'Ines', 'Theo', 'Priya', 'Leon', 'Saskia', 'Omar']Who pre-orders, in turn, in the toast.

Try them in the Playground

When to use it

On the product page of a shop that works in batches (ceramics, prints, clothes, coffee), in the card of a pre-order or a crowdfunding campaign, or as the count of the seats of a class or an event: the number and the marks say where things stand, the amber hurries without shouting, and the button’s new shape says at once that the batch is closed.

On phones

On the phone the card takes its width from the screen (min with 90vw) and its heights from the height too (clamp in vh: the number, the marks, the button, the gaps), so it fits the short preview box. The marks share the width with flex, with no pixel sizes. The light that follows the pointer is there only where there is a mouse.

With reduced motion

Nothing moves: digits and labels cross-fade, the marks fill in place, the button changes colour and corners without squashing, the toast fades in and out, the steam stays still.

Pitfalls

  • With Mona Sans’ tabular figures the one has a foot and the big number looked typewritten: now the digits are the normal ones, but they have different widths and «of 24» jumped at every change. The digit’s slot now glides on a spring from the old digit’s width to the new one’s, measured on the real texts.
  • The toast, placed over the card, would have covered the product name: it has a lane of its own above the card and rises from behind its edge, under it in the layers.
  • The marks’ hop and their fill on the same element would wipe each other out (GSAP’s transform takes it all): the shell hops, the fill inside grows.
  • A poster taken mid-loop landed on a digit halfway through its roll: it is taken during the 3.4 seconds of the full batch, when everything is still.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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