
The elastic button
Buttons, Hover, Text
The charging card of an electric car app, with a single gesture: the battery fills while a thin light runs through the charge, and dragging the limit on the battery recalculates the time left, in steps of five per cent; above eighty per cent the charger slows down. Stop pauses, Resume picks it up again, and at the limit the card says Complete with a drawn 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>
<!--
"EV charging 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>The electric car charging card with the limit you drag</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">
<!-- one gesture: drag. The charging card of an EV app: the battery fills while a thin light runs through the
charge; dragging the limit on the battery recalculates the time left, the power tapers above 80 per cent,
Stop pauses the session and Resume picks it up again; at the limit the card says Complete -->
<section class="card" data-card aria-label="Charging, Volta Charge">
<header class="card__head">
<span class="card__mark" aria-hidden="true">
<svg viewBox="0 0 20 20"><path d="M7 2.8v3.4M13 2.8v3.4M5 6.2h10v2.6a5 5 0 0 1-10 0Z"></path><path d="M10 13.8v3.4"></path></svg>
</span>
<span class="card__who">
<span class="card__name">Volta Charge</span>
<span class="card__place">Bay 3, Harbour Street</span>
</span>
<span class="card__badge" data-badge><span>Charging</span></span>
</header>
<div class="readout">
<span class="readout__level"><span class="readout__num" data-level aria-live="polite"><span>42</span></span><span class="readout__pc">%</span></span>
<span class="readout__side">
<span class="readout__label" data-eta-label><span>Full to 80% in</span></span>
<span class="readout__eta" data-eta><span>34 min</span></span>
</span>
</div>
<div class="batt" data-batt>
<div class="batt__body" data-body>
<span class="batt__beyond" data-beyond aria-hidden="true"></span>
<span class="batt__fill" data-fill>
<span class="batt__flow" data-flow aria-hidden="true"></span>
<span class="batt__edge" data-edge aria-hidden="true"></span>
</span>
<span class="batt__ticks" data-ticks aria-hidden="true"></span>
<span class="limit" data-limit role="slider" tabindex="0" aria-label="Charge limit" aria-valuemin="50" aria-valuemax="100" aria-valuenow="80" aria-valuetext="80 per cent">
<span class="limit__bar"></span>
<span class="limit__tag" data-tag><span>80%</span></span>
</span>
</div>
<span class="batt__cap" aria-hidden="true"></span>
</div>
<div class="scale" aria-hidden="true"><span>0</span><span>50</span><span>100</span></div>
<dl class="stats">
<div><dt>Power</dt><dd data-power><span>50 kW</span></dd></div>
<div><dt>Added</dt><dd data-added>0.0 kWh</dd></div>
<div><dt>Cost</dt><dd data-cost>€0.00</dd></div>
</dl>
<button class="cta" type="button" data-cta>
<span class="cta__sweep" data-sweep aria-hidden="true"></span>
<span class="cta__label" data-cta-label><span>Stop charging</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.
36 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 “EV charging card” from Animorio and fit it into my siteThe charge rises in a gsap.ticker, using the time between frames: at full pace below eighty per cent, at half pace above, like a real charger slowing down to keep the battery cool. The big number changes only when a whole point is crossed.
The time is added up for every point between the charge and the limit: three quarters of a kWh divided by that point’s power, 50 kW or 22 kW. So lowering the limit below eighty takes off a few minutes, raising it above adds many.
Under the finger the limit is continuous and follows with no steps; the tag, the time and the state change only in steps of five per cent, and on release the limit goes to the nearest step with elastic.out.
Charge, tag, time, power, label and button are windows one line high: the old text leaves and only then does the new one come in with back.out; two texts never share a place.
Charging, Paused and Complete change the tag, the button, the light in the battery and the power together; at the limit the charge stops by itself, and a higher limit starts it again without touching the button.
| Name | File | Default | What it changes |
|---|---|---|---|
START | script.js | 42 | The charge the battery starts from, in per cent. |
LIMIT | script.js | 80 | The starting charge limit, in per cent. |
SPEED | script.js | 3 | How many points of charge it gains per second in the demo; above eighty per cent it goes at half. |
PRICE | script.js | 0.42 | How much a kWh costs, in euros. |
SNAP | script.js | 0.55 | How long the limit’s spring lasts when you let go, in seconds. |
SPRING | script.js | 0.5 | How much the limit bounces into place (lower bounces more). |
ACCENT | script.js | #16b46c | The colour of the charge, the tag and Resume. |
In the app of an electric car, a charging network or a home wallbox; with other words, for anything that fills up to a limit you choose: a hot water tank, a savings goal, a backup disk.
The same card at the width of the screen, with a shorter battery on short screens; a finger drags the limit on the battery, which doesn’t scroll the page.
No springs, sweeps or running light: the limit goes straight to its place, the texts change with a fade and the charge rises without animation. The drawn pointer does not run.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 8.5 KB; the libraries: GSAP 28 KB.
Tested on 30 October 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.