Skip to content
animorio
IT
Back to the library

Springy digital wallet

Physics, HoverGSAP, CSS onlyAdvancedCompressed weight: Demo 15 KBGSAP 28 KBFreeDownload the zip

The wallet of Vela, an invented payment app, on a dark page with light from above and grain: four stacked cards, the brushed metal payment card, the boarding pass, a concert ticket with a holographic strip and the gym membership. The top card is dragged and flicked: it flies off with its own speed, loses it to friction and tucks in at the back of the stack, while the cards below move up one place, one after the other, lifting a little and settling on a spring with a pixel of overshoot. In hover the card leans towards the pointer and a light slides on its material; a tap opens it with its details: the balance rolling up, the seat, the drawn QR code filling from the centre.

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>
<!--
  "Springy digital wallet" 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 digital wallet with the cards to flick</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>
    <!-- the wallet of Vela, an invented payment app: four cards in a stack. The top one is dragged and flicked away,
         it flies off with its speed and tucks in at the back; the ones below rise and settle on a spring. In hover
         the top card leans towards the pointer and a light slides on its material; a tap opens its details -->
    <section class="wallet" data-wallet aria-label="Wallet">
      <header class="wallet__head">
        <div class="wallet__title">
          <span class="wallet__word">Wallet</span>
          <span class="wallet__count">4 passes</span>
        </div>
        <span class="wallet__names" aria-hidden="true" data-names>
          <span class="wallet__name">Vela Black</span>
          <span class="wallet__name">Corvo Air</span>
          <span class="wallet__name">Low Tide Choir</span>
          <span class="wallet__name">Forma Club</span>
        </span>
        <button class="wallet__add" type="button" aria-label="Add a pass">
          <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 3.5v9M3.5 8h9"/></svg>
        </button>
      </header>

      <div class="deck" data-deck>
        <!-- the payment card: brushed graphite metal -->
        <article class="card card--metal" data-card="metal" data-name="Vela Black">
          <span class="card__shade" aria-hidden="true"></span>
          <div class="card__body">
            <span class="card__brush" aria-hidden="true"></span>
            <div class="card__face">
              <div class="face__row">
                <span class="metal__brand">vela</span>
                <svg class="metal__wave" viewBox="0 0 20 20" aria-hidden="true">
                  <path d="M7 5.5c1.6 2.7 1.6 6.3 0 9M10.2 3.6c2.4 3.9 2.4 8.9 0 12.8M13.4 1.8c3.2 5 3.2 11.4 0 16.4"/>
                </svg>
              </div>
              <svg class="metal__chip" viewBox="0 0 40 30" aria-hidden="true">
                <rect x="0.5" y="0.5" width="39" height="29" rx="5.5"/>
                <path d="M0.5 10.5h11M0.5 19.5h11M28.5 10.5h11M28.5 19.5h11M11.5 0.5v29M28.5 0.5v29M11.5 15h17"/>
              </svg>
              <div class="face__row face__row--end">
                <span class="metal__num"><span class="metal__mask">&bull;&bull;&bull;&bull;</span> 4821</span>
                <span class="metal__kind">Debit<br><b>Black</b></span>
              </div>
            </div>
            <div class="card__more">
              <div class="more__col">
                <span class="more__label" data-r>Balance</span>
                <span class="metal__balance" data-r data-balance>$12,480.36</span>
                <span class="more__tx" data-r><span>Corner Roasters</span><span>$6.40</span></span>
                <span class="more__tx" data-r><span>Metro, line 2</span><span>$2.90</span></span>
              </div>
              <div class="more__col more__col--end">
                <span class="more__label" data-r>This week</span>
                <svg class="metal__spark" viewBox="0 0 70 30" aria-hidden="true" data-r>
                  <path class="metal__spark-area" d="M1 24 L11 20 L21 22 L31 14 L41 17 L51 9 L61 12 L69 5 L69 29 L1 29Z"/>
                  <path class="metal__spark-line" pathLength="1" data-line d="M1 24 L11 20 L21 22 L31 14 L41 17 L51 9 L61 12 L69 5"/>
                </svg>
                <span class="more__small" data-r>$184.20 spent</span>
              </div>
            </div>
            <span class="card__sheen" aria-hidden="true"></span>
            <span class="card__dim" aria-hidden="true"></span>
          </div>
        </article>

        <!-- the boarding pass: warm paper, blue ink -->
        <article class="card card--pass" data-card="pass" data-name="Corvo Air">
          <span class="card__shade" aria-hidden="true"></span>
          <div class="card__body">
            <div class="card__face">
              <div class="face__row">
                <span class="pass__brand">
                  <svg viewBox="0 0 18 12" aria-hidden="true"><path d="M1 10.5 9 2l8 8.5M5 10.5 9 6.2l4 4.3"/></svg>
                  Corvo Air
                </span>
                <span class="pass__kind">Boarding pass</span>
              </div>
              <div class="pass__route">
                <span class="pass__city"><b>LIS</b><small>Lisbon</small></span>
                <span class="pass__line" aria-hidden="true">
                  <svg viewBox="0 0 120 16" preserveAspectRatio="none"><path class="pass__track" d="M2 8H118"/></svg>
                  <svg class="pass__plane" viewBox="0 0 24 24"><path d="M21 12.6c0-.7-.6-1.2-1.3-1.2h-5.1L10 4H8l2.6 7.4H6.1L4.3 9H3l1.2 3.6L3 16.2h1.3l1.8-2.4h4.5L8 21.2h2l4.6-7.4h5.1c.7 0 1.3-.5 1.3-1.2z"/></svg>
                </span>
                <span class="pass__city pass__city--end"><b>CPH</b><small>Copenhagen</small></span>
              </div>
              <div class="face__fields">
                <span><small>Flight</small>CV 218</span>
                <span><small>Date</small>12 Nov</span>
                <span><small>Boards</small>07:40</span>
              </div>
            </div>
            <div class="card__more">
              <div class="more__col">
                <span class="more__label" data-r>Passenger</span>
                <span class="more__value" data-r>Mara Lind</span>
                <span class="more__pair" data-r>
                  <span><small>Seat</small><b class="pass__seat">14A</b></span>
                  <span><small>Gate</small><b>B12</b></span>
                  <span><small>Group</small><b>2</b></span>
                </span>
              </div>
              <svg class="qr" viewBox="0 0 25 25" aria-label="Boarding code" data-qr="218" data-r></svg>
            </div>
            <span class="card__sheen" aria-hidden="true"></span>
            <span class="card__dim" aria-hidden="true"></span>
          </div>
        </article>

        <!-- the concert ticket: a dusk gradient with a foil strip and a stub -->
        <article class="card card--gig" data-card="gig" data-name="Low Tide Choir">
          <span class="card__shade" aria-hidden="true"></span>
          <div class="card__body">
            <span class="gig__foil" aria-hidden="true"></span>
            <div class="card__face">
              <div class="gig__main">
                <span class="gig__venue">Halle Nord, live</span>
                <span class="gig__band">Low Tide<br>Choir</span>
                <span class="gig__date">Sat 14 Nov, doors 19:30</span>
              </div>
              <span class="gig__stub"><span>Admit one</span></span>
            </div>
            <div class="card__more">
              <div class="more__col">
                <span class="more__label" data-r>Your place</span>
                <span class="more__pair" data-r>
                  <span><small>Section</small><b>B</b></span>
                  <span><small>Row</small><b>7</b></span>
                  <span><small>Seat</small><b>22</b></span>
                </span>
                <span class="more__small" data-r>Standing upgrade available</span>
              </div>
              <svg class="qr" viewBox="0 0 25 25" aria-label="Ticket code" data-qr="1407" data-r></svg>
            </div>
            <span class="card__sheen" aria-hidden="true"></span>
            <span class="card__dim" aria-hidden="true"></span>
          </div>
        </article>

        <!-- the gym membership: deep green and lime -->
        <article class="card card--gym" data-card="gym" data-name="Forma Club">
          <span class="card__shade" aria-hidden="true"></span>
          <div class="card__body">
            <svg class="gym__rings" viewBox="0 0 120 120" aria-hidden="true">
              <circle cx="120" cy="0" r="40"/><circle cx="120" cy="0" r="62"/><circle cx="120" cy="0" r="84"/><circle cx="120" cy="0" r="106"/>
            </svg>
            <div class="card__face">
              <div class="face__row">
                <span class="gym__brand">FORMA</span>
                <span class="gym__tier">All access</span>
              </div>
              <div class="face__row face__row--end">
                <span class="gym__member"><small>Member</small>Alex Rowe</span>
                <span class="gym__since"><small>Since</small>2024</span>
              </div>
            </div>
            <div class="card__more">
              <div class="more__col">
                <span class="more__label" data-r>Visits this month</span>
                <span class="gym__visits" data-r>9</span>
                <span class="gym__week" data-r aria-hidden="true">
                  <i style="--v:.55"></i><i style="--v:.2"></i><i style="--v:.8"></i><i style="--v:.35"></i><i style="--v:.95"></i><i style="--v:.15"></i><i style="--v:.6"></i>
                </span>
              </div>
              <div class="more__col more__col--end">
                <svg class="gym__bars" viewBox="0 0 64 26" preserveAspectRatio="none" aria-label="Member code" data-bars data-r></svg>
                <span class="more__small" data-r>0042 7781 19</span>
              </div>
            </div>
            <span class="card__sheen" aria-hidden="true"></span>
            <span class="card__dim" aria-hidden="true"></span>
          </div>
        </article>
      </div>
    </section>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true">
      <path d="M5 3.2 18.6 13l-6.1 1 3.4 6.4-2.6 1.4-3.4-6.5L5 19.2z"/>
    </svg>
    <p class="sr" aria-live="polite" data-live></p>
  </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.

83 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 “Springy digital wallet” 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 near black page, with a soft light from above and a fine grain, the wallet of Vela rises gently, an invented payment app: at the top ‘Wallet’ and ‘4 passes’, on the right the name of the card on top and the round button to add one. Below, four stacked cards: in front the Vela Black in brushed graphite, with its gold chip, the contactless sign and the engraved last digits; behind, only the top edge of each shows, darker the further back it is. A drawn pointer passes over it: the card leans slightly towards it, lifts a hair and the light slides along the lines of the metal. A tap and the card grows downwards, the wallet moves up to stay centred and the details arrive one after the other: the balance rolling up to $12,480.36, two payments, the line of the week drawing itself. Another tap closes it. Then the pointer takes it, pulls it gently sideways and flicks it: the card flies off turning, slows down and slides back in behind the stack, while the others move up one place one at a time, lift a little and settle on the spring. On top now is the Corvo Air boarding pass, ivory paper with LIS and CPH, the plane on the dotted line: open, it shows the two bites of the perforation, the passenger, seat 14A in blue, the gate, the group and the QR code filling from the centre. Then the ticket for Low Tide Choir, from violet to coral, with the holographic strip changing colour where the light passes and the ‘Admit one’ stub; and the Forma gym membership in deep green and lime, which open shows the visits of the month, the bars of the week and the barcode. Every flick rolls the name at the top. With a finger or the mouse it is the same: dragged a little the card springs back, flicked it goes to the back; the keyboard arrows flick it, Enter opens it.

How it works

A spring for every card

Every card has position, rotation and scale with their speed, and on every frame a spring (stiffness and damping, in two half steps) pulls it towards its place in the stack: higher, smaller and darker the further back it is. The damping is chosen so it passes its place by a pixel and comes back.

The drag and the speed

While dragged the card follows the finger on a very stiff spring, turns with the movement and lifts a little; the positions of the last hundred milliseconds give the speed of the flick. Below, the next card already moves up a little, as much as the drag has gone.

The flight and the way back

Flicked (fast, or past a third of the width), the card flies with its own speed, loses it to friction and drops slightly; once far enough it goes behind the others and the spring brings it to the last place. The others move up one at a time with a small delay and a push upwards: they lift and settle.

The light on the material

The pointer's position on the card becomes two CSS variables: a radial gradient in soft-light follows the pointer, on the metal a bright band runs along the brushed lines (a texture drawn once on a canvas), on the ticket the holographic strip changes colour in color-dodge.

Opening the card

On a tap the card's height goes towards open on another spring, the wallet moves up by half to stay centred and a small timeline brings in the details: the balance rolling up, the line drawing itself, the squares of the QR (drawn in SVG with a fixed seed) arriving from the centre with a grid stagger, the two bites of the perforation with a mask.

Values to change

NameFileDefaultWhat it changes
STIFFNESSscript.js260The spring of the stack: higher settles the cards sooner.
DAMPINGscript.js22Lower lets the cards pass their place and come back.
THROWscript.js1How far a flicked card flies before it goes to the back.
FRICTIONscript.js4How quickly a flicked card loses its speed.
TILTscript.js1How much the top card leans towards the pointer.
SHEENscript.js1How bright the light that slides on the cards is.
PEEKscript.js1How much of the cards behind shows.
SPEEDscript.js12 = the walk on its own twice as fast, 0.5 = half.
LOOPscript.jstrueThe drawn pointer goes round again.

Try them in the Playground

When to use it

For the wallet of a payment or banking app, the tickets page of an events or travel app, the cards of a loyalty or gym app: wherever a stack of cards should be flicked through with a finger, with real physics. The card colours are the CSS variables.

On phones

The same animations at adapted sizes: the card is measured on width and height, so even open the whole wallet fits the box; with a finger you drag and flick, a tap opens it. A flicked card leaves only within the stage, which clips it.

With reduced motion

The cards do not move: flicked, the top card goes to the back and the stack fades back in; opened, the details fade in without movement; the walk on its own opens, closes and changes card without the pointer.

Pitfalls

  • The flick speed is not taken from the last movement (too jumpy) but from the positions of the last hundred milliseconds; and the times come from gsap.ticker.time, so the drawn pointer and the recordings give the same flick.
  • The flicked card must stay in front while it is far away and go behind only afterwards: changing the z-index at once slips it under the others while still over the stack.
  • With the origin in the middle a shrunk card moves down: to make it peek out at the top as much as wanted the offset also accounts for half of the height it loses.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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