Skip to content
animorio
IT
Back to the library

Last tickets left

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

The live availability card of a concert: sixty small tiles for the tickets of this release. As they sell, the tiles go out one by one with a flash, the big number rolls down and the line fills; under twelve ‘Last seats’ kicks in and everything takes the orange. The button holds two seats for you, lit in lime green, while a timer counts the 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>
<!--
  "Last tickets left" 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>Last tickets live with seats going out and the count going 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">
    <!-- the live availability card of a concert: sixty small tiles for the seats still on sale; as tickets sell the
         tiles go out one by one with a small flash, the count rolls down and the line fills; under a threshold the
         chip turns to last seats and everything takes the warning colour; the button holds two seats for you, lit
         in their own colour, while a timer counts -->
    <section class="card" data-card aria-label="Tickets left">
      <span class="card__beam" aria-hidden="true"></span>
      <header class="head">
        <div>
          <p class="head__date">Sat 21 Nov, Teatro Lumen</p>
          <h1 class="head__title">Aurora Kite, live</h1>
        </div>
        <p class="chip" data-chip><span data-chip-word>Selling fast</span></p>
      </header>

      <div class="left">
        <p class="left__n"><span data-left>37</span></p>
        <p class="left__l">tickets left<br><span data-note>of 60 in this release</span></p>
      </div>

      <div class="seats" data-seats aria-hidden="true"></div>
      <div class="line" aria-hidden="true"><span data-line></span></div>

      <button class="hold" type="button" data-hold aria-pressed="false"><span class="hold__in"><span data-hold-word>Hold 2 seats for me</span></span></button>
    </section>
    <p class="sr" data-live aria-live="polite"></p>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></path></svg>
  </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.

20 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 “Last tickets left” 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

In the middle, on black, a dark card with a light blue glow in the corner: the date, the concert’s name and on the right a chip, ‘Selling fast’. Below, a big light blue number, 37, with ‘tickets left, of 60 in this release’ next to it. Then a grid of sixty small tiles on five rows: the blue ones are tickets still on sale, the dim ones are already sold. About every half second a ticket sells: a random tile swells with a flash, goes out and returns small with a bounce, the number rolls down by one and the thin line under the grid advances. Tapping ‘Hold 2 seats for me’ the button turns lime green, two tiles light up lime on a spring, the number drops by two and the label becomes ‘2 seats held for 5:00’, with the seconds going down. When twelve tickets are left the chip rolls to ‘Last seats’ with an elastic kick and number, tiles, line and glow turn orange. Left alone, the sale runs, a pointer holds two seats halfway, and at the end the tiles light up again in a wave and it starts over.

How it works

The tiles and the order

The script creates TOTAL tiles and shuffles their order with a fixed-seed generator: tickets sell ‘at random’, but in the same order at every load. At the start as many go out at once as needed to reach LEFT.

One ticket sold

sell takes the next free tile, swells it to 1.35 with more light for a tenth of a second, gives it the is-sold class and brings it back to 1 with elastic.out; then it updates the number, which rolls down, and the line.

The last seats

When the tickets drop under LAST the card takes the is-last class: a CSS variable, --tone, changes from light blue to orange and number, tiles, line, chip and glow follow it.

Holding two seats

The first two free tiles become yours (is-mine) and can no longer be sold; a gsap.delayedCall every second brings the timer down in the button’s label. At zero, or at another tap, the seats go back on sale.

The loop

Sales and pointer sit on the same timeline, so they never drift apart; with a real hand the sale goes on by itself, slower, and stops at the last seats.

Values to change

NameFileDefaultWhat it changes
TOTALscript.js60How many tickets this release had.
LEFTscript.js37How many are left at the start.
LASTscript.js12Under this number ‘Last seats’ kicks in.
EVERYscript.js0.3How often, in seconds, a ticket sells.
MINUTESscript.js5For how many minutes your two seats stay held.
SEATscript.js#8fe3ffThe colour of the seats on sale.
MINEscript.js#c4f25aThe colour of your seats.
WARNscript.js#ff7a45The colour of the last seats.
LOOPscript.jstrueLeft alone, the sale runs and a pointer holds two seats.

Try them in the Playground

When to use it

On the page of a concert, a show, a course with limited places or a limited drop: it shows that tickets are really running out, without shouting. The numbers must be the real ones from the sale.

On phones

The same card, as wide as the screen: twelve tiles a row sharing the width, slightly shorter on a short screen.

With reduced motion

No flash and no bounce: the tiles just go out, the number changes without rolling and the automatic sale goes slower.

Pitfalls

  • A fake counter going down by itself deceives buyers: on a real site every tile that goes out must be a sale coming from the server.
  • The last seats are not told by colour alone: the chip’s words change too, and a screen reader reads them.
  • The tiles are small rectangles, not pulsing dots: the flash lasts a tenth of a second and happens once per tile.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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