
The elastic button
Buttons, Hover, Text
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.
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 & 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 & 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>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
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 siteThe 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 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.
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.
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.
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.
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.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | '#3ee08f' | The colour of the waves, the approval and the tick. |
AMOUNT | script.js | '€24.80' | The amount on the button and on the terminal. |
SHOP | script.js | 'Larder & Co.' | The shop written on the terminal. |
TILT | script.js | 34 | How tilted the card comes down, in degrees. |
BOUNCE | script.js | 1 | How much the card gives when it touches: 0 none, 2 double. |
SPEED | script.js | 1 | 2 is twice as fast, 0.5 half as fast. |
HOLD | script.js | 2.2 | How many seconds Paid stays before the button is ready again. |
AUTO | script.js | true | The payment plays by itself until someone touches the button. |
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.
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.
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.
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.
Tested on 5 November 2026
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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.