Skip to content
animorio
IT
All components

Transfer amount field

Forms, Text, HoverGSAP, CSS onlyMediumCompressed weight: Demo 8.7 KBGSAP 28 KBFreeDownload the zip

The amount step of a bank transfer in an invented banking app, Orrin, on white: every figure you type comes in on a little reel and its column opens from zero, the thousands comma slides into its gap and moves along as the number grows, and underneath the available balance shrinks along a bar, with the part this transfer takes hatched in green. Past the balance the field shakes, turns amber and says «Above your balance»; Review transfer only lights up for an amount you can send.

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>
<!--
  "Transfer amount field" 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 transfer amount field with rolling digits and a shrinking balance</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" data-stage>
    <!-- the amount step of a bank transfer in Orrin, an invented banking app: typed figures roll in on reels, the
         thousands separator slides into place, the available balance shrinks along a bar, and above the balance the
         field shakes and turns amber -->
    <section class="send" data-card aria-labelledby="send-title">
      <header class="send__head">
        <span class="who" aria-hidden="true">
          <span class="who__face">MH</span>
          <svg class="who__bank" viewBox="0 0 16 16"><path d="M3 6.4 8 3.6l5 2.8M4.4 6.8v4.6M7.1 6.8v4.6M8.9 6.8v4.6M11.6 6.8v4.6M3 12.6h10"/></svg>
        </span>
        <span class="send__meta">
          <span class="send__to" id="send-title">To Maren Holt</span>
          <span class="send__acc">Orrin Current · ending 4471</span>
        </span>
        <button class="send__change" type="button" tabindex="-1">Change</button>
      </header>

      <div class="field" data-field>
        <span class="field__glow" aria-hidden="true"></span>
        <span class="field__top">
          <label class="field__label" for="amount">You send</label>
          <span class="field__cur" aria-hidden="true">EUR</span>
        </span>
        <span class="amount" data-amount aria-hidden="true">
          <span class="amount__sym">€</span><span class="amount__num" data-num><span class="amount__zero" data-zero>0</span></span><span class="caret" data-caret></span><span class="amount__cents" data-cents>.00</span>
        </span>
        <input class="field__input" id="amount" type="text" inputmode="numeric" autocomplete="off" maxlength="8" aria-describedby="amount-status" data-input>
        <span class="field__note">
          <span class="note note--ok" data-note-ok>
            <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8.6 2.5 4.4 9h3.4l-.6 4.5L11.6 7H8.2z"/></svg>
            Arrives in seconds · no fee
          </span>
          <span class="note note--over" data-note-over aria-hidden="true">
            <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 2.6 14 13H2z"/><path d="M8 6.6v3M8 11.3v.01"/></svg>
            Above your balance
          </span>
        </span>
      </div>

      <div class="bal" data-bal>
        <div class="bal__row">
          <span class="bal__k">Available <b data-avail>€4,280.50</b></span>
          <span class="bal__v" data-left-wrap><span data-left-k>Left after</span> <b data-left>€4,280.50</b></span>
        </div>
        <div class="bar" aria-hidden="true">
          <span class="bar__spend" data-spend></span>
          <span class="bar__left" data-leftbar><span class="bar__shine"></span></span>
        </div>
      </div>
      <p class="sr" id="amount-status" aria-live="polite" data-status></p>

      <button class="go" type="button" disabled data-go>
        <span class="go__fill" data-go-fill></span>
        <span class="go__label" data-go-a>Review transfer</span>
        <span class="go__label go__label--b" data-go-b>
          <svg viewBox="0 0 24 24"><path d="M6 12.4l3.6 3.6L18 7.6" data-go-tick/></svg>
          Ready to send
        </span>
      </button>
    </section>

    <svg class="pointer" viewBox="0 0 24 24" aria-hidden="true" data-pointer><path d="M5 3l14 8.2-6.2 1.4 3.6 6.8-2.6 1.4-3.6-6.8L5 18.6z"/></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.

37 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 “Transfer amount field” 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

A white card with the recipient on top (Maren Holt, account ending 4471) and a large You send field in euros. Every digit you type rolls in on a 0 to 9 reel, blurred for a moment while it spins, and its column opens on a spring; at a thousand the comma opens into its gap dropping from above, and at ten thousand it closes behind one digit and opens behind the next. Below, Available and Left after: the remainder counts to its new value and the green bar shortens with a pixel of bounce, while the part the transfer takes stays hatched and a glint runs along the bar. Past the balance the field shakes, turns amber with a lit border, the line below gives way to «Above your balance» and on the right you read how much is missing; the button switches off. Review transfer, pressed, fills green from the left and says Ready to send with a drawn tick. On its own a drawn pointer types 3,250, adds one zero too many, steps back and confirms.

How it works

The real field under the drawn one

A transparent input with inputmode numeric lies over the field and holds the value: on every input only digits are kept, leading zeros dropped, and the result compared with the previous value. Only the difference is redrawn: extra digits are added, removed ones leave, so typing, deleting and pasting work as in a normal field.

Digits on reels

Each digit is a window 0.6 em wide and one line tall over a reel holding 0-9 twice. A new digit starts ROLL places earlier and rises with yPercent to its number with back.out, with a blur filter that clears as it spins; the column opens from zero width to its real size and then hands the width back to CSS (clearProps), so it survives a resize.

The sliding comma

Each digit carries a closed gap for a comma. On every change we count from the right: the digit with three or six digits after it opens its gap (width from zero with back.out and the comma dropping in), the one that no longer needs it closes it. Between 9,999 and 99,999 one closes while the other opens, and the comma seems to slide one place.

The balance and the bar

The remainder is an object GSAP carries to its new value, written every frame with toLocaleString; the green bar is as wide as the remainder over the balance, with back.out(1.15), on top of a hatched band made with repeating-linear-gradient that is the transfer’s share. A glint runs along the bar on every digit.

Above the balance

When the amount passes BALANCE the field gets the is-over class (amber, lit border, glow), shakes with x keyframes SHAKE pixels wide that die down, and the two lines under the number swap by sliding. Every extra digit while above gives a smaller shake; the button switches off.

The pilot

A drawn pointer taps the field, types 3250, adds a zero, deletes it and presses Review transfer; then the field empties and the story starts again. At the first real tap or key the pilot stops, and starts again after nine seconds with nobody around.

Values to change

NameFileDefaultWhat it changes
BALANCEscript.js4280.5The euros available on the account.
ROLLscript.js4How many figures a new digit’s reel rolls through before it lands.
ROLL_TIMEscript.js0.55Seconds for a digit to roll into place.
SEP_TIMEscript.js0.42Seconds for the thousands separator to slide into its gap.
BAR_TIMEscript.js0.7Seconds for the balance bar to settle on its new length.
SHAKEscript.js7Pixels the field shakes when you go above the balance.
TYPE_SPEEDscript.js5Digits per second typed by the pilot.
PAUSEscript.js1.3Seconds the pilot waits between its steps.
LOOPscript.jstrueThe pilot starts over.

Try them in the Playground

When to use it

In the amount step of a bank transfer, a top-up, a payment to a friend or a withdrawal in a banking or payments app; it also fits a savings pot with a goal, a monthly budget or the store credit field of a checkout, anywhere a typed number has to stay under a limit.

On phones

The same animation with adapted sizes: the card is as wide as the screen minus the margins, the digits also follow the height (min of vw and vh) and the number shrinks by itself when it would touch the edge of the field. A tap opens the phone’s number keypad.

With reduced motion

Nothing rolls or shakes: digits and comma appear already in place, the remainder and the bar jump to their new value, the amber state arrives without a shake and the field already shows 3,250; the pointer is hidden.

Pitfalls

  • Animating the column width in pixels left it fixed: on resize the digits no longer followed the font size. At the end of every tween the width goes back to CSS with clearProps, and to close a comma we measure first and remove the class afterwards.
  • With digits 0.6 em wide and up to six of them, 999,999 touched the edge on a phone: the number shrinks with a scale worked out from digits, commas, symbol and cents, measured again on resize.
  • The round end of the green bar got squashed with scaleX: the bar grows with a percentage width, which keeps the real radius, and fades out at zero so its white shadow leaves no line.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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