
The elastic button
Buttons, Hover, Text
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.
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>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 “Join the queue button” from Animorio and fit it into my siteThe 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 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 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.
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.
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.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #d6ff3f | The colour of the line that fills and of the pill when it is your turn. |
AHEAD | script.js | 1248 | How many people are ahead of you when you join the queue. |
STEP | script.js | 0.36 | The seconds between one step forward of the queue and the next. |
ROLL | script.js | 0.4 | The seconds each digit takes to roll. |
BOUNCE | script.js | 1.5 | How much the pill and the labels bounce. |
HOLD_MIN | script.js | 10 | The minutes the seats stay yours when it is your turn. |
PAUSE | script.js | 2.4 | The seconds the automatic loop shows Your turn and the resting state. |
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.
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.
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.
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.
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.