Skip to content
animorio
IT
All components

Payment successful

Cards, Transitions, TextGSAP, CSS onlyMediumCompressed weight: Demo 7.6 KBGSAP 28 KBFreeDownload the zip

The last step of the checkout at Larch & Co., a made-up shop: the chosen card, the total and the green «Pay $248.60» pill. Press it and the pill folds into a circle with a working ring; the ring closes, the tick draws itself and a thin light runs along the card’s edge. Then the circle rises and becomes the receipt’s badge: «Payment successful», the amount rolling in digit by digit, the receipt rows settling as their dotted rules draw themselves, and two actions, Download receipt and Done. Minimal style, on white, with a single green accent.

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>
<!--
  "Payment successful" 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>Payment successful</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/jetbrains-mono@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage">
    <!-- the last step of a made-up shop's checkout. Press Pay: the pill folds into a ring that works,
         the ring closes and the tick draws, then the card turns into the receipt: the amount rolls in
         digit by digit, the receipt rows settle one after the other and the dotted rules draw themselves -->
    <section class="card" data-card aria-label="Checkout">
      <span class="card__sheen" data-sheen aria-hidden="true"></span>
      <span class="card__edge" data-edge aria-hidden="true"></span>

      <div class="view view--pay" data-pay>
        <header class="head">
          <span class="shop"><span class="shop__mark" aria-hidden="true"><svg viewBox="0 0 20 20"><path d="M10 2.5v15M10 6l-4 3.5M10 6l4 3.5M10 10.5l-5 4M10 10.5l5 4"/></svg></span>Larch &amp; Co.</span>
          <span class="step">Payment</span>
        </header>
        <div class="method">
          <span class="chip" aria-hidden="true"><svg viewBox="0 0 28 18"><rect x="0.75" y="0.75" width="26.5" height="16.5" rx="3"/><path class="chip__mark" d="M8 12.5l3-7h3l-3 7zM14 12.5l3-7h3l-3 7z"/></svg></span>
          <span class="method__text"><span class="method__name">Debit card</span><span class="method__num">&bull;&bull;&bull;&bull; 4821</span></span>
          <span class="method__exp">09/29</span>
        </div>
        <div class="sum">
          <span>Total due</span>
          <span class="sum__val">$248.60</span>
        </div>
        <div class="action" data-action>
          <button class="pay" type="button" data-btn>
            <span class="pay__label" data-label>Pay $248.60</span>
            <svg class="pay__ring" viewBox="0 0 40 40" aria-hidden="true" data-ring-svg>
              <circle class="pay__track" cx="20" cy="20" r="15"/>
              <circle class="pay__arc" cx="20" cy="20" r="15" pathLength="1" data-arc/>
              <path class="pay__tick" d="M13.5 20.5l4.5 4.5 8.5-9.5" pathLength="1" data-tick/>
            </svg>
          </button>
        </div>
        <p class="secure"><svg viewBox="0 0 16 16" aria-hidden="true"><rect x="3.5" y="7" width="9" height="6.5" rx="1.5"/><path d="M5.5 7V5.2a2.5 2.5 0 0 1 5 0V7"/></svg>Encrypted and secure</p>
      </div>

      <div class="view view--done" data-done aria-hidden="true">
        <span class="badge" data-badge aria-hidden="true">
          <svg viewBox="0 0 40 40"><path d="M13.5 20.5l4.5 4.5 8.5-9.5" pathLength="1" data-badge-tick/></svg>
        </span>
        <p class="done__title" data-in>Payment successful</p>
        <p class="amount" data-in aria-label="248 dollars and 60 cents"><span class="amount__roll" data-amount></span></p>
        <dl class="rows" data-rows>
          <div class="row" data-row><dt>Order</dt><span class="dots" data-dots></span><dd>LC-20418</dd></div>
          <div class="row" data-row><dt>Paid with</dt><span class="dots" data-dots></span><dd><span class="mini" aria-hidden="true"><svg viewBox="0 0 28 18"><rect x="0.75" y="0.75" width="26.5" height="16.5" rx="3"/><path d="M8 12.5l3-7h3l-3 7zM14 12.5l3-7h3l-3 7z"/></svg></span>&bull;&bull;&bull;&bull; 4821</dd></div>
          <div class="row" data-row><dt>Date</dt><span class="dots" data-dots></span><dd>27 Nov, 14:32</dd></div>
          <div class="row row--total" data-row><dt>Total</dt><span class="dots" data-dots></span><dd>$248.60</dd></div>
        </dl>
        <div class="acts" data-in>
          <button class="dl" type="button" data-dl>
            <span class="dl__icon" aria-hidden="true"><svg viewBox="0 0 20 20"><g data-arrow><path d="M10 3.5v9"/><path d="M6.2 9l3.8 3.8L13.8 9"/></g><path d="M4.5 16h11"/></svg></span>
            <span class="dl__label" data-dl-label>Download receipt</span>
            <span class="dl__bar" data-dl-bar aria-hidden="true"></span>
          </button>
          <button class="ok" type="button" data-ok>Done</button>
        </div>
      </div>
      <p class="sr" aria-live="polite" data-live></p>
    </section>
  </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.

37 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 “Payment successful” 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

A white Larch & Co. card with «Payment», the debit card •••• 4821 with a made-up network mark, «Total due $248.60» and the green «Pay $248.60» pill. Hover it and the label widens while the shadow grows; press it and the pill sinks to 0.97. On click the label leaves and the pill folds into a circle where a white ring spins. A second and a half later the ring closes, the tick draws itself, the circle pulses once, a green light runs along the top edge and a sheen crosses the card. The rest of the checkout lifts away, the circle flies up and becomes the green badge of the receipt while the card grows: «Payment successful» arrives, the amount $248.60 with its digits rolling in one after the other, four rows (Order LC-20418, Paid with •••• 4821, Date 27 Nov, 14:32, Total) with their dotted rules drawing, and the Download receipt and Done buttons. Download receipt drops the arrow, fills the line at the bottom and says «Receipt saved»; Done, or Esc, goes back to the checkout.

How it works

Two views in one card

The checkout and the receipt sit on top of each other in the same grid cell; the script sets the card’s height by measuring the active view, and tweens it from one to the other.

The pill becomes a ring

The pill’s width goes to the value of its height, leaving a circle. Inside, the whole svg spins with transformOrigin 50% 50%, while the arc has pathLength 1 and a stroke-dashoffset of 0.72.

The ring closes

On confirmation the endless spin stops and the svg lands on the nearest whole turn, the arc goes to stroke-dashoffset 0 and the tick draws from 1 to 0, with autoRound off.

The circle becomes the badge

Measure the circle and the receipt’s badge, put the badge where the circle is, at its scale, and bring it home with back.out: the FLIP technique.

Rolling digits

Every digit is a 0 to 9 column inside a window one line tall: just take yPercent to −digit × 10, one column after the other.

Values to change

NameFileDefaultWhat it changes
AMOUNTscript.js248.60The amount paid, in dollars: it rolls into the receipt digit by digit.
WORKscript.js1.6Seconds the ring works inside the pill before the payment goes through.
PRESSscript.js0.97Scale of the pill while pressed.
BOUNCEscript.js1.6How far the badge overshoots as it rises (0, none).
ROLLscript.js0.07Seconds between one digit of the amount and the next.
ROWSscript.js0.09Seconds between one receipt row and the next.
AUTO_PAUSEscript.js6Seconds of quiet before the demo plays by itself again.

Try them in the Playground

When to use it

At the end of an online shop’s checkout, a booking or a subscription: wherever whoever just paid needs to see right away that everything went through, how much they spent and where the receipt is.

On phones

Everything is in em and the size depends on both the width and the height of the window, so even the receipt, taller than the checkout, fits the phone box. A tap works like a click; if the window changes, the card is measured again.

With reduced motion

No movement or spinning: the ring appears still, the tick is already drawn, the checkout gives way to the receipt with a fade, the amount appears whole and the dotted rules are already in place.

Pitfalls

  • The spinning ring is the whole svg: transformOrigin 50% 50%, never svgOrigin, which on the svg itself moves the pivot and swings it round in a circle.
  • The endless spin has repeat: -1: on confirmation it has to be killed and the svg taken to a whole turn, or the tick ends up crooked.
  • The badge is measured once the receipt is already visible (visibility, not display), or getBoundingClientRect returns zero.
  • With stroke-dashoffset and pathLength 1 autoRound has to be off, or the tick and the ring pop in at once.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, JetBrains Mono (font variabile) 5.3.0.

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

Testing

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