
The star rating
Ratings, SVG, Hover
The body mass index calculator of a health app. Drag height and weight and the number counts to its new value while the needle moves along a four-zone arc, swinging before it settles; number and zone name take the colour of where they are. Below, the healthy weight range for that height. In centimetres and kilos, or feet and pounds.
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>
<!--
"BMI calculator" 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>BMI calculator</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 BMI calculator for a health app: drag height and weight, the needle swings along a four-zone arc,
the number counts and takes the colour of its zone; metric or imperial -->
<section class="bm" data-bm aria-label="BMI calculator">
<header class="bm__head">
<h2 class="bm__title">Body mass index</h2>
<div class="bm__units" data-units role="radiogroup" aria-label="Units">
<span class="bm__thumb" data-thumb aria-hidden="true"></span>
<button type="button" role="radio" aria-checked="true" data-unit="metric">cm · kg</button>
<button type="button" role="radio" aria-checked="false" tabindex="-1" data-unit="imperial">ft · lb</button>
</div>
</header>
<div class="bm__gauge">
<svg viewBox="0 0 240 132" aria-hidden="true">
<g data-zones></g>
<g data-marks class="bm__marks"></g>
<g data-needle><line class="bm__needle" x1="120" y1="66" x2="120" y2="36"></line></g>
</svg>
<div class="bm__read">
<output class="bm__value" data-value>22.9</output>
<span class="bm__roll bm__zone"><span data-zone>Healthy</span></span>
</div>
</div>
<label class="bm__field">
<span class="bm__name">Height</span><output class="bm__num" data-hout>175 cm</output>
<input type="range" min="140" max="205" step="1" value="175" data-h>
</label>
<label class="bm__field">
<span class="bm__name">Weight</span><output class="bm__num" data-wout>70 kg</output>
<input type="range" min="40" max="140" step="1" value="70" data-w>
</label>
<p class="bm__range" data-range aria-live="polite"></p>
</section>
<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.
23 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 “BMI calculator” from Animorio and fit it into my siteThe scale runs from 15 to 40 over 180 degrees. Each zone is an arc path worked out from its two angles, with just over a degree of gap between pieces; the boundary values are text placed on the same angle, further out.
Two tweens on the same object: the value shown arrives in a third of a second, the needle’s angle in just over a second on an elastic. The delay is what makes the needle feel like something with weight.
The rotation is written into the transform attribute with the pivot in viewBox coordinates (rotate(degrees 120 122)): on an SVG group transformOrigin would spin around the bounding box.
The two sliders always work in centimetres and kilos; feet, inches and pounds are worked out when the values are written. Changing units moves neither the sliders nor the needle.
| Name | File | Default | What it changes |
|---|---|---|---|
HEIGHT | script.js | 175 | The starting height, in centimetres. |
WEIGHT | script.js | 70 | The starting weight, in kilos. |
SWING | script.js | 1 | How much the needle swings before it stops: 0.3 = hardly, 2 = a lot. |
IMPERIAL | script.js | false | true = start in feet and pounds instead of centimetres and kilos. |
LOOP | script.js | true | Left alone, the demo’s pointer drags weight and height and switches units. |
In the app of a nutrition practice, a gym, a connected scale or a health insurer; on a doctor’s site. The same needle on a zoned arc suits any value with thresholds: blood pressure, a connection’s speed, a score.
The same card, as wide as the screen: the two sliders have a 22-pixel thumb and do not scroll the page while dragged; the arc scales in proportion and everything stays inside the preview box.
The number and the needle go straight to the new value, with no counting or swinging; zone and colours change at once. The demo does not move by itself.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.2 KB; the libraries: GSAP 28 KB.
Tested on 21 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.
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.