Skip to content
animorio
IT
Back to the library

Budget envelopes

Hover, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 5.8 KBGSAP 28 KBFreeDownload the zip

The envelope budget of a household money app, in a card on warm white: at the top what is left to assign, below it three envelopes, Groceries, Transport and Fun, each with what is inside and a green band as wide as its share. One tap on an envelope moves 40 dollars into it: a green chip leaves the big number and flies into the envelope, the band grows with a bounce, the counts roll. The envelope that reaches its goal closes its flap and says “Funded”; at zero, the top reads “Every dollar has a job”. Minimal style.

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>
<!--
  "Budget envelopes" 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>Budget envelopes</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">
    <!-- envelope budgeting: the money still to assign at the top and three envelopes; one tap moves a share into
         an envelope with a chip flying down, the bar growing and the full envelope closing -->
    <section class="be" data-be aria-label="Budget envelopes">
      <header class="be__head">
        <div class="be__what"><span class="be__label"><span class="be__clip"><span data-outlabel>Left to assign</span></span></span><strong class="be__big" data-big><b data-outleft>$200</b></strong></div>
        <span class="be__month">December</span>
        <span class="be__chip" data-chip aria-hidden="true">$40</span>
      </header>

      <ul class="be__list">
        <li><button type="button" class="be__env" data-env data-name="Groceries" data-have="260" data-goal="400"><i class="be__fill" data-fill></i><svg class="be__ic" viewBox="0 0 28 22" aria-hidden="true"><rect class="be__paper" x="1.500" y="3" width="25" height="17.500" rx="3.500"></rect><path class="be__flap" data-flap d="M2.500 4.500 14 13 25.500 4.500"></path></svg><span class="be__name"><strong>Groceries</strong><span class="be__clip"><span data-outof>$260 of $400</span></span></span><span class="be__more"><span class="be__clip be__clip--more"><span data-outmore>Add $40</span></span></span></button></li>
        <li><button type="button" class="be__env" data-env data-name="Transport" data-have="60" data-goal="100"><i class="be__fill" data-fill></i><svg class="be__ic" viewBox="0 0 28 22" aria-hidden="true"><rect class="be__paper" x="1.500" y="3" width="25" height="17.500" rx="3.500"></rect><path class="be__flap" data-flap d="M2.500 4.500 14 13 25.500 4.500"></path></svg><span class="be__name"><strong>Transport</strong><span class="be__clip"><span data-outof>$60 of $100</span></span></span><span class="be__more"><span class="be__clip be__clip--more"><span data-outmore>Add $40</span></span></span></button></li>
        <li><button type="button" class="be__env" data-env data-name="Fun" data-have="20" data-goal="60"><i class="be__fill" data-fill></i><svg class="be__ic" viewBox="0 0 28 22" aria-hidden="true"><rect class="be__paper" x="1.500" y="3" width="25" height="17.500" rx="3.500"></rect><path class="be__flap" data-flap d="M2.500 4.500 14 13 25.500 4.500"></path></svg><span class="be__name"><strong>Fun</strong><span class="be__clip"><span data-outof>$20 of $60</span></span></span><span class="be__more"><span class="be__clip be__clip--more"><span data-outmore>Add $40</span></span></span></button></li>
      </ul>
      <p class="be__foot"><span class="be__clip"><span data-outfoot>Tap an envelope to move $40 into it</span></span><button type="button" class="be__undo" data-undo disabled>Undo</button></p>
    </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>

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.

24 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Budget envelopes” 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 warm white, a rounded card: at the top left “Left to assign” and under it, large, “$200”; on the right the pill “December”. Then three rounded pale grey rows, one per envelope: a small drawn envelope with its flap open, the name (“Groceries”), “$260 of $400” and on the right the white pill “Add $40”. Behind each row a pale green band is as wide as the share already inside. At the bottom: “Tap an envelope to move $40 into it” and the “Undo” key, off. Tapping an envelope, a green “$40” chip appears on the big number, flies down to the envelope tilting and vanishes into it; the little envelope gives a small start, the band stretches with a bounce, “$260 of $400” rolls to “$300 of $400” and at the top the number counts down to “$160”. When an envelope reaches its goal the flap closes like a lid, the edge and the envelope turn green and the pill says “Funded”. When nothing is left the big number turns green, the label above rolls to “Every dollar has a job” and the envelopes that are not full dim. “Undo” takes back the last move, and the envelope that was full opens again.

How it works

Four numbers

What is left to assign and what is in each envelope, with its goal. A tap moves the smallest of the step, what is left and the room in the envelope.

The chip flies between two measured points

On the tap the big number and the row’s little envelope are measured: the chip goes from one to the other, straight sideways and with a run-up vertically, then fades.

The flap is the same line

Open and shut are the same path with the same points in different places: GSAP moves the attribute’s numbers, with no shape plugin.

The list of moves

Every move goes into a list: “Undo” removes the last one and puts the money back, so you can go back all the way to the start.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#1c8f62The colour of assigned money: the band, the chip, the full envelope.
LEFTscript.js200How many dollars are left to assign at the start.
STEPscript.js40How many dollars one tap moves.
LOOPscript.jstrueLeft alone, the demo’s pointer fills the envelopes until nothing is left.

Try them in the Playground

When to use it

In a household or couple’s budgeting app, on the page explaining the envelope method, in an account with savings pots or a tool for small associations; the same gesture carries hours to split between projects, points to spend in a game, places to assign to shifts or an ad budget between campaigns.

On phones

The card is at most 348 pixels wide and about 325 tall. Each envelope is a row 54 pixels tall, all of it tappable; under 350 pixels the gaps narrow and the big number goes down to 34 pixels.

With reduced motion

No flying chip or bounces: band, counts and the big number change in one step, and the flap is already shut when the envelope is full. The demo’s pointer does not start.

Pitfalls

  • A full envelope is not told by green alone: the pill writes “Funded”, the row’s label says it to screen readers and every move is announced with what is left.
  • The last tap can move less than the step: if 20 dollars are left or only 20 fit in the envelope, the pill says so beforehand (“Add $20”).
  • The chip’s position is written by GSAP with no `transform` in the CSS: otherwise the two add up and it lands somewhere else.
  • A full envelope, or one with no money left to assign, is a disabled button, but “Undo” always stays reachable to reopen it.
  • Envelope names and figures are invented.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 5.8 KB; the libraries: GSAP 28 KB.

Testing

Tested on 2 December 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 animations