
The inchworm menu
Menus, Hover, Transitions
The Battery health page in the settings of Lumo One, a made-up phone: the drawn battery fills up to 87% of the capacity it had when new, the surface of the charge swaying and settling, the figure rolling, «Normal» for peak performance, the 412 charge cycles counting up, the capacity curve of the last twelve months drawing itself to today’s point. Then Optimized charging switches on with a spring and the line «Charging will pause at 80%» opens below, the stop mark sliding along the bar to 80%. On white, with a single green.
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>
<!--
"Battery health 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>Battery health 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">
<!-- the Battery health page in the settings of Lumo One, a made-up phone: the battery fills up to its
maximum capacity, the cycles count up, twelve months of capacity draw themselves, and Optimized
charging switches on and moves the stop mark to 80% -->
<section class="card" data-card aria-label="Battery health, Lumo One">
<span class="card__edge" aria-hidden="true"></span>
<header class="head">
<span class="back" aria-hidden="true">
<svg viewBox="0 0 20 20"><path d="M12.2 4.6 6.8 10l5.4 5.4"/></svg>
</span>
<div class="head__txt">
<h1 class="head__title">Battery health</h1>
<p class="head__sub">Lumo One · Settings</p>
</div>
</header>
<div class="hero">
<div class="cell" data-cell aria-hidden="true">
<span class="cell__body">
<span class="cell__fill" data-fill>
<svg class="cell__wave" data-wave viewBox="0 0 12 100" preserveAspectRatio="none"><defs><linearGradient id="carica" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#2bc184"/><stop offset=".6" stop-color="#14a36b"/><stop offset="1" stop-color="#11915f"/></linearGradient></defs><path fill="url(#carica)" data-wave-path d="M0 0 L6 0 L6 100 L0 100 Z"/></svg>
<span class="cell__shine"></span>
</span>
<span class="cell__mark" data-cap-mark></span>
</span>
<span class="cell__tip"></span>
</div>
<div class="hero__txt">
<p class="big"><span class="roll" data-roll="cap">0</span><span class="big__pct">%</span></p>
<p class="hero__lab">Maximum capacity</p>
</div>
</div>
<dl class="rows">
<div class="row">
<dt>Peak performance</dt>
<dd><span class="tag" data-tag>Normal</span></dd>
</div>
<div class="row">
<dt>Charge cycles</dt>
<dd><span class="roll" data-roll="cycles">000</span></dd>
</div>
</dl>
<figure class="trend">
<figcaption class="trend__head"><span>Capacity, last 12 months</span><span class="trend__now" data-now>Today</span></figcaption>
<svg class="trend__svg" data-trend viewBox="0 0 240 40" preserveAspectRatio="none" aria-hidden="true">
<line class="trend__base" x1="0" y1="39.5" x2="240" y2="39.5"/>
<path class="trend__area" data-area d=""/>
<path class="trend__line" data-line d="" pathLength="1"/>
</svg>
<span class="trend__pin" data-pin aria-hidden="true"><span class="trend__pin-in"></span></span>
</figure>
<div class="opt">
<div class="opt__top">
<div class="opt__txt">
<p class="opt__title">Optimized charging</p>
<p class="opt__sub">Learns your routine to slow ageing</p>
</div>
<button class="switch" type="button" role="switch" aria-checked="false" data-switch aria-label="Optimized charging">
<span class="switch__knob" data-knob></span>
</button>
</div>
<div class="limit" data-limit aria-hidden="true">
<div class="limit__in">
<p class="limit__lab">Charging will pause at <strong>80%</strong></p>
<div class="bar">
<span class="bar__track"><span class="bar__fill" data-bar-fill></span></span>
<span class="bar__stop" data-stop><span class="bar__stop-line"></span></span>
</div>
</div>
</div>
</div>
</section>
</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.
32 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 “Battery health card” from Animorio and fit it into my siteAt the right end of the fill sits a narrow SVG whose path is rebuilt every frame: a sine wave whose amplitude starts high and drops to zero in a little more than the fill time. It stops on its own, so at rest it costs nothing.
Each digit is a column from 0 to 9 in a window one line tall; the left columns roll less and land first, with a back.out taking each one a pixel past. Leading zeros are hidden, so 087 reads 87.
When the switch changes, the knob widens by a quarter before it sets off and turns round again as it lands on a spring: the gesture of real phone switches. The line that opens below grows to the measured height of its content, recalculated on resize.
| Name | File | Default | What it changes |
|---|---|---|---|
CAPACITY | script.js | 87 | The maximum capacity left, in percent of when the phone was new. |
CYCLES | script.js | 412 | The charge cycles counted so far. |
PAUSE_AT | script.js | 80 | Where Optimized charging stops the charge, in percent. |
FILL_TIME | script.js | 1.6 | Seconds the battery takes to fill up to its capacity. |
WAVE | script.js | 1 | How much the surface of the charge sways before it settles (0 = still). |
SPRING | script.js | 0.5 | How springy the switch and the stop mark are (lower = more bounce). |
DRAW_TIME | script.js | 1.3 | Seconds the twelve months of capacity take to draw. |
HOLD | script.js | 2.4 | Seconds the finished card stays before the demo starts over. |
In the settings of an app or a phone, in product pages for things with a battery (headphones, electric cars, bikes, laptops) and in device dashboards: it says at a glance how the battery is doing and what can be done to make it last.
Everything is in em and the size depends on both the width and the height of the window, so the whole card fits the phone box. The switch is big enough for a thumb.
No springs or waves: the card arrives finished, the battery at 87%, the figures in place, the curve drawn and Optimized charging already on; the switch changes without bounces.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.4 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.