
The elastic button
Buttons, Hover, Text
The month’s payslip card: the bar starts whole, all gross pay, and the deductions come off it one by one while the large figure counts down to the net. Moving over a line lights its piece of the bar; the eye hides the amounts by blurring them.
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>
<!--
"Payslip 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>Payslip 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">
<!-- a payslip card: the bar starts whole, as the gross pay, and the deductions come off it one by one
while the figure counts down to the net; a row lights its slice, the eye hides the amounts -->
<section class="ps" data-ps aria-label="Payslip">
<header class="ps__head">
<span class="ps__title">Payslip</span>
<span class="ps__month">November</span>
<button class="ps__eye" type="button" data-eye aria-pressed="false" aria-label="Hide amounts">
<svg viewBox="0 0 20 20" aria-hidden="true"><path d="M2 10s3-5.500 8-5.500S18 10 18 10s-3 5.500-8 5.500S2 10 2 10Z"></path><circle cx="10" cy="10" r="2.400"></circle><path class="ps__strike" data-strike pathLength="1" d="M4 3.500 16 16.500"></path></svg>
</button>
</header>
<p class="ps__read">
<span class="ps__label"><span data-label>Gross pay</span></span>
<b class="ps__num amt" data-num></b>
</p>
<div class="ps__bar" data-bar aria-hidden="true"></div>
<div class="ps__rows" data-rows></div>
</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.
16 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 “Payslip card” from Animorio and fit it into my siteThe bar’s pieces are flex items as wide as their amount. At first they all have the green and no gap: they look like one bar. Each deduction takes its grey and a three-pixel margin that opens with back.out.
The large figure starts from the gross and on each deduction counts to what is left, with power2.out: never below the value. The wght axis drops a little with each cut and comes back up on the net.
Hidden amounts stay in the DOM with a blur filter and aria-hidden: no asterisks to recompute, and the rows’ width does not change.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #6ee7a8 | The colour of the net pay. |
GROSS | script.js | 3250 | The month’s gross pay. |
TAX | script.js | 612.3 | Income tax. |
SOCIAL | script.js | 221.8 | Social security contributions. |
PENSION | script.js | 97.5 | The pension fund. |
CURRENCY | script.js | € | The currency symbol. |
PACE | script.js | 0.75 | How many seconds between one deduction and the next. |
LOOP | script.js | true | Left alone, a pointer looks at two lines and hides the amounts. |
In a payroll or HR app, in a company’s employee area, on the site of someone selling payslip software; and wherever a total is best explained by taking away: a quote with discounts, an invoice with withholdings, a budget.
The same card: tapping a row lights its piece of the bar, tapping it again turns it off. The figure and the rows shrink with the window’s height.
No split: the bar is already divided and the figure is already the net. The eye blurs the amounts with a fade.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.4 KB; the libraries: GSAP 28 KB.
Tested on 18 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.