Skip to content
animorio
IT
All components

Savings goal button

Buttons, Hover, SVGGSAP, CSS onlyAdvancedCompressed weight: Demo 12 KBGSAP 28 KBFreeDownload the zip

The Set aside button of a bank’s savings app, a pill of smoked glass in a dark room, like a Dribbble shot. Inside the glass the savings goal for a trip to Japan is a level of mint light with a living surface. With the mouse over it a hatching shows how far this transfer will take it and the chip shows the new percent; pressed, the light flows up to the mark with its surface sloshing and settling on a spring, then the plane turns into a check and a thin anamorphic streak of light crosses the glass.

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>
<!--
  "Savings goal button" 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 set aside button with the glass that fills to the goal</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 Set aside button of a savings app, a pill of smoked glass in a dark room. Inside the glass the savings goal
         is a level of mint light with a living surface: on hover a hatched ghost shows how far this transfer takes it,
         pressed the light flows up to the new mark with its surface trembling, then the plane turns to a check and a
         thin anamorphic streak crosses the glass -->
    <div class="sv" data-wrap>
      <span class="sv__spill" data-spill aria-hidden="true"></span>
      <span class="sv__streak" data-streak-box aria-hidden="true"><span class="sv__streak-glow" data-streak-glow></span><span class="sv__streak-line" data-streak></span></span>
      <button class="sv__btn" type="button" data-btn data-autoclic aria-label="Set aside $600 for the Japan trip">
        <span class="sv__body" data-body>
          <span class="sv__glass" aria-hidden="true"></span>
          <svg class="sv__level" data-level aria-hidden="true">
            <defs>
              <linearGradient id="sv-liquid" x1="0" y1="0" x2="0" y2="1">
                <stop offset="0" style="stop-color:var(--mint)" stop-opacity="0.24"/>
                <stop offset="0.55" style="stop-color:var(--emerald)" stop-opacity="0.16"/>
                <stop offset="1" style="stop-color:var(--deep)" stop-opacity="0.42"/>
              </linearGradient>
              <linearGradient id="sv-lip" x1="0" y1="0" x2="1" y2="0">
                <stop offset="0" style="stop-color:var(--mint)" stop-opacity="0"/>
                <stop offset="1" style="stop-color:var(--mint)" stop-opacity="0.34"/>
              </linearGradient>
              <linearGradient id="sv-mark" x1="0" y1="0" x2="0" y2="1">
                <stop offset="0" style="stop-color:var(--mint)" stop-opacity="0"/>
                <stop offset="0.5" style="stop-color:var(--mint)" stop-opacity="0.95"/>
                <stop offset="1" style="stop-color:var(--mint)" stop-opacity="0"/>
              </linearGradient>
              <pattern id="sv-hatch" width="5" height="5" patternUnits="userSpaceOnUse" patternTransform="rotate(-38)">
                <rect width="1" height="5" style="fill:var(--mint)" fill-opacity="0.32"/>
              </pattern>
              <filter id="sv-soft" x="-50%" y="-10%" width="200%" height="120%"><feGaussianBlur stdDeviation="3"/></filter>
            </defs>
            <g class="sv__ghost" data-ghost>
              <rect data-ghost-rect fill="url(#sv-hatch)"/>
              <rect data-ghost-tint style="fill:var(--mint)" fill-opacity="0.05"/>
            </g>
            <path class="sv__liquid" data-liquid fill="url(#sv-liquid)"/>
            <path class="sv__lip" data-lip fill="url(#sv-lip)"/>
            <path class="sv__glow" data-glow filter="url(#sv-soft)"/>
            <path class="sv__surface" data-surface/>
            <rect class="sv__mark" data-mark width="1.6" fill="url(#sv-mark)"/>
          </svg>
          <span class="sv__shine" data-shine aria-hidden="true"></span>
          <span class="sv__edge" data-edge aria-hidden="true"></span>
          <span class="sv__rim" aria-hidden="true"></span>
          <span class="sv__row">
            <span class="sv__icon" data-icon aria-hidden="true">
              <span class="sv__icon-face" data-icon-face>
                <svg class="sv__plane" data-plane viewBox="0 0 24 24"><path d="M10.4 13.6 4.6 11.8a.8.8 0 0 1-.1-1.5l1-.5 6.6 1.2 3.9-3.9a1.9 1.9 0 0 1 2.7 2.7l-3.9 3.9 1.2 6.6-.5 1a.8.8 0 0 1-1.5-.1l-1.8-5.8-2.6 2.6.2 1.7-.9.9-1.2-2.4-2.4-1.2.9-.9 1.7.2z"/></svg>
                <svg class="sv__check" viewBox="0 0 24 24"><path data-check pathLength="1" d="M7 12.4l3.3 3.3 6.7-7"/></svg>
              </span>
            </span>
            <span class="sv__text" aria-hidden="true">
              <span class="sv__state" data-state>
                <span class="sv__title" data-t>Set aside $600</span>
                <span class="sv__sub" data-s>Japan trip · $3,100 of $5,000</span>
              </span>
              <span class="sv__state" data-state>
                <span class="sv__title sv__title--busy" data-t>Moving $600</span>
                <span class="sv__sub" data-s>From Everyday to Japan trip</span>
              </span>
              <span class="sv__state sv__state--done" data-state>
                <span class="sv__title" data-t>Saved for Japan</span>
                <span class="sv__sub" data-s>$3,700 of $5,000 · on track</span>
              </span>
            </span>
            <span class="sv__chip" aria-hidden="true">
              <span class="sv__chip-now" data-chip-now><span data-pct>62</span><span class="sv__chip-unit">%</span></span>
              <span class="sv__chip-next" data-chip-next>
                <svg viewBox="0 0 12 12"><path d="M6 9.4V2.8M3.2 5.4 6 2.6l2.8 2.8"/></svg>
                <span data-pct-next>74</span><span class="sv__chip-unit">%</span>
              </span>
            </span>
          </span>
        </span>
      </button>
    </div>
    <p class="sr" aria-live="polite" data-live></p>
  </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.

28 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 “Savings goal button” 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

In a dark room, with a mint coloured lamp behind and a very fine grain, a single pill button 60 pixels tall in smoked glass: its edge is a cool hairline that catches the light at the top and goes into shadow at the bottom, and under the button the table takes a green glow. Inside the glass, from the left, a mint light reaches 62%: it is how much you have already set aside for the trip to Japan, and its edge is the surface of a liquid with a bright line and a soft halo. On the left a glass disc with a plane drawn in a hairline, in the middle Set aside $600 with Japan trip · $3,100 of $5,000 under it, on the right a chip with 62%. With the mouse over it a soft light follows the pointer, an arc of light slides along the edge to stay on its side, the liquid’s surface trembles a little, a thin diagonal hatching appears between the level and where it will arrive, a vertical mark of light opens at 74% and in the chip 62% leaves upwards while an arrow with 74% in mint comes in; the disc rises by a pixel and the plane tilts up on a spring. Pressed, the glass sinks by a pixel and springs back, and the surface takes a small knock. The words become Moving $600, with a band of light passing through them, and From Everyday to Japan trip under them; the light flows right up to the mark while its surface leans forward and sloshes like a running liquid, swallowing the hatching, the plane climbs and the percent counts up. When it arrives the surface flashes and makes one last wave that settles on a spring, the mark stretches and fades, the disc narrows to its edge and opens again in solid mint with the check, the button swells by a hair and a thin anamorphic light, wider than the button, crosses it: Saved for Japan, $3,700 of $5,000 · on track. After a moment the light drains back to 62% for the next round. Until someone touches it, the button goes round by itself.

How it works

Glass in layers

The button is a single box (moved only by GSAP) with absolute layers: the smoked glass with a radial reflection at the top, the SVG of the level, the light under the pointer driven by two CSS variables, the edge’s arc of light (a conic-gradient cut down to the one pixel edge with mask-composite) and on top the inner shadows of the glass hairline.

A living surface

The level is an SVG path redrawn on every frame only while something moves: 17 points on a vertical line bent by two sines and a tilt. The waves’ amplitude is a damped spring pushed by the level’s speed, the tilt follows it forward while it runs; when everything stops the requestAnimationFrame loop switches off.

Light in three passes

The same outline does three things: the liquid’s fill with a top to bottom gradient, the bright line of the surface and, under it, the same line seven pixels wide with a feGaussianBlur for the halo; a fourth path, the same curve moved 22 pixels back, is the brighter lip where the light thickens.

The ghost of the next step

Between today’s level and the one after the transfer there is a rectangle filled with a pattern of one pixel lines rotated by −38 degrees, and the arrival mark is a line with a gradient that fades at its ends: GSAP opens it from the middle with attr y1 and y2 on an elastic spring.

The success

The level reaches the mark with power2.inOut, the surface flashes (width and halo) and takes a knock that makes it ring once; the disc turns with scaleX and comes back mint with the check drawn by strokeDashoffset; the anamorphic light is a 1.5 pixel line wider than the pill with a blurred halo in mix-blend-mode screen.

Values to change

NameFileDefaultWhat it changes
GOAL_NAMEscript.jsJapan tripThe name of the goal, in the line under the words.
AMOUNTscript.js600The dollars the button sets aside.
SAVEDscript.js3100The dollars already set aside.
GOALscript.js5000The goal in dollars.
WORKscript.js1.7How many seconds the light takes to flow up to the new level.
SLOSHscript.js1How much the surface sloshes: 0 still, 2 lively.
GLINTscript.js1The strength of the anamorphic streak: 0 none, 1.5 bright.
SPRINGscript.js1How springy the moves are: 0.4 calm, 2 very bouncy.
HOLDscript.js1.9How many seconds the success stays before going back to rest.
AUTOscript.jstrueThe button goes round by itself until someone touches it.

Try them in the Playground

When to use it

For a bank’s app or a savings app: setting money aside for a goal (a trip, a home, an emergency fund), making a deposit, rounding up spending. It first shows how far the transfer will go, then shows it happening and ends with a measured moment of celebration; it also suits a travel app that helps you save for the trip.

On phones

On the phone the button is at most 86% of the screen wide, the level and the mark are recomputed on the real width and the anamorphic light stays inside the screen; there is no hover, so the hatching and the new percent show while the light flows, and at the touch the light and the edge arc turn towards the finger.

With reduced motion

Nothing flows and nothing sloshes: the level dims halfway and comes back already at 74%, the words and the chip change in place with a fade, the percent counts, the plane becomes a check and the anamorphic light is only a halo that lights up and fades.

Pitfalls

  • CSS variables written in the SVG’s stop-color and fill attributes do not work: the gradients’ colours go in the style attribute, so they also follow :root.
  • Redrawing the surface on every frame forever kept the processor busy even at rest: the loop stops when amplitude, speed and tilt are under three hundredths, and starts again with a knock or a move of the level.
  • With the level in percent from the left edge the light started under the glass disc and at 100% spilled out of the rounding: the SVG is measured in pixels on resize, zero sits at the disc’s centre and everything is clipped by the pill’s clip-path.
  • The loop started when the script was read, and the poster landed on different moments: it starts from the page’s load event.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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