Skip to content
animorio
IT
All components

Redeem cashback button

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

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.

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>
<!--
  "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>

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.

14 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 “Redeem cashback 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 black, a cream pill: on the left a gold coin in a white disc, then “Cashback” and the balance, on the right the dark “Redeem” pill with its arrow. At first the balance counts up from zero and a level of gold fills the pill from right to left. Pressed, the button squeezes and springs back, the coin turns on itself and a line of coins seen edge-on leaves it for the arrow, each with a small hop; every landing gives the dark pill a push. Meanwhile the balance counts down to zero and the gold level drains. At the end a light green opens in a circle from the dark pill, which turns green, the arrow gives way to a drawn check, the label becomes “Done”, above the balance it says “Sent to your account” and the redeemed amount counts back, with a sheen crossing the button. After a few seconds it is ready again.

How it works

The balance is the level

A 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.

Coins edge-on

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 confirmation from the right spot

The green is a circle clip-path centred on the dark pill, where the coins landed: the confirmation is born where the gesture ended.

Values to change

NameFileDefaultWhat it changes
GOLDscript.js#f2b632The cashback colour.
DONEscript.js#2fbf71The confirmation colour.
BALANCEscript.js18.4The cashback to redeem, in euros.
COINSscript.js7How many coins leave for the account (3 to 12).
SPEEDscript.js1The speed of the redeem (1 = normal).
HOLDscript.js2.6The seconds the confirmation stays before it is ready again.
LOOPscript.jstrueLeft alone, a pointer presses the button.

Try them in the Playground

When to use it

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.

On phones

The same button, as wide as the screen allows: pressed with a thumb.

With reduced motion

The balance is already written. Pressing it, the button goes straight to the green confirmation with the check, with no flying coins.

Pitfalls

  • The balance is made up and the redeem is fake: in a real app the button confirms only once the transfer is recorded, and stays disabled after.
  • While redeeming the button has aria-busy and once confirmed aria-disabled: a second tap does not start another redeem.
  • The state is not told by colour alone: the labels go from “Redeem” to “Done” and from “Cashback” to “Sent to your account”.

Libraries

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.

Testing

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