
The elastic button
Buttons, Hover, Text
The weight log of a health app, in a card on black: today’s value, large, to nudge with minus and plus, and below it the week’s curve with the goal line. At every tap the number changes at once and the last point of the curve follows on a spring, pulling the line with it; at the top the change over the week rolls, its arrow turning. “Save today” pins the point, which fills in, and draws the tick.
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>
<!--
"Weight tracker" 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>Weight tracker</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 weight log: today's value nudged with minus and plus, the last point of the week's curve following on a
spring, the change over the week rolling at the top, and Save pinning the point down -->
<section class="wt" data-wt aria-label="Weight tracker">
<header class="wt__head">
<strong>Weight</strong>
<span class="wt__delta" data-delta><svg viewBox="0 0 12 12" aria-hidden="true"><path data-arrow d="M6 2.200v7.600M2.800 6.600 6 9.800l3.200-3.200"></path></svg><span class="wt__clip"><span data-outdelta>0.6 kg this week</span></span></span>
</header>
<div class="wt__set">
<button type="button" class="wt__step" data-step="-1" aria-label="A little less"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.500 8h9"></path></svg></button>
<p class="wt__now" aria-live="off"><b data-outvalue>72.8</b><i data-outunit>kg</i></p>
<button type="button" class="wt__step" data-step="1" aria-label="A little more"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.500 8h9M8 3.500v9"></path></svg></button>
</div>
<div class="wt__chart" data-chart>
<svg viewBox="0 0 300 92" aria-hidden="true" preserveAspectRatio="none">
<defs><linearGradient id="wt-fade" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="currentColor" stop-opacity="0.22"></stop><stop offset="1" stop-color="currentColor" stop-opacity="0"></stop></linearGradient></defs>
<line class="wt__goal" data-goal x1="0" y1="60" x2="300" y2="60"></line>
<path class="wt__area" data-area d=""></path>
<path class="wt__line" data-line d=""></path>
<line class="wt__guide" data-guide x1="0" y1="0" x2="0" y2="92"></line>
</svg>
<i class="wt__dot" data-dot aria-hidden="true"></i>
<span class="wt__goaltag" data-goaltag aria-hidden="true">Goal 72</span>
<span class="wt__tip" data-tip aria-hidden="true"></span>
</div>
<ol class="wt__days" aria-hidden="true"><li>Wed</li><li>Thu</li><li>Fri</li><li>Sat</li><li>Sun</li><li>Mon</li><li class="is-today">Today</li></ol>
<button type="button" class="wt__save" data-save><svg viewBox="0 0 16 16" aria-hidden="true"><path pathLength="1" d="M3.400 8.400 6.600 11.500 12.700 4.800"></path></svg><span class="wt__clip"><span data-outsave>Save today</span></span></button>
</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.
24 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 “Weight tracker” from Animorio and fit it into my siteThe number goes to its new value in an instant; the point on the curve gets there on a spring. They are two tweens on the same object, one for the written number and one for the point.
At every frame of the spring the path is rewritten: a smooth curve through the seven points, its handles taken from the neighbouring points.
The chart stretches with the card; the circle, the goal tag and the pointed value are HTML elements placed on top in percentages, so they stay round and readable.
Saving fills the circle and draws the tick; any nudge afterwards takes the button back to “Save today”.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #ff8a4c | The colour of the curve. |
TODAY | script.js | 72.8 | The weight proposed for today, the same as yesterday. |
GOAL | script.js | 72 | The goal, the dashed line. |
UNIT | script.js | kg | The unit written beside the number. |
SPRING | script.js | 1 | How much today’s point bounces when you change the value. |
LOOP | script.js | true | Left alone, the demo’s pointer lowers the value, looks at a day and saves. |
In the app of a smart scale, a nutritionist, a gym or a training programme; the same card carries any measure logged daily and watched over time: blood pressure, hours of sleep, glucose, kilometres.
The card is at most 348 pixels wide and about 320 tall; the chart gets shorter on short screens. The two round buttons are 44 pixels and can be held down; on the chart a tap shows the nearest day.
No springs and no curve drawing itself: number, point, curve and texts are at the new value at once. 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 7.2 KB; the libraries: GSAP 28 KB.
Tested on 1 December 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.