Skip to content
animorio
IT
All components

Merch bundle builder

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

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.

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>
<!--
  "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>

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.

26 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Merch bundle builder” 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 rounded dark card: “Build your bundle” and below it “Night Atlas · Europe tour”. Three rows to tap, each with its icon in a tile (tee, record, poster), the name and variant, the price and a box: at the start only the tee is chosen, with a yellow tile and its tick. Below, a bar split in three with one third full and the line “Add 1 more for 10% off”; at the bottom the total “$35.00” and the light “Add bundle” button. Tapping the record gives the row a yellow edge, the icon tile bounces and turns yellow, the tick draws itself, the bar reaches two thirds on a spring, the line rolls into “10% off · add 1 more for 15%”, a struck-through “$67” appears and the total counts to “$60.30”. With the poster the bar fills, a sheen crosses it, the line turns yellow, “Bundle unlocked · 15% off”, and the total counts to “$72.25”. “Add bundle” presses in, turns yellow and says “In your bag” with the tick drawing itself. Removing a piece takes everything back.

How it works

Three buttons that stay pressed

Every 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.

Everything from the piece count

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 bar in thirds

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.

The full price struck through

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.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#ffd23fThe colour of the chosen pieces, the bar and the discount.
TWOscript.js10The discount percentage with two pieces.
THREEscript.js15The discount percentage with all three pieces.
SPRINGscript.js1How much tiles, bar and button bounce.
LOOPscript.jstrueLeft alone, the demo’s pointer completes the bundle and then starts again.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

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.

Pitfalls

  • The rows are buttons with aria-pressed, not clickable divs: they work with Tab and Space, and an aria-live region says the discount reached and the total on every change.
  • The discount is not told by yellow alone: there is the sentence, the struck-through full price and the new total.
  • With zero pieces “Add bundle” is really disabled; removing a piece after adding the bundle takes the button back to “Add bundle”, since the bag no longer matches.
  • Band, products, prices and discounts are invented; in a real store prices and discount are worked out by the server, and the total shown has to be its own.

Libraries

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.

Testing

Tested on 29 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