
The elastic button
Buttons, Hover, Text
The account card of a banking app, on white, in the style of product interface pieces: switching Hide balance on blurs the balance and the transactions one after another under a fine hatch while the eye closes its lid; switching it off rolls the figures back in from below, sharp. Pressing and holding a hidden figure shows it for as long as the finger stays down.
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>
<!--
"Hide balance toggle" 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 Hide balance toggle that blurs the figures</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 account card of a banking app: switching Hide balance on blurs the balance and the amounts one after another
under a fine hatch while the eye closes its lid; switching it off rolls the figures back in, sharp;
a long press on the hidden balance shows it for a moment -->
<section class="card" data-card aria-labelledby="hb-label">
<header class="top">
<span class="brand">
<svg class="brand__mark" viewBox="0 0 20 20" aria-hidden="true">
<rect x="1" y="1" width="18" height="18" rx="5.5"></rect>
<path d="M5 12.2c1.6-1.6 3.4-1.6 5 0s3.4 1.6 5 0M5 8.2c1.6-1.6 3.4-1.6 5 0s3.4 1.6 5 0"></path>
</svg>
<span class="brand__name">Tidebank</span>
</span>
<span class="top__acc">Everyday account</span>
</header>
<div class="bal">
<span class="bal__label">Available balance</span>
<div class="num num--big" data-num data-peek aria-label="12,480.36 dollars">
<span class="num__digits" data-digits>$12,480.36</span>
<span class="num__veil" data-veil aria-hidden="true"></span>
</div>
<span class="bal__sub"><span data-sub>Updated just now</span></span>
</div>
<div class="row">
<button class="eye" type="button" data-eye aria-hidden="true" tabindex="-1">
<svg viewBox="0 0 24 24">
<path class="eye__lid-top" d="M2.6 12c2.4-4 5.6-6 9.4-6s7 2 9.4 6"></path>
<path class="eye__lid-bot" data-lidbot d="M2.6 12c2.4 4 5.6 6 9.4 6s7-2 9.4-6"></path>
<circle class="eye__iris" data-iris cx="12" cy="12" r="3.1"></circle>
<path class="eye__closed" data-closed d="M2.6 12c2.4 3.4 5.6 5.1 9.4 5.1s7-1.7 9.4-5.1"></path>
<path class="eye__lash" data-lash d="M6.4 15.3 5 17.4M12 17.2v2.5M17.6 15.3l1.4 2.1"></path>
</svg>
</button>
<div class="row__text">
<span class="row__name" id="hb-label">Hide balance</span>
<span class="row__hint"><span data-hint>Figures are visible</span></span>
</div>
<button class="sw" type="button" role="switch" aria-checked="false" aria-labelledby="hb-label" data-switch>
<span class="sw__knob" data-knob></span>
</button>
</div>
<ul class="moves" aria-label="Recent activity">
<li class="move">
<svg class="move__ic" viewBox="0 0 24 24" aria-hidden="true"><path d="M6 9h10v4.5a5 5 0 0 1-10 0Z"></path><path d="M16 10.5h1.6a2 2 0 0 1 0 4H16"></path><path d="M9 4.5c0 1 1 1.4 1 2.4M12.4 4.5c0 1 1 1.4 1 2.4"></path></svg>
<span class="move__text"><span class="move__name">Ferro Coffee</span><span class="move__when">Today, 08:12</span></span>
<span class="num num--row" data-num data-peek><span class="num__digits" data-digits>−$4.80</span><span class="num__veil" data-veil aria-hidden="true"></span></span>
</li>
<li class="move">
<svg class="move__ic" viewBox="0 0 24 24" aria-hidden="true"><rect x="3.5" y="6.5" width="17" height="11" rx="2.4"></rect><path d="M3.5 10.5h17"></path><path d="M7 14.5h3"></path></svg>
<span class="move__text"><span class="move__name">Salary, Brightwell Ltd</span><span class="move__when">Oct 27</span></span>
<span class="num num--row num--in" data-num data-peek><span class="num__digits" data-digits>+$3,200.00</span><span class="num__veil" data-veil aria-hidden="true"></span></span>
</li>
<li class="move">
<svg class="move__ic" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 11.2 12 4.8l8 6.4"></path><path d="M6.2 9.6V19h11.6V9.6"></path><path d="M10.2 19v-5h3.6v5"></path></svg>
<span class="move__text"><span class="move__name">Rent, Calder House</span><span class="move__when">Oct 25</span></span>
<span class="num num--row" data-num data-peek><span class="num__digits" data-digits>−$1,450.00</span><span class="num__veil" data-veil aria-hidden="true"></span></span>
</li>
</ul>
<p class="peek-tip"><span data-tip>Press and hold a hidden figure to peek</span></p>
</section>
<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.
34 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 “Hide balance toggle” from Animorio and fit it into my siteThe script splits every figure into its characters, each one in an inline-block span: that way GSAP can blur them and roll them back in one after another with a stagger, without touching the text.
Hiding means three things at once: a filter blur on the characters, a slight squeeze in height and a veil on top, made of a repeating-linear-gradient at 135 degrees, that widens from the left with scaleX. The figures start one after another with a delay that is a knob.
The eye is an SVG with two arcs and the iris: closing it shrinks the iris to nothing, the arcs fade and the closed arc drops into their place with a back.out, then the lashes come out.
On the pointerdown of a hidden figure a delayedCall as long as HOLD starts; if the finger stays down the figure comes back sharp, and on pointerup or pointerleave it hides again. If the finger lifts earlier, the delayedCall is cancelled and the veil settles back with a small bounce.
| Name | File | Default | What it changes |
|---|---|---|---|
BANK | script.js | Tidebank | The bank’s name at the top. |
BALANCE | script.js | $12,480.36 | The available balance. |
BLUR | script.js | 7 | How much the hidden figures blur, in pixels. |
STAGGER | script.js | 0.09 | The delay between one figure hiding and the next, in seconds. |
HOLD | script.js | 0.35 | How long to hold a hidden figure before it shows, in seconds. |
ACCENT | script.js | #2f5bea | The colour of the switch when on. |
For a banking, payments or investing app or a wallet, and for any page with numbers you do not want to show to whoever is looking at the screen: salaries, balances, private stats.
The card takes the width with a margin; the balance and the gaps are sized on the height too with clamp and vmin, and below 470 pixels of height the third transaction hides, so everything fits in the box. Press and hold with a finger works like the mouse and does not open the browser menu.
No springs or rolls: the knob goes to its place, the figures blur and come back sharp as a fade, all together, and the eye changes with a fade. The fake pointer does not start.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.5 KB; the libraries: GSAP 28 KB.
Tested on 28 October 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.