
The elastic button
Buttons, Hover, Text
An income tax calculator on a white card: take-home pay in large green digits, the income slider to drag and three bands, 0, 20 and 40 percent, each with its own bar. Raising the income fills the bars one after the other, green first, then yellow, then red, and take-home, each band’s tax, the total and the overall rate change at every step.
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>
<!--
"Tax calculator" 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>Tax calculator</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">
<!-- an income tax calculator: the income to drag, the three bands filling one after the other, and
take-home pay, tax and overall rate rolling -->
<section class="tx" data-tx aria-label="Income tax calculator">
<header class="tx__head"><strong>Take-home pay</strong><span>Yearly · sample rates</span></header>
<div class="tx__sum"><strong data-outnet>$49,600</strong><span>from <b data-outgross>$62,000</b></span></div>
<div class="tx__slide" data-track>
<i class="tx__rail" aria-hidden="true"><i class="tx__done" data-done></i></i>
<button type="button" class="tx__knob" data-knob role="slider" aria-label="Yearly income" aria-valuemin="20000" aria-valuemax="160000" aria-valuenow="62000"><i></i></button>
</div>
<ul class="tx__bands">
<li data-band="0"><span class="tx__rate">0%</span><span class="tx__bar"><i data-fill></i></span><span class="tx__lab">first $12,000</span><b data-outtax>$0</b></li>
<li data-band="1"><span class="tx__rate">20%</span><span class="tx__bar"><i data-fill></i></span><span class="tx__lab">up to $50,000</span><b data-outtax>$7,600</b></li>
<li data-band="2"><span class="tx__rate">40%</span><span class="tx__bar"><i data-fill></i></span><span class="tx__lab">above $50,000</span><b data-outtax>$4,800</b></li>
</ul>
<footer class="tx__foot"><span>Tax <b data-outall>$12,400</b></span><span class="tx__eff"><span data-outeff>20.0% of your income</span></span></footer>
</section>
<span class="live" aria-live="polite" data-live></span>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></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.
28 values to change
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
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 “Tax calculator” from Animorio and fit it into my siteFor every band you take the part of income that falls between its start and its end: that slice, times the rate, is its tax, and the slice divided by the band’s width is how full its bar is. That is why the bars fill in a row, on their own.
The state is the income. Dragging, tapping the rail, using the keyboard or the pilot change that number; everything else (take-home, three taxes, total, overall rate, knob position) is recomputed and rewritten.
The knob captures the pointer: the finger’s position on the rail becomes an income rounded to the thousand. The touch area is 44 pixels even though the knob shows 22.
When the income crosses a threshold a class changes on the row: the rate turns black and gives a small jump, once, not at every step.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #0e9f6e | The colour of the take-home and of the tax-free band. |
INCOME | script.js | 62000 | The yearly income it starts from. |
TOP | script.js | 160000 | The slider’s highest income. |
SPRING | script.js | 1 | How much the knob bounces when you let go. |
LOOP | script.js | true | Left alone, the demo’s pointer drags the income and then starts again. |
On the site of an accountant, a payroll app or a service for the self-employed, where you need to show that the highest rate applies only to the part of income above the threshold; the same banded calculator carries usage-based pricing, volume fees, a quantity discount or a plan’s price growing in tiers.
The card is at most 344 pixels wide and about 330 tall, and narrows with the screen; below 350 pixels the take-home gets smaller. The knob has a 44-pixel touch area and the slider does not scroll the page while you drag.
The slider works the same and the numbers change at every step; on entering the income is already in place, tapping the rail puts the knob there at once, with no glide, and there are no bounces or jumps. The demo’s pointer does not start.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.7 KB; the libraries: GSAP 28 KB.
Tested on 29 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.
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.