Skip to content
animorio
IT
Back to the library

Wallet event tickets

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

A phone wallet with four event tickets stacked, only the top of each one showing: tapped or pulled up, a ticket comes out of the stack on a spring, the others drop into a little pile at the bottom and the barcode draws itself and lights up, ready for the door. Pulled down past the line, or with the pile tapped, it goes back in its place. In the style of product micro-interactions, one gesture only: Drag.

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>
<!--
  "Wallet event 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>The event tickets you pull out of the wallet</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" data-stage>
    <!-- a wallet of event tickets: tap or pull one up and it comes out of the stack while the others drop into a
         pile at the bottom; pull it down past the line, or tap the pile, and it goes back -->
    <section class="wallet" data-wallet aria-label="Wallet">
      <header class="wallet__head">
        <div>
          <p class="wallet__title">Wallet</p>
          <p class="wallet__sub" data-sub>4 passes</p>
        </div>
        <button class="wallet__done" type="button" data-done>Done</button>
      </header>

      <div class="deck" data-deck>
        <article class="t" data-ticket>
          <div class="t__shadow"></div>
          <div class="t__card">
            <div class="t__head">
              <div><p class="t__name">Halden Quartet</p><p class="t__kind">Concert</p></div>
              <div class="t__when"><p class="t__date">Fri 14 Nov</p><p class="t__time">20:00</p></div>
            </div>
            <p class="t__venue">Marrow Hall, Leeds</p>
            <dl class="t__grid">
              <div><dt>Gate</dt><dd>B</dd></div>
              <div><dt>Row</dt><dd>12</dd></div>
              <div><dt>Seat</dt><dd class="is-accent">31</dd></div>
              <div><dt>Doors</dt><dd>19:15</dd></div>
            </dl>
            <div class="t__perf" aria-hidden="true"></div>
            <div class="t__code" data-code>
              <svg class="t__bars" data-bars viewBox="0 0 200 40" preserveAspectRatio="none" aria-hidden="true"></svg>
              <p class="t__num">4821 0093 1174</p>
              <p class="t__ready" data-ready>Ready to scan</p>
            </div>
            <div class="t__shine" aria-hidden="true"></div>
          </div>
        </article>

        <article class="t" data-ticket>
          <div class="t__shadow"></div>
          <div class="t__card">
            <div class="t__head">
              <div><p class="t__name">Nightjar</p><p class="t__kind">Live, late show</p></div>
              <div class="t__when"><p class="t__date">Sat 22 Nov</p><p class="t__time">21:30</p></div>
            </div>
            <p class="t__venue">The Lantern Rooms, Bristol</p>
            <dl class="t__grid">
              <div><dt>Door</dt><dd>2</dd></div>
              <div><dt>Area</dt><dd>Floor</dd></div>
              <div><dt>Entry</dt><dd class="is-accent">Standing</dd></div>
              <div><dt>Age</dt><dd>18+</dd></div>
            </dl>
            <div class="t__perf" aria-hidden="true"></div>
            <div class="t__code" data-code>
              <svg class="t__bars" data-bars viewBox="0 0 200 40" preserveAspectRatio="none" aria-hidden="true"></svg>
              <p class="t__num">7730 5512 0468</p>
              <p class="t__ready" data-ready>Ready to scan</p>
            </div>
            <div class="t__shine" aria-hidden="true"></div>
          </div>
        </article>

        <article class="t" data-ticket>
          <div class="t__shadow"></div>
          <div class="t__card">
            <div class="t__head">
              <div><p class="t__name">Copper Field</p><p class="t__kind">Festival, day pass</p></div>
              <div class="t__when"><p class="t__date">Sun 30 Nov</p><p class="t__time">11:00</p></div>
            </div>
            <p class="t__venue">Riverside Meadows, York</p>
            <dl class="t__grid">
              <div><dt>Gate</dt><dd>North</dd></div>
              <div><dt>Pass</dt><dd>Day</dd></div>
              <div><dt>Band</dt><dd class="is-accent">Copper</dd></div>
              <div><dt>Last in</dt><dd>18:00</dd></div>
            </dl>
            <div class="t__perf" aria-hidden="true"></div>
            <div class="t__code" data-code>
              <svg class="t__bars" data-bars viewBox="0 0 200 40" preserveAspectRatio="none" aria-hidden="true"></svg>
              <p class="t__num">3069 8841 2257</p>
              <p class="t__ready" data-ready>Ready to scan</p>
            </div>
            <div class="t__shine" aria-hidden="true"></div>
          </div>
        </article>

        <article class="t" data-ticket>
          <div class="t__shadow"></div>
          <div class="t__card">
            <div class="t__head">
              <div><p class="t__name">Lumen Talks</p><p class="t__kind">Design evening</p></div>
              <div class="t__when"><p class="t__date">Thu 4 Dec</p><p class="t__time">19:00</p></div>
            </div>
            <p class="t__venue">Pier 9 Auditorium, Brighton</p>
            <dl class="t__grid">
              <div><dt>Hall</dt><dd>A</dd></div>
              <div><dt>Row</dt><dd>C</dd></div>
              <div><dt>Seat</dt><dd class="is-accent">8</dd></div>
              <div><dt>Doors</dt><dd>18:30</dd></div>
            </dl>
            <div class="t__perf" aria-hidden="true"></div>
            <div class="t__code" data-code>
              <svg class="t__bars" data-bars viewBox="0 0 200 40" preserveAspectRatio="none" aria-hidden="true"></svg>
              <p class="t__num">5106 2287 9930</p>
              <p class="t__ready" data-ready>Ready to scan</p>
            </div>
            <div class="t__shine" aria-hidden="true"></div>
          </div>
        </article>
      </div>
    </section>

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

77 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 “Wallet event tickets” 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 a warm white there is a wallet panel, Wallet with 4 passes under it, and four black tickets stacked, only the top of each one showing: the name of the event, what kind of night it is, the day and the time. They are the Halden Quartet concert at Marrow Hall, the Nightjar late show at The Lantern Rooms, a day pass for the Copper Field festival and a Lumen Talks design evening; the last one shows whole, with the venue, the seat, the dashed line between two half-moons and the barcode. On arrival the tickets rise into place one after the other. With the pointer over it, the top of a ticket lifts by a few pixels. Tapped, or pulled up even a little, the ticket comes out of the stack and rises to the top on a short spring, tilting slightly as it travels, with a shine passing over it and its shadow moving away; the others drop one after the other into a little pile at the bottom. Then the barcode draws itself from the left, its panel turns white like a screen at full brightness and Ready to scan appears in orange; Done arrives at the top and the line under Wallet reads Pull down to put it back. The open ticket can be pulled down with a finger: a little, and it goes back up with a bounce; past the line, or with a quick flick, it goes back in the stack, and the tickets line up again staggered. Done or a tap on the pile also put it back. A drawn pointer does it all by itself and then starts again.

How it works

A panel sized on its height

The wallet has container-type size and a fixed ratio: everything inside, from the tickets to the text to the half-moons of the perforation, is measured in cqh, so it shrinks as one piece. The half-moons are two radial-gradients in the ticket’s mask, intersected.

Each ticket has its own spring

Each ticket has a position, a speed and a target; a damped spring, integrated in four steps per frame in GSAP’s ticker, takes it there. Opening or closing only changes the targets, with a small delay for each one: that is what makes the pile drop in a row.

The finger and the rubber band

In the stack a ticket pulled up follows the finger through a rubber band curve, and the ones below follow it a little less each; let go, it comes out if it went up more than LIFT or was moving up fast. Open, it pulls down freely and up on a short rubber band: past DROP or with a quick flick it goes back in the stack, with the finger’s speed.

Tilt, shine, shadow

The spring’s speed becomes a tilt of a few degrees around the horizontal axis, inside a perspective: the shine, a gradient in screen mode, slides with the tilt, and the shadow, blurred and separate from the ticket, moves away and spreads the more the ticket is lifted.

Ready to scan

Once the ticket has arrived, the barcode’s bars grow from the left with a scaleX, the panel turns full white with a glow, and Ready to scan rises by five pixels with a back.out. Closing puts everything back, ready for the next one.

Values to change

NameFileDefaultWhat it changes
SPRINGscript.js1How stiff the tickets’ spring is: higher is snappier.
BOUNCEscript.js0.18How much the tickets bounce when they land.
STRIPscript.js0.1How much of each ticket shows in the stack.
LIFTscript.js0.04How far a ticket must be pulled up to come out of the stack.
DROPscript.js0.2How far the open ticket must be pulled down to go back in the stack.
ACCENTscript.js#ff6a3dThe colour of the seat and of Ready to scan.
HOLDscript.js1.2The seconds of pause before the autopilot starts again.

Try them in the Playground

When to use it

For the app or site of a ticket seller, a festival, a theatre or a concert hall, to show the tickets bought and ready for the door, or as a piece of a prototype: it is the gesture of the phone wallet, with physics you can feel.

On phones

The same animation with adapted sizes: the wallet is sized on the height and the width of the window and everything inside follows it; the tickets are pulled out and put back with your finger.

With reduced motion

No springs and no tilt: the tickets go from the stack to the open ticket and back with a fade, the barcode is already drawn and Ready to scan fades in.

Pitfalls

  • A shadow inside the ticket gets cut by the half-moon mask: the shadow is a sibling of the card in the same wrapper, and the wrapper is what moves.
  • In the pile the tickets are whole but hidden by the panel’s bottom: without overflow hidden on the wallet they spilled out below the box.
  • Mona Sans’s tabular figures draw a slashed zero: times and codes use the normal figures.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 26 October 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