
The elastic button
Buttons, Hover, Text
Festival tickets with price tiers: the last three early birds are counted by three small bars, and one is already in the sum. Add tickets and the bars go out one at a time; at the fourth the early birds are gone, the lit plate slides onto “Regular”, the old price is struck through and the total splits in two lines, “3 × €49 early bird” and “+ 1 × €69 regular”, while the figure at the top counts.
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>
<!--
"Early bird tickets" 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>Early bird tickets</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">
<!-- ticket pricing with tiers: the last early bird tickets are counted as the quantity grows, and when
they run out the next tickets are priced at the regular tier, with the total split in two lines -->
<section class="eb" data-eb aria-labelledby="eb-title">
<header class="eb__head">
<span class="eb__name"><b id="eb-title">Weekend pass</b><span>Lumen Festival, 12 – 14 June</span></span>
<span class="eb__total" aria-live="polite"><b data-total>€49</b></span>
</header>
<div class="eb__tiers" data-tiers>
<i class="eb__on" data-on aria-hidden="true"></i>
<div class="eb__tier" data-tier>
<span class="eb__tname">Early bird</span>
<b data-early-price>€49</b>
<span class="eb__stubs" data-stubs aria-hidden="true"></span>
<span class="eb__note"><span data-left>2 left</span></span>
</div>
<div class="eb__tier" data-tier>
<span class="eb__tname">Regular</span>
<b data-regular-price>€69</b>
<span class="eb__note"><span>Until 1 June</span></span>
</div>
<div class="eb__tier" data-tier>
<span class="eb__tname">Final</span>
<b data-final-price>€89</b>
<span class="eb__note"><span>At the gate</span></span>
</div>
</div>
<div class="eb__row">
<div class="eb__lines">
<p class="eb__line"><span data-line-a>1 × €49</span></p>
<p class="eb__line eb__line--b" data-wrap-b><span data-line-b>1 × €69</span></p>
</div>
<div class="eb__qty" role="group" aria-label="Tickets">
<button class="eb__step" type="button" data-minus aria-label="One ticket less"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 8h8"></path></svg></button>
<span class="eb__num" aria-live="polite"><b data-qty>1</b></span>
<button class="eb__step" type="button" data-plus aria-label="One ticket more"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 8h8M8 4v8"></path></svg></button>
</div>
</div>
<button class="eb__go" type="button" data-go><span class="eb__gotext"><span data-golabel>Get tickets</span></span></button>
<p class="eb__save"><span data-save>Early bird saves you €20</span></p>
</section>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></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>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.
31 values to change
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
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 “Early bird tickets” from Animorio and fit it into my siteA single function: the early birds are the smaller of the quantity and the ones left (LEFT), the rest go to the regular price. From there come total, lines, bars, lit tier and saving.
One for each early bird left: when it is taken, opacity and scaleY go down; when it is free again they come back with a bounce.
A single element under the three tiers, a third wide: it moves with xPercent (0 or 100), so there is nothing to measure again on resize.
A number in an object, taken to the new value by a tween: on every frame it is written rounded, with tabular figures.
It has zero height until it is needed: it opens to 18 pixels when at least one ticket lands in the regular tier.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #ffb84a | The colour of the active tier, of the early bird tickets and of the button. |
EARLY | script.js | 49 | The early bird price. |
REGULAR | script.js | 69 | The regular price, for the tickets beyond the last early birds. |
LEFT | script.js | 3 | How many early bird tickets are left. |
MAX | script.js | 6 | How many tickets can be taken at once. |
SPRING | script.js | 1 | How much the tier plate and the numbers bounce: 0.3 = a little, 2 = a lot. |
LOOP | script.js | true | Left alone, the demo’s pointer adds tickets until the tier changes and then removes them. |
On the ticket page of a festival, a conference, a course or a concert with tiered presale: when the last discounted tickets are not enough for the whole group and each one’s price has to be said plainly.
The same card, as wide as the screen minus the margins: the three tiers stay in a row (under 340 pixels prices and bars tighten), and the plus and minus keys are 34-pixel squares in a stepper 40 tall.
No slides and no bounces: the plate is already on the right tier, the bars go out in one step, numbers and lines change without rolling and the total goes straight to the new figure. The demo does not move by itself.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.7 KB; the libraries: GSAP 28 KB.
Tested on 24 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.
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.