
The send button
Buttons, Transitions, SVG
The six-digit verification code field (OTP) of a banking app, on black, in a minimal premium style: the code that arrived in Messages is pasted with one tap and the digits fall into the cells in a cascade, landing a pixel low; while it is checked a light runs along the cell edges, then the cells zip shut from the sides into a green pill with a tick. A wrong code shakes them on a spring and empties them from the right.
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>
<!--
"Bank verification code 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 bank verification code with the falling digits</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 one-time code of a banking app: a code from Messages is pasted and its digits fall into the cells one
after the other, a light runs along the cell edges while it is checked, then the cells zip shut into a green
pill with a tick; a wrong code shakes the cells on a spring and empties them from the right -->
<section class="otp" data-otp aria-labelledby="otp-title">
<span class="otp__glow" aria-hidden="true" data-glow></span>
<header class="otp__head">
<span class="otp__mark" aria-hidden="true">
<svg viewBox="0 0 24 24"><path d="M12 3.2l7 2.7v5.4c0 4.3-2.9 7.9-7 9.5-4.1-1.6-7-5.2-7-9.5V5.9z"/><path d="M9.2 11.6V10a2.8 2.8 0 015.6 0v1.6"/><rect x="8.2" y="11.6" width="7.6" height="5" rx="1.4"/></svg>
</span>
<div class="otp__words">
<h1 class="otp__title" id="otp-title"><span data-title>Confirm your transfer</span></h1>
<p class="otp__sub"><span data-sub>£1,240.00 to Mara Quinn, Halden Bank</span></p>
</div>
</header>
<div class="otp__field" data-field>
<label class="sr" for="otp-input">Enter the 6-digit code sent to your phone</label>
<input class="otp__input" id="otp-input" type="text" inputmode="numeric" autocomplete="one-time-code" maxlength="6" spellcheck="false" aria-describedby="otp-status" data-input>
<div class="otp__cells" aria-hidden="true" data-cells></div>
<div class="otp__done" aria-hidden="true" data-done>
<span class="otp__tick"><svg viewBox="0 0 24 24"><path d="M6 12.6l4 4L18.2 8" data-tick/></svg></span>
<span class="otp__done-words" data-done-words>Transfer approved</span>
</div>
</div>
<p class="otp__status" id="otp-status" role="status" aria-live="polite">
<span class="otp__status-in" data-status>Code expires in <b data-clock>4:59</b></span>
</p>
<button class="otp__suggest is-waiting" type="button" aria-disabled="true" data-suggest>
<span class="otp__bubble" aria-hidden="true">
<svg class="otp__spin" viewBox="0 0 24 24"><circle cx="12" cy="12" r="7"/><path d="M12 5a7 7 0 017 7"/></svg>
<svg class="otp__msg" viewBox="0 0 24 24"><path d="M12 4.5c4.7 0 8.2 3 8.2 6.7s-3.5 6.7-8.2 6.7c-.9 0-1.8-.1-2.6-.3L5.6 19.4l.9-3.3C4.7 14.9 3.8 13.1 3.8 11.2c0-3.7 3.5-6.7 8.2-6.7z"/></svg>
</span>
<span class="otp__from"><span data-from>Waiting for the code</span></span>
<span class="otp__code" data-suggest-code>482 913</span>
</button>
</section>
<!-- the pretend pointer of the automatic preview -->
<svg class="pointer" viewBox="0 0 24 24" aria-hidden="true" data-pointer><path d="M5.5 3.5l13 7.4-5.6 1.4-2.9 5.3z"/></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.
27 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 “Bank verification code field” from Animorio and fit it into my siteThe cells only draw: the real field is a single input, invisible and as big as they are, with inputmode numeric, autocomplete one-time-code and a 16-pixel typeface. Pasting, the number keyboard, screen readers and the code iPhone offers above the keyboard all work by themselves; the script keeps only the digits and compares the new value with the old one, cell by cell.
A new digit starts FALL pixels higher, blurred and stretched upright, and drops with power2.in to one pixel below its place, then comes back up with power2.out; the moment it touches, the cell squashes to scaleY 0.97 and springs back with back.out. A pasted code makes the same fall in a cascade, one digit every CASCADE seconds, while the suggestion's digits rise and fade to the same beat.
Each cell has an SVG with a rect redrawn at its real size (on resize too) and pathLength 100: the stroke is a dash of 16 out of 84 that goes round with stroke-dashoffset from 8 to -92, looping, each cell 0.07 seconds after the one before, with a drop-shadow for the glow. Meanwhile the digits breathe in opacity and the Verifying code line shimmers with a gradient in the text.
With the right code the edges turn green from the left; then each cell moves to the middle (its x is the distance between its centre and the row's), narrows and fades, with a from edges stagger: the outer ones close first, like a zip. The pill grows from scaleX 0.28 with back.out, the tick's disc bounces and the tick draws itself with stroke-dashoffset.
The cells take the error class, are pushed SPRING pixels in 0.07 seconds and come back with elastic.out(1, 0.22), one just after the other; the field gets aria-invalid and the status line says so. Then the digits rise and vanish from the right, one every 0.08 seconds, and the field is free again.
Until someone touches it, the demo types a code with the third digit wrong, then a pretend pointer taps the From Messages suggestion. The first real touch (pointerdown or a key) stops the demo, empties the cells and leaves the suggestion ready; all the timing is GSAP, no setTimeout.
| Name | File | Default | What it changes |
|---|---|---|---|
LENGTH | script.js | 6 | How many digits the code has. |
CODE | script.js | '482913' | The right code, the one that arrives in Messages. |
FALL | script.js | 22 | How many pixels a digit falls before it lands. |
CASCADE | script.js | 0.075 | The seconds between two pasted digits. |
CHECK | script.js | 1.5 | The seconds the light runs while the code is checked. |
SPRING | script.js | 12 | How many pixels a wrong code throws the cells sideways. |
HOLD | script.js | 2.6 | The seconds the green pill stays before the card starts over. |
For confirming a transfer or a payment, two-factor verification, signing in to a banking or payments app, confirming a phone number: wherever a code of a few digits arrives by text message.
The card is at most the screen width minus 28 pixels and the cells are measured on width and height (min of vw and vh), so they fit the phone's preview box too. A tap opens the number keyboard and on iPhone the code that came by text message is offered above the keyboard; the 16-pixel typeface stops the page zooming in.
The digits fade in and out without falling, the light does not run but the edges glow on and off slowly, the wrong cells turn red without shaking, the green pill fades in with the tick already drawn and the pretend pointer does not move.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 9.6 KB; the libraries: GSAP 28 KB.
Tested on 12 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.