
The elastic button
Buttons, Hover, Text
A tour’s merch bundle on a dark card: tee, record and poster to tick, each with its icon and price. With every piece added the icon tile lights up yellow, the tick draws itself, the discount bar takes another third on a spring and the total counts to the discounted price, with the full price struck through beside it; with the third piece a sheen crosses the bar, and “Add bundle” puts it all in the bag.
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>
<!--
"Merch bundle builder" 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>Merch bundle builder</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 merch bundle of a tour: tee, record and poster to tick, the discount bar filling with every
piece added and the total rolling -->
<section class="mb" data-mb data-level="1" aria-label="Tour merch bundle">
<header class="mb__head"><strong>Build your bundle</strong><span>Night Atlas · Europe tour</span></header>
<ul class="mb__items">
<li><button type="button" class="mb__item" data-item aria-pressed="true"><span class="mb__tile" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M8.500 4 4 6.300 5.800 10l1.900-.8V20h8.600V9.200l1.900.8L20 6.300 15.500 4c-.6 1.500-1.900 2.300-3.500 2.300S9.100 5.500 8.500 4Z"></path></svg></span><span class="mb__name"><b>Tour tee</b><i>Black · M</i></span><span class="mb__price">$35</span><span class="mb__box" aria-hidden="true"><svg viewBox="0 0 16 16"><path data-tick pathLength="1" d="m3.600 8.400 2.900 2.900 5.900-6.600"></path></svg></span></button></li>
<li><button type="button" class="mb__item" data-item aria-pressed="false"><span class="mb__tile" aria-hidden="true"><svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="8.500"></circle><circle cx="12" cy="12" r="2.600"></circle><path d="M6.700 9.300a6 6 0 0 1 2.600-2.600"></path></svg></span><span class="mb__name"><b>Live LP</b><i>180 g vinyl</i></span><span class="mb__price">$32</span><span class="mb__box" aria-hidden="true"><svg viewBox="0 0 16 16"><path data-tick pathLength="1" d="m3.600 8.400 2.900 2.900 5.900-6.600"></path></svg></span></button></li>
<li><button type="button" class="mb__item" data-item aria-pressed="false"><span class="mb__tile" aria-hidden="true"><svg viewBox="0 0 24 24"><rect x="5.500" y="3.500" width="13" height="17" rx="1.600"></rect><path d="M8.500 15.500h7M8.500 12.500 11 9.300l2 2.200 1.300-1.400 1.200 2.400"></path></svg></span><span class="mb__name"><b>Screen-print poster</b><i>A2 · numbered</i></span><span class="mb__price">$18</span><span class="mb__box" aria-hidden="true"><svg viewBox="0 0 16 16"><path data-tick pathLength="1" d="m3.600 8.400 2.900 2.900 5.900-6.600"></path></svg></span></button></li>
</ul>
<div class="mb__deal">
<div class="mb__track" aria-hidden="true"><i class="mb__fill" data-fill></i><i class="mb__notch" style="left:33.333%"></i><i class="mb__notch" style="left:66.666%"></i><i class="mb__sheen" data-sheen></i></div>
<span class="mb__hint"><span data-outhint>Add 1 more for 10% off</span></span>
</div>
<footer class="mb__foot">
<div class="mb__sum"><span class="mb__was" data-was><span data-outwas>$35</span><i data-strike></i></span><strong data-outsum>$35.00</strong></div>
<button type="button" class="mb__add" data-add><span class="mb__face" data-face="add">Add bundle</span><span class="mb__face" data-face="done"><svg viewBox="0 0 16 16" aria-hidden="true"><path data-donetick pathLength="1" d="m3.600 8.400 2.900 2.900 5.900-6.600"></path></svg>In your bag</span></button>
</footer>
</section>
<span class="live" aria-live="polite" data-live></span>
<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.
26 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 “Merch bundle builder” from Animorio and fit it into my siteEvery row is a button with aria-pressed: the edge, the yellow tile and the full box all come from that attribute. The script only keeps a list of three yes and no.
How many pieces are chosen decides the discount percentage, the sentence and the bar’s fraction. The total is the sum of the chosen prices minus the discount, and counts there on an animated number.
The fill is one element changing scaleX on an elastic spring; the two notches above split it in three. At the third piece a band of light crosses it once.
When there is a discount the full price appears next to the total and a line crosses it from the left; with no discount it goes away and only the total is left.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #ffd23f | The colour of the chosen pieces, the bar and the discount. |
TWO | script.js | 10 | The discount percentage with two pieces. |
THREE | script.js | 15 | The discount percentage with all three pieces. |
SPRING | script.js | 1 | How much tiles, bar and button bounce. |
LOOP | script.js | true | Left alone, the demo’s pointer completes the bundle and then starts again. |
In the store of a band, a festival or a team, and on any product page where buying several pieces together costs less: the same card with its discount bar carries a course kit, three skincare products, a phone’s accessories or the free-shipping threshold.
The card is at most 340 pixels wide and about 345 tall, and narrows with the screen: long names truncate with an ellipsis and below 350 pixels the button and the total get smaller. The rows are 50 pixels tall and the whole row is the tap target.
No bounces and no sheen: ticks, bar, struck-through price and total are in place at once on every tap, texts change without rolling and the button fades to “In your bag”. The demo’s pointer does not start.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.1 KB; the libraries: GSAP 28 KB.
Tested on 29 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.