
The elastic button
Buttons, Hover, Text
The button to redeem cashback, on black: the balance sits in the pill as a level of gold; pressed, the coins leave edge-on toward the arrow, the balance counts down to zero as the level drains and the pill confirms in green with a check.
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>
<!--
"Redeem cashback 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>Redeem cashback button</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 cashback balance sits in the pill as a gold level: pressing Redeem, the coins leave edge-on
toward the arrow, the balance counts down to zero and the pill confirms in green -->
<button class="cb" type="button" data-cb aria-label="Redeem cashback">
<span class="cb__level" data-level aria-hidden="true"></span>
<span class="cb__wash" data-wash aria-hidden="true"></span>
<span class="cb__shine" data-shine aria-hidden="true"></span>
<span class="cb__coin" data-coin aria-hidden="true">
<svg viewBox="0 0 28 28">
<ellipse class="cb__coin-edge" cx="14" cy="15.200" rx="10.500" ry="10.500"></ellipse>
<ellipse class="cb__coin-face" data-face cx="14" cy="13.200" rx="10.500" ry="10.500"></ellipse>
<path class="cb__coin-mark" data-mark d="M17.300 9.700a4.300 4.300 0 1 0 0 7M9.400 12h5.400M9.400 14.500h4.600"></path>
</svg>
</span>
<span class="cb__text">
<span class="cb__small"><span data-small>Cashback</span></span>
<b class="cb__amount" data-amount>€0.00</b>
</span>
<span class="cb__flow" data-flow aria-hidden="true"></span>
<span class="cb__go">
<span class="cb__label"><span data-label>Redeem</span></span>
<svg viewBox="0 0 18 18" aria-hidden="true">
<path data-arrow d="M4 9h10M10 5l4 4-4 4"></path>
<path class="cb__tick" data-tick pathLength="1" d="M4.300 9.400 7.500 12.400 13.800 5.800"></path>
</svg>
</span>
</button>
<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>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.
14 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 “Redeem cashback button” from Animorio and fit it into my siteA single number, the money still in the pill, writes the figure and is the scaleX of the gold background with its origin on the right: as it falls, the level drains toward the arrow.
Each coin is a tall narrow slab going from the middle of the coin to the dark pill; they leave staggered across the whole countdown, so the last one lands as the balance hits zero.
The green is a circle clip-path centred on the dark pill, where the coins landed: the confirmation is born where the gesture ended.
| Name | File | Default | What it changes |
|---|---|---|---|
GOLD | script.js | #f2b632 | The cashback colour. |
DONE | script.js | #2fbf71 | The confirmation colour. |
BALANCE | script.js | 18.4 | The cashback to redeem, in euros. |
COINS | script.js | 7 | How many coins leave for the account (3 to 12). |
SPEED | script.js | 1 | The speed of the redeem (1 = normal). |
HOLD | script.js | 2.6 | The seconds the confirmation stays before it is ready again. |
LOOP | script.js | true | Left alone, a pointer presses the button. |
In a bank or card app, in a shop’s wallet with rewards, in a loyalty scheme; and wherever a balance is cashed in with one gesture: credits, points, affiliate earnings.
The same button, as wide as the screen allows: pressed with a thumb.
The balance is already written. Pressing it, the button goes straight to the green confirmation with the check, with no flying coins.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.5 KB; the libraries: GSAP 28 KB.
Tested on 19 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.