Skip to content
animorio
IT
All components

Payslip card

Cards, HoverGSAP, CSS onlyMediumCompressed weight: Demo 5.4 KBGSAP 28 KBFreeDownload the zip

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.

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>
<!--
  "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>

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.

16 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 “Payslip card” 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

On black, a very dark green card: at the top “Payslip”, the month and an eye; below, the label “Gross pay” and the large amount, then a whole green bar. After a moment the bar breaks: the income tax piece takes a grey, comes away from the rest with a small snap and its row comes in below, while the large figure counts down; then social security, then pension, the figure a little lighter each time. At the end the label rolls to “Net pay”, the figure regains weight, the green net piece jolts and the last row arrives, in bold. Moving over a row, its piece of the bar stays lit and jolts, the others dim. The eye at the top blurs all the amounts and is struck through; pressed again it brings them back into focus.

How it works

The bar in proportion

The 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 figure going down

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, not replaced

Hidden amounts stay in the DOM with a blur filter and aria-hidden: no asterisks to recompute, and the rows’ width does not change.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#6ee7a8The colour of the net pay.
GROSSscript.js3250The month’s gross pay.
TAXscript.js612.3Income tax.
SOCIALscript.js221.8Social security contributions.
PENSIONscript.js97.5The pension fund.
CURRENCYscript.js€The currency symbol.
PACEscript.js0.75How many seconds between one deduction and the next.
LOOPscript.jstrueLeft alone, a pointer looks at two lines and hides the amounts.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

No split: the bar is already divided and the figure is already the net. The eye blurs the amounts with a fade.

Pitfalls

  • Amounts and lines are made up and simplified: a real payslip has many more lines, different from country to country, and the numbers come from the payroll system.
  • The rows are buttons: they also light up on keyboard focus, and the bar’s piece is not told by colour alone, the name is in the row.
  • The blur hides from whoever is looking at the screen, it does not protect the data: the amounts are still in the page.

Libraries

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.

Testing

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