Skip to content
animorio
IT
All components

Contactless pay button

Buttons, HoverGSAP, CSS onlyMediumCompressed weight: Demo 9.7 KBGSAP 28 KBFreeDownload the zip

The Pay €24.80 button of a made-up grocer, Larder & Co., graphite on white. On tap the pill gives, stretches on a spring and becomes the face of a contactless terminal, with the shop, the amount and the four waves searching. A brushed metal card, with a gold chip and a reflection sliding over its grain, comes down tilted, slows and touches with a small bounce: its shadow tightens, the waves fire outwards, two rings open and the face flushes green for an instant, the beep. The card leaves, the terminal closes back into the pill and it says Paid with the tick drawing itself and the amount rolling in.

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>
<!--
  "Contactless pay button" 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 Pay button you tap with the card on a contactless terminal</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 Pay button of a made-up grocer. On tap the pill stretches into the face of a contactless terminal, a
         brushed metal card comes down tilted, touches it with a small bounce, the waves answer, and the pill closes
         again as Paid with a drawn tick and the amount rolling in -->
    <div class="pay" data-pay>
      <span class="pay__shadow" data-shadow aria-hidden="true"></span>

      <button class="pill" type="button" data-pill aria-label="Pay €24.80 at Larder &amp; Co.">
        <span class="pill__skin" aria-hidden="true">
          <span class="pill__grain"></span>
          <span class="pill__wash" data-wash></span>
          <span class="pill__edge"></span>
        </span>

        <!-- rest: the button -->
        <span class="rest" data-rest aria-hidden="true">
          <svg class="rest__waves" viewBox="0 0 24 24" data-rest-waves>
            <path d="M6.6 9.4a3.9 3.9 0 0 1 0 5.2"/>
            <path d="M9.6 6.9a7.6 7.6 0 0 1 0 10.2"/>
            <path d="M12.6 4.4a11.3 11.3 0 0 1 0 15.2"/>
            <path d="M15.6 1.9a15 15 0 0 1 0 20.2"/>
          </svg>
          <span class="rest__label" data-rest-label>Pay</span>
          <span class="roll rest__amount" data-rest-amount>€24.80</span>
        </span>

        <!-- the terminal face -->
        <span class="term" data-term aria-hidden="true">
          <span class="term__head" data-term-part>
            <span class="term__shop" data-shop>Larder &amp; Co.</span>
            <span class="term__sum" data-term-sum>€24.80</span>
          </span>
          <span class="term__rule" data-term-part></span>
          <span class="term__mark" data-term-part>
           <span class="term__spot">
            <svg class="term__rings" viewBox="-50 -50 100 100">
              <circle data-ring r="20"/>
              <circle data-ring r="20"/>
            </svg>
            <svg class="term__waves" viewBox="0 0 24 24">
              <g class="term__dim">
                <path d="M6.6 9.4a3.9 3.9 0 0 1 0 5.2"/>
                <path d="M9.6 6.9a7.6 7.6 0 0 1 0 10.2"/>
                <path d="M12.6 4.4a11.3 11.3 0 0 1 0 15.2"/>
                <path d="M15.6 1.9a15 15 0 0 1 0 20.2"/>
              </g>
              <g class="term__lit">
                <path data-arc d="M6.6 9.4a3.9 3.9 0 0 1 0 5.2"/>
                <path data-arc d="M9.6 6.9a7.6 7.6 0 0 1 0 10.2"/>
                <path data-arc d="M12.6 4.4a11.3 11.3 0 0 1 0 15.2"/>
                <path data-arc d="M15.6 1.9a15 15 0 0 1 0 20.2"/>
              </g>
            </svg>
           </span>
          </span>
          <span class="term__foot" data-term-part>
            <span class="term__status">
              <span data-status>Hold card near</span>
              <span data-status>Reading card</span>
              <span data-status>Approved</span>
            </span>
            <span class="term__bar"><i data-bar></i></span>
          </span>
        </span>

        <!-- after: paid -->
        <span class="done" data-done aria-hidden="true">
          <svg class="done__tick" viewBox="0 0 24 24">
            <circle data-tick-ring cx="12" cy="12" r="10.2" pathLength="1"/>
            <path data-tick d="M7.4 12.4l3.1 3.1 6.1-6.6" pathLength="1"/>
          </svg>
          <span class="done__label" data-done-label>Paid</span>
          <span class="roll done__amount" data-done-amount>€24.80</span>
        </span>
      </button>

      <!-- the customer's card: brushed metal, chip, 1px edge -->
      <div class="card" data-card aria-hidden="true">
        <div class="card__face">
          <span class="card__brush"></span>
          <span class="card__sheen" data-sheen></span>
          <span class="card__name">KESTREL</span>
          <svg class="card__nfc" viewBox="0 0 24 24">
            <path d="M8.6 9.4a3.9 3.9 0 0 1 0 5.2"/>
            <path d="M11.6 6.9a7.6 7.6 0 0 1 0 10.2"/>
            <path d="M14.6 4.4a11.3 11.3 0 0 1 0 15.2"/>
          </svg>
          <svg class="card__chip" viewBox="0 0 40 30">
            <defs>
              <linearGradient id="gold" x1="0" y1="0" x2="1" y2="1">
                <stop offset="0" stop-color="#f3dfa6"/>
                <stop offset=".45" stop-color="#c9a95e"/>
                <stop offset=".7" stop-color="#e9d394"/>
                <stop offset="1" stop-color="#a8853e"/>
              </linearGradient>
            </defs>
            <rect x=".5" y=".5" width="39" height="29" rx="5.5" fill="url(#gold)" stroke="rgba(90,66,20,.55)"/>
            <path d="M.5 10.5h11.5a3 3 0 0 1 3 3v3a3 3 0 0 1-3 3H.5M39.5 10.5H28a3 3 0 0 0-3 3v3a3 3 0 0 0 3 3h11.5M15 15h10M20 .5v9M20 20.5v9" fill="none" stroke="rgba(90,66,20,.5)" stroke-width="1"/>
          </svg>
          <span class="card__kind">DEBIT</span>
          <span class="card__num">4021</span>
        </div>
      </div>
    </div>
    <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.

28 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 “Contactless pay button” 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 white background there is only a graphite pill with the contactless mark on the left, Pay and, after a thin line, €24.80. Hovering lifts it by a pixel, widens the label and lights the four waves green one after another. On tap the pill gives, the words leave upwards and the pill stretches on a spring, in width and in height, into the face of a terminal: Larder & Co. and the amount on top, a thin rule, the large contactless mark in the middle with its waves lighting softly outwards as if searching, and Hold card near underneath with a progress line. A brushed metal card comes down from above, tilted, with Kestrel engraved, a gold chip, the contactless mark and the last digits 4021: as it turns a reflection slides over it along the grain. It slows above the terminal, then closes in and touches it: it gives a little and bounces back, and its shadow, wide and soft before, becomes small and sharp. At that moment the waves fire outwards one after another, two thin rings open from the mark, the terminal face flushes green for an instant, the line says Reading card and fills, then Approved, with every wave lit. The card lifts away, the terminal closes back into the pill and a green circle with the tick draws itself there, Paid appears and the amount rolls in digit by digit from below. After a couple of seconds the pill is Pay €24.80 again and the round starts over. A tap, a click or Enter makes it pay.

How it works

One number for the shape

The pill has no two CSS states: a number from zero to one, pushed by GSAP with back.out, gives width, height and radius in pixels, taken from the pill's and the terminal's sizes. The sizes are read again on resize and the drawing starts again from the same number, so even halfway through the spring the shape is right.

The face ready underneath

The terminal is laid out at its full size from the start, in the middle of the pill which clips it with overflow hidden: as the pill grows it uncovers it, and nothing reflows while it moves.

The card driven by three numbers

Approach, give and leaving are three numbers: from them come the card's position, tilt with transformPerspective, rotation, scale and opacity, the position of the reflection and the contact shadow, which goes from wide and soft to small and sharp as the card comes down.

The brushed metal

Over a five stop silver gradient sits an SVG feTurbulence noise with a low horizontal and a high vertical frequency: it becomes a grain of long lines, blended in overlay. The reflection is a soft-light band that slides as the card turns; the words are engraved with a light shadow below and a dark one above.

The beep

On touch a number runs over the four waves from the smallest, each lighting up as it passes; two circles open out of phase, a green glow covers the face for a tenth of a second and the progress line fills before Approved.

Paid and the rolling amount

The amount is split into one character per window: each character rises from below with a small overshoot, a few hundredths apart, while the circle and the tick draw themselves with pathLength 1 and stroke-dashoffset.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js'#3ee08f'The colour of the waves, the approval and the tick.
AMOUNTscript.js'€24.80'The amount on the button and on the terminal.
SHOPscript.js'Larder & Co.'The shop written on the terminal.
TILTscript.js34How tilted the card comes down, in degrees.
BOUNCEscript.js1How much the card gives when it touches: 0 none, 2 double.
SPEEDscript.js12 is twice as fast, 0.5 half as fast.
HOLDscript.js2.2How many seconds Paid stays before the button is ready again.
AUTOscript.jstrueThe payment plays by itself until someone touches the button.

Try them in the Playground

When to use it

In the checkout of an online shop or a grocer, at the till of an app for cafés and restaurants, on the page of a card or a bank: anywhere paying with a contactless card is the moment worth telling.

On phones

The same pill, 60 pixels tall, and the same terminal, almost as wide as the screen and at most half its height: the card comes down inside its box. A tap pays, and another tap on Paid makes it ready again.

With reduced motion

No spring, no card coming down, no rings: the terminal fades in with the card already resting on it, the waves light up together with Approved, then the pill fades back in with Paid, the tick already drawn and the amount in place.

Pitfalls

  • The pill was centred with GSAP's xPercent and also with a CSS translate: GSAP read the translate as pixels and moved it twice. Only GSAP centres it now.
  • Animating width and height in pixels with tweens breaks on a resize halfway: the shape now comes from a single number and sizes read again, so it is right even if the window changes while the card comes down.
  • The terminal drawn inside a growing pill reflowed every frame: laid out at its full size and only clipped, it stays still.
  • The pill's overflow hidden does not clip its own shadow, but it would clip the card's: that is why the card and its contact shadow sit outside the pill, above it.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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