
The elastic button
Buttons, Hover, Text
A phone plan’s data card: the ring fills with the gigabytes used while the number counts, a tap flips it to what is left and the button adds more: the scale inside the ring stretches, the arc falls back and the gigabytes per day go up.
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>
<!--
"Data usage 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>Data usage 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 phone plan's data card: the ring fills with the gigabytes used, a tap on it flips to what is left,
and the button adds extra gigabytes: the ring's scale stretches and the daily allowance grows -->
<section class="du" data-du aria-label="Mobile data">
<header class="du__head">
<span class="du__title">Mobile data</span>
<span class="du__plan">Nova <span data-plan></span> GB</span>
</header>
<button class="du__ring" type="button" data-flip aria-pressed="false" aria-label="Show data left">
<svg viewBox="0 0 160 160" aria-hidden="true">
<path class="du__track" pathLength="1" d="M36.160 123.840A62 62 0 1 1 123.840 123.840"></path>
<path class="du__left" data-left pathLength="1" d="M36.160 123.840A62 62 0 1 1 123.840 123.840"></path>
<path class="du__used" data-used pathLength="1" d="M36.160 123.840A62 62 0 1 1 123.840 123.840"></path>
<g class="du__ticks" data-ticks></g>
</svg>
<span class="du__mid">
<b class="du__num"><span data-num>0.0</span><i>GB</i></b>
<span class="du__of"><span class="du__mode"><span data-mode>used</span></span> of <span data-total></span> GB</span>
</span>
</button>
<p class="du__note">Renews in <span data-days></span> days, about <b><span data-day></span> GB</b> a day</p>
<button class="du__add" type="button" data-add aria-pressed="false">
<svg viewBox="0 0 16 16" aria-hidden="true"><path data-plus-h d="M3 8h10"></path><path data-plus-v d="M8 3v10"></path><path class="du__tick" data-check pathLength="1" d="M3.500 8.400 6.600 11.300 12.500 4.900"></path></svg>
<span class="du__add-text"><span data-add-text></span></span>
</button>
</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.
26 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 “Data usage card” from Animorio and fit it into my siteTwo paths on the same arc with pathLength 1: the used one and the remaining one. A number from 0 to 1 blends their colour with color-mix and makes the figure count from the gigabytes used to those left.
The marks are rotated by gigabytes over total. When the total grows with back.out they all slide back and the new one appears at the end: you see that the room has grown, not that the usage went down.
The ring’s total bounces, but the written figures count with power2.out and a snap to the tenth: a number never passes its value.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #6d5efc | The ring’s colour. |
USED | script.js | 18.4 | The gigabytes used so far. |
PLAN | script.js | 30 | The plan’s gigabytes. |
EXTRA | script.js | 5 | The gigabytes the button adds. |
DAYS | script.js | 9 | The days left before renewal. |
WARN | script.js | 0.85 | From what share of the plan the ring turns warm (0 to 1). |
LOOP | script.js | true | Left alone, a pointer flips the ring and adds the data. |
In a carrier’s app or customer area, on the plan page of a travel eSIM, in the dashboard of a service with a monthly quota: cloud storage, minutes, credits, API calls.
The same card: the ring and the button are tapped with a thumb. The ring and the number are also sized on the window’s height.
The ring is already filled up to the gigabytes used. The tap and the button change numbers, arcs and labels without motion.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.7 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.