
Tiles that rise
SVG, Hover, Physics
A car trip’s fuel use on a dark card: an arc gauge with a scale from 3 to 12 litres per hundred kilometres, the needle, the teal arc following it and the figure below. Hovering “Town”, “Country” or “Motorway” sends the needle towards that leg’s fuel use on a real spring: it overshoots, comes back, swings and settles, and the figure reads the needle at every instant; below, kilometres, litres and cost roll.
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>
<!--
"Trip fuel gauge" 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>Trip fuel gauge</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 fuel use of a car trip on an arc gauge: a needle on a real spring that swings and settles
between town, country roads and motorway, with the litres and the cost rolling -->
<article class="fg" data-fg aria-label="Trip fuel use">
<header class="fg__head"><strong>Lisbon to Sagres</strong><span>312 km · Saturday</span></header>
<div class="fg__dial">
<svg data-svg viewBox="0 0 240 136" aria-hidden="true">
<path class="fg__track" data-track></path>
<path class="fg__fill" data-fill></path>
<g class="fg__ticks" data-ticks></g>
<line class="fg__needle" data-needle x1="120" y1="112" x2="120" y2="58"></line>
<circle class="fg__hub" cx="120" cy="112" r="7"></circle>
</svg>
<div class="fg__read"><strong data-outnow>6.5</strong><span>L/100 km</span></div>
</div>
<div class="fg__tabs" role="tablist" aria-label="Part of the trip" data-tabs>
<i class="fg__pill" data-pill aria-hidden="true"></i>
<button type="button" role="tab" data-leg="trip" aria-selected="true">Whole trip</button>
<button type="button" role="tab" data-leg="town" aria-selected="false" tabindex="-1">Town</button>
<button type="button" role="tab" data-leg="country" aria-selected="false" tabindex="-1">Country</button>
<button type="button" role="tab" data-leg="motorway" aria-selected="false" tabindex="-1">Motorway</button>
</div>
<footer class="fg__foot"><span data-outnote>312 km · 20.2 L of fuel · $36.39</span></footer>
</article>
<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.
20 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 “Trip fuel gauge” from Animorio and fit it into my siteThe needle is not a tween: it has a position and a velocity. On every frame one force pulls it towards the target in proportion to the distance (STIFF) and another slows it in proportion to its speed (DAMP). The overshoot and the settling come from that, with no drawn curves.
The time between two frames is capped at a thirtieth of a second and split into four steps: that way the spring does not blow up if the tab stalled for a moment. When position and velocity are almost zero the loop turns off and nothing is redrawn.
A value becomes an angle on the scale’s two hundred degrees, and the angle a point on the circle: from it come the needle’s tip, the end of the teal arc (a path with the A command rewritten every time) and the ticks, written by the script.
The number under the gauge has no animation of its own: it writes the needle’s position on every frame. That is why it goes past the value and then comes back, as on a real instrument.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #35d0ba | The colour of the fuel-use arc. |
STIFF | script.js | 90 | How stiff the needle’s spring is: higher means quicker. |
DAMP | script.js | 7 | How much it is damped: lower means more swings before it stops. |
PRICE | script.js | 1.8 | The price of a litre of fuel. |
HOLD | script.js | 2.4 | How many seconds the demo’s pointer stays on each leg. |
LOOP | script.js | true | Left alone, the demo’s pointer goes over the legs of the trip. |
In the trip summary of a car, rental or navigation app, where a single number (fuel use) changes with the leg; the same gauge with its spring needle carries a connection’s speed, a server’s load, heart rate during a workout or a product’s average rating by category.
The card is at most 340 pixels wide and about 345 tall; the gauge is sized on the screen’s height too, so in a phone’s box it shrinks instead of spilling out. With a finger the legs are tapped.
No spring: the needle, the arc and the figure are at the chosen leg’s value at once, the pill is already in place and the bottom line changes without rolling. 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 5.8 KB; the libraries: GSAP 28 KB.
Tested on 29 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.