Skip to content
animorio
IT
All components

Join the queue button

Buttons, HoverGSAP, CSS onlyMediumCompressed weight: Demo 6.8 KBGSAP 28 KBFreeDownload the zip

One button, one gesture, in the simple style of real product interface pieces: the button to join the virtual ticket queue of a concert, on black. Pressed, the light pill turns dark and says how many people are ahead of you, with the digits rolling down one by one while a thin lime line fills along the bottom; when the count reaches zero the line rises and becomes the whole pill, and it is your turn: Your turn, Pick seats, with the seats held for ten minutes.

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>
<!--
  "Join the queue button" 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 Join the queue button with the place counting down</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: wait your turn. Pressed, the pill joins the ticket queue: the people ahead roll down digit by
         digit while a hairline fills along the bottom; at zero the hairline rises into the whole pill and it is your turn -->
    <div class="frame" data-inquadra>
      <button class="q" type="button" data-q aria-describedby="q-note">
        <span class="q__skin" data-skin aria-hidden="true"></span>
        <span class="q__dark" data-dark aria-hidden="true"></span>
        <span class="q__rise" data-rise aria-hidden="true"></span>
        <span class="q__line" aria-hidden="true"><span class="q__line-fill" data-line></span></span>
        <span class="q__ico" aria-hidden="true">
          <svg class="ico ico--ticket" data-i="ticket" viewBox="0 0 20 20"><path d="M3.5 6.2h13v2.1a1.7 1.7 0 0 0 0 3.4v2.1h-13v-2.1a1.7 1.7 0 0 0 0-3.4Z"></path><path class="ico__perf" d="M12.2 6.6v6.8"></path></svg>
          <svg class="ico ico--wait" data-i="wait" viewBox="0 0 20 20"><path class="ico__track" d="M10 3.8a6.2 6.2 0 1 1 0 12.4a6.2 6.2 0 1 1 0-12.4"></path><path class="ico__arc" data-arc d="M10 3.8a6.2 6.2 0 0 1 6.2 6.2"></path></svg>
          <svg class="ico ico--go" data-i="go" viewBox="0 0 20 20"><path d="M4 10h11"></path><path d="m10.6 5.6 4.4 4.4-4.4 4.4"></path></svg>
        </span>
        <span class="q__labels" data-labels>
          <span class="q__label" data-l="join">Join the queue</span>
          <span class="q__label" data-l="line"><span class="odo" data-odo></span><span class="q__ahead">ahead of you</span></span>
          <span class="q__label" data-l="turn">Your turn<span class="q__sep">·</span>Pick seats</span>
        </span>
      </button>

      <p class="note" id="q-note" aria-live="polite">
        <span class="note__t" data-n="join">Nightjar, Halden Hall, Sat Dec 6</span>
        <span class="note__t" data-n="line" data-wait>About 3 min</span>
        <span class="note__t" data-n="turn">Seats held for <span data-hold>10:00</span></span>
      </p>

      <span class="measure" data-measure aria-hidden="true"></span>
    </div>
  </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 “Join the queue button” 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 black, a paper-coloured pill with a small line-drawn ticket and the label Join the queue; below, in grey, the invented concert, Nightjar at Halden Hall, Saturday 6 December. On hover the ticket tilts a little; pressed, the pill squashes and comes back on an elastic, turns dark, the ticket spins into a rotating arc, and the label narrows on the wdth axis, leaves upwards and gives way to «1,248 ahead of you». Then the queue moves forward in uneven steps, like a real one: at each step the digits that change roll down from right to left, the ones no longer needed fold away sideways, the pill gets shorter on a spring and leans a pixel and a half forward, the lime line along the bottom grows and the line below goes from About 3 min to Almost there. At zero the thin line rises and widens until it becomes the whole pill, the text turns dark, the arrow takes the arc’s place with a small nudge, the pill takes a breath: Your turn, Pick seats, and below Seats held for 10:00 counting down second by second. The loop starts again by itself; it also really works with mouse, touch and keyboard, and pressing Your turn goes back to the start.

How it works

An odometer made of windows

The number is a row of one-line windows, one per character, with hidden overflow and clip-path: inset(0). At each step the characters align from the right; where a digit changes a new one is born and drops in from above with back.out while the old one falls and fades, with a 35 millisecond delay per column. The extra columns, when 1,248 becomes 861, go to zero width and are then removed.

The width computed, not read

The width of the digits and of the comma is measured once with a hidden element, so the width of the queue label is a sum (digits times width plus ahead of you) and the pill shortens on the spring at the same moment the columns fold, without waiting for layout.

The line that becomes the pill

The lime fill is a layer with a clip-path: at first an inset whose top is the height minus one pixel and whose sides equal the line’s margin, exactly the thin line; at zero it goes to inset(0 round half the height) with expo.inOut, so the line rises and widens up to the round corners. The measures are redone on resize.

A queue that feels real

The queue steps are fractions of the starting number that drop less and less (83, 69, 56 per cent down to zero) at uneven intervals, written into a timeline of GSAP calls: no setTimeout, so the site’s bench can pause and scrub it. The minutes estimate only changes when the words change.

The states and the way back

Three labels in the same box (Join the queue, ahead of you, Your turn) coming in narrow on the wdth axis and widening; when the new one is wider the box opens quickly with expo.out, so it is never cut, when narrower it follows the spring. The held seats countdown goes down with one delayedCall per second.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#d6ff3fThe colour of the line that fills and of the pill when it is your turn.
AHEADscript.js1248How many people are ahead of you when you join the queue.
STEPscript.js0.36The seconds between one step forward of the queue and the next.
ROLLscript.js0.4The seconds each digit takes to roll.
BOUNCEscript.js1.5How much the pill and the labels bounce.
HOLD_MINscript.js10The minutes the seats stay yours when it is your turn.
PAUSEscript.js2.4The seconds the automatic loop shows Your turn and the resting state.

Try them in the Playground

When to use it

For the ticket sale of a concert, a festival or a match, the launch of a limited collection, the opening of sign-ups to a sought-after course: whenever a site puts people in a waiting room and has to make them feel the line is moving.

On phones

The pill is at most 92% of the screen wide and under 400 pixels drops to 56 pixels in height and 15 for the text; the digit widths are measured again on resize. A tap does what a click does and the press shows under the finger too.

With reduced motion

No bounces, squashes or rolls: labels and digits change with a fade, the arc does not spin, the pill does not lean, the lime line grows quickly and becomes the pill with a short fade.

Pitfalls

  • The labels sit in absolute position inside a narrower box: without width: max-content they shrink to the box width and the measure comes out wrong, with Pick seats cut off.
  • While they come in the labels are narrowed on the wdth axis: measured then they are shorter than they really are, so the widths of Join the queue and Your turn are taken once at wdth 100 and kept aside.
  • In Mona Sans the tabular figures have a one with a foot and look like another typeface: the digits stay proportional, centred in windows as wide as the zero.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 6.8 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