Skip to content
animorio
IT
All components

Staking card

Cards, Hover, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 8.0 KBGSAP 28 KBFreeDownload the zip

The staking card of Halden, a made-up crypto wallet: how much ETH to stake on a slider with notches and the quick picks 25%, 50%, 75% and Max, the lock period on segments with a pill that slides on a spring, the yearly yield and the estimated monthly and yearly rewards rolling digit by digit. Stake shrinks into a circle with a spinning ring, then the tick draws itself and the rewards start to grow, by the second. On white, with a single violet 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>
<!--
  "Staking card" 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>Staking card</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 staking card of Halden, a made-up crypto wallet: how much ETH to stake on a slider with notches,
         the lock period on segments, the yearly yield and the rewards that roll digit by digit,
         then Stake turns into a ring, the tick draws itself and the rewards start to grow -->
    <section class="card" data-card aria-label="Stake ETH with Halden">
      <span class="card__edge" aria-hidden="true"></span>
      <span class="card__glow" aria-hidden="true" data-glow></span>

      <header class="head">
        <span class="mark" aria-hidden="true">
          <svg viewBox="0 0 24 24"><path d="M12 3.5 19.4 8v8L12 20.5 4.6 16V8z"/><path d="M12 8.2 15.6 10.4v3.2L12 15.8l-3.6-2.2v-3.2z"/></svg>
        </span>
        <div class="head__txt">
          <h1 class="head__title">Stake ETH</h1>
          <p class="head__sub">Halden Wallet</p>
        </div>
        <p class="avail"><span class="avail__lab">Available</span> <span class="avail__val">4.820 ETH</span></p>
      </header>

      <div class="amount">
        <p class="amount__big"><span class="roll" data-roll="amount">0.000</span><span class="amount__unit">ETH</span></p>
        <p class="amount__usd"><span class="approx" aria-hidden="true">&asymp;</span> <span class="roll" data-roll="usd">$0</span></p>
      </div>

      <div class="slider" data-slider role="slider" tabindex="0" aria-label="Amount to stake" aria-valuemin="0" aria-valuemax="100" aria-valuenow="25" aria-valuetext="1.205 ETH">
        <span class="slider__track" aria-hidden="true">
          <span class="slider__fill" data-fill></span>
          <span class="slider__tick" style="--at: 25%"></span>
          <span class="slider__tick" style="--at: 50%"></span>
          <span class="slider__tick" style="--at: 75%"></span>
        </span>
        <span class="thumb" data-thumb aria-hidden="true"><span class="thumb__body" data-thumb-body></span></span>
      </div>

      <div class="chips" role="group" aria-label="Quick amounts">
        <button class="chip" type="button" data-chip="25">25%</button>
        <button class="chip" type="button" data-chip="50">50%</button>
        <button class="chip" type="button" data-chip="75">75%</button>
        <button class="chip" type="button" data-chip="100">Max</button>
      </div>

      <div class="period">
        <p class="label">Lock period</p>
        <div class="seg" role="radiogroup" aria-label="Lock period" data-seg>
          <span class="seg__pill" data-seg-pill aria-hidden="true"></span>
          <button class="seg__opt is-on" type="button" role="radio" aria-checked="true" data-days="0">Flexible</button>
          <button class="seg__opt" type="button" role="radio" aria-checked="false" data-days="30">30 d</button>
          <button class="seg__opt" type="button" role="radio" aria-checked="false" data-days="90">90 d</button>
        </div>
      </div>

      <dl class="stats">
        <div class="stat stat--apy">
          <dt>APY</dt>
          <dd><span class="roll" data-roll="apy">3.10</span><span class="pct">%</span></dd>
        </div>
        <div class="stat">
          <dt>Per month</dt>
          <dd><span class="plus" aria-hidden="true">+</span><span class="roll" data-roll="month">0.0000</span></dd>
        </div>
        <div class="stat">
          <dt>Per year</dt>
          <dd><span class="plus" aria-hidden="true">+</span><span class="roll" data-roll="year">0.0000</span></dd>
        </div>
      </dl>

      <div class="go">
        <button class="stake" type="button" data-stake>
          <span class="stake__face stake__face--idle" data-face-idle><span class="stake__lab">Stake <span data-stake-amt>0.000</span> ETH</span></span>
          <span class="stake__face stake__face--busy" data-face-busy aria-hidden="true">
            <svg class="ring" viewBox="0 0 20 20" data-ring><circle cx="10" cy="10" r="7.2" pathLength="1"/></svg>
          </span>
          <span class="stake__face stake__face--done" data-face-done aria-hidden="true">
            <svg class="tick" viewBox="0 0 20 20"><path d="M5.6 10.4 8.6 13.3 14.4 7.2" pathLength="1" data-tick/></svg>
          </span>
        </button>
        <p class="earned" data-earned aria-live="polite"><span class="earned__lab">Staked. Earning</span> <span class="earned__val" data-earned-val>0.0000000</span> <span class="earned__unit">ETH</span></p>
      </div>
    </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.

51 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 “Staking card” 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

The card arrives and a thread of light runs along its top edge. The slider thumb swells when you grab it and dragging takes the amount from 1.205 to almost 3 ETH: the big figure, the dollars and the monthly and yearly rewards follow at once, and the quick picks light up when the amount is exactly theirs. The lock period goes from Flexible to 30 d and 90 d, the white pill sliding on a spring and the APY rising from 3.10 to 5.60% while the APY and the rewards roll digit by digit. Stake: the label rises and fades, the button shrinks into a circle with a spinning ring, then the tick draws itself with a small bounce, the light runs along the edge again and «Staked. Earning» appears below, the rewards growing every moment. If nobody touches it, the demo does everything by itself and starts over.

How it works

The rolling digits

Every number is made of windows one line tall, one per digit, holding a column from 0 to 9: to change value each column moves with a yPercent of minus ten times the digit, with a small delay from right to left. If the shape of the number changes (one more digit or comma) the row is rebuilt.

The notched slider

The position comes from the pointer as a share of the width; near 25, 50, 75 and 100 the notch pulls it a little. While dragging the digits follow at once, as in a real wallet (each column set in place with gsap.set); they roll when the lock period changes.

Three faces in one place

The button has three stacked faces, the label, the ring and the tick, each as wide as the button and centred on its own: when the button shrinks into a circle no hidden label keeps it wide, and ring and tick sit in the middle.

Values to change

NameFileDefaultWhat it changes
BALANCEscript.js4.82The ETH available to stake.
ETH_PRICEscript.js3698.4The dollar price of one ETH, for the line under the amount.
APY_FLEXscript.js3.1The yearly yield in percent with no lock.
APY_30script.js4.25The yearly yield with a 30 day lock.
APY_90script.js5.6The yearly yield with a 90 day lock.
STARTscript.js25Where the slider starts, in percent of the balance.
SPRINGscript.js0.55How springy the thumb, the pill and the button are (lower = more bounce).
ROLL_TIMEscript.js0.6Seconds each digit takes to roll to its new value.
STAKE_TIMEscript.js1.6Seconds the ring spins before the stake is confirmed.
AUTO_PAUSEscript.js1.4Seconds the demo waits before it starts over.
IDLEscript.js6Seconds after your last touch before the demo plays by itself again.
--accentostyle.css#5b4cf5The single accent: the fill, the thumb, the button and the tick.

Try them in the Playground

When to use it

In crypto wallets, exchanges and finance apps that offer staking or yield savings: it shows right away how much you earn while you choose how much and for how long, and confirms without leaving the card.

On phones

Everything is in em and the size depends on both the width and the height of the window, so the whole card fits the phone box. The slider is dragged with a finger (touch-action none) and the quick picks stay within thumb reach.

With reduced motion

No springs or movement: the numbers change without rolling, the pill and the slider go to their place at once, the button changes face with a fade.

Pitfalls

  • The button faces are absolutely positioned and the button has a pixel width during the cycle: a hidden label in the flow would keep it wide and push the ring off centre.
  • With autoRound off the tick with pathLength 1 draws itself instead of popping in.
  • While dragging the digits do not roll: a new tween on every move would leave them jittering halfway. They are set in place with gsap.set, and roll only on clean changes.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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