Skip to content
animorio
IT
Back to the library

Tyre pressure

SVG, HoverGSAP, CSS onlyMediumCompressed weight: Demo 6.3 KBGSAP 28 KBFreeDownload the zip

The tyre pressure screen of a car app: the car drawn from above in thin lines, a reading beside each wheel. The low one is amber, wider because it is soft, and pulses; tap it while inflating and the number climbs, the tyre regains its shape and everything turns green. A selector rolls the values from bar to psi.

The code

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>
<!--
  "Tyre pressure" 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>Tyre pressure</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 tyre pressure screen of a car app: the car drawn from above, a reading beside each tyre,
         the low one flattened and pulsing; while it is inflated the reading climbs and the tyre fills out -->
    <section class="tp" data-tp aria-labelledby="tp-title">
      <header class="tp__head">
        <div class="tp__titles">
          <h1 id="tp-title">Tyre pressure</h1>
          <p class="tp__state"><span data-state>1 tyre low</span></p>
        </div>
        <div class="tp__units" role="group" aria-label="Unit">
          <span class="tp__thumb" data-thumb aria-hidden="true"></span>
          <button type="button" aria-pressed="true" data-unit="bar">bar</button>
          <button type="button" aria-pressed="false" data-unit="psi">psi</button>
        </div>
      </header>
      <div class="tp__arena" data-arena>
        <svg class="tp__car" viewBox="0 0 140 200" aria-hidden="true">
          <g data-tyre="fl"><circle class="tp__ring" data-ring cx="30.500" cy="51" r="12"></circle><rect class="tp__tyre" data-rubber x="24" y="36" width="13" height="30" rx="5"></rect></g>
          <g data-tyre="fr"><circle class="tp__ring" data-ring cx="109.500" cy="51" r="12"></circle><rect class="tp__tyre" data-rubber x="103" y="36" width="13" height="30" rx="5"></rect></g>
          <g data-tyre="rl"><circle class="tp__ring" data-ring cx="30.500" cy="147" r="12"></circle><rect class="tp__tyre" data-rubber x="24" y="132" width="13" height="30" rx="5"></rect></g>
          <g data-tyre="rr"><circle class="tp__ring" data-ring cx="109.500" cy="147" r="12"></circle><rect class="tp__tyre" data-rubber x="103" y="132" width="13" height="30" rx="5"></rect></g>
          <path class="tp__body" d="M52 14h36c10 0 18 8 18 20v132c0 12-8 20-18 20H52c-10 0-18-8-18-20V34c0-12 8-20 18-20Z"></path>
          <path class="tp__glass" d="M44 62c8-7 44-7 52 0l-5 22H49Z"></path>
          <path class="tp__glass" d="M49 142h42l4 15c-8 6-42 6-50 0Z"></path>
          <path class="tp__line" d="M49 84v58M91 84v58M60 22h20M62 178h16"></path>
          <rect class="tp__body" x="27.500" y="70" width="6.500" height="10" rx="2.500"></rect>
          <rect class="tp__body" x="106" y="70" width="6.500" height="10" rx="2.500"></rect>
        </svg>
        <button class="tp__read tp__read--l tp__read--f" type="button" data-read="fl" aria-label="Front left"><b><span data-val>0</span></b><i>Front left</i></button>
        <button class="tp__read tp__read--r tp__read--f" type="button" data-read="fr" aria-label="Front right"><b><span data-val>0</span></b><i>Front right</i></button>
        <button class="tp__read tp__read--l tp__read--b" type="button" data-read="rl" aria-label="Rear left"><b><span data-val>0</span></b><i>Rear left</i></button>
        <button class="tp__read tp__read--r tp__read--b" type="button" data-read="rr" aria-label="Rear right"><b><span data-val>0</span></b><i>Rear right</i></button>
      </div>
      <p class="tp__note"><span data-note>Tap the low tyre while you inflate it</span></p>
      <span class="tp__say" data-say aria-live="polite"></span>
    </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>

Playground

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.

27 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

Or ask your AI assistant for it

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 “Tyre pressure” from Animorio and fit it into my site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On near black, a dark panel: at the top “Tyre pressure” with “1 tyre low” in amber under it, and on the right the “bar | psi” selector. In the middle a car seen from above, drawn in lines (body, windscreen, rear window, mirrors), with the four tyres showing at the sides; beside each one its large reading and name, “Front left”, “Rear right”. At the opening the numbers climb to their value. Three tyres are green at 2.4 and 2.5; the rear left reads 1.8 in amber, is drawn wider, squashed, and sends out a widening ring. Move over a reading and it lights up while the line at the bottom gives temperature and recommended pressure. Tap the low tyre and the line becomes “Inflating rear left…”, the number climbs slowly to 2.4, the tyre narrows back into shape, amber makes way for green with one last ring and “All tyres good” appears at the top. Switch to psi and the selector’s thumb slides with a bounce while the four numbers roll to 35 and 36.

How it works

Everything from the pressure

Each tyre has one number, its pressure in bar: a single function writes the reading, decides whether it is low (under 86% of the recommended) and draws its width.

The soft tyre

The rectangle’s width grows with how much is missing from the right pressure, written into the SVG’s x and width attributes: no transform, no pivots to get wrong.

Inflating

A tween takes the pressure to the recommended value in INFLATE seconds; every frame is redrawn, and when it crosses the threshold the colour changes by itself.

Bar and psi

The conversion factor is a number animated from 1 to 14.5: the values roll through the conversion instead of jumping.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#39d6a4The colour of the tyres that are fine.
LOWscript.js#f6ae3dThe colour of the low tyre.
TARGETscript.js2.4The recommended pressure, in bar.
FLATscript.js1.8What the low tyre reads at the start, in bar.
INFLATEscript.js2.6In how many seconds the low tyre gets back to the right value.
SPRINGscript.js1How much the readings and the unit selector bounce: 0.3 = a little, 2 = a lot.
LOOPscript.jstrueLeft alone, the demo’s pointer looks at a tyre, inflates the low one and switches unit.

Try them in the Playground

When to use it

In the app of a car, a rental, a fleet or a garage; in an electric car’s dashboard; on the site of a tyre fitter or of a pressure sensor, to show what you see.

On phones

The same panel, 300 pixels wide at most: the car is half a screen tall at most and the readings stay at its sides; in place of the hover, a tap on a tyre that is fine shows its details.

With reduced motion

No pulsing rings and no slowly climbing numbers: the readings are at their value at once, the inflated tyre changes in one step and the unit selector snaps. The demo does not move by itself.

Pitfalls

  • Pressures and temperatures are made up and the demo inflates by itself: in a real app the reading comes from the car’s sensors, often a few minutes late.
  • The recommended pressure changes from car to car and between front and rear: here there is only one, for simplicity.
  • The low tyre is not told by colour alone: it is wider, it pulses, and the top line says how many are low.
  • The readings are real buttons, for the keyboard; the tyre rectangles in the SVG repeat the same click for pointer users.
  • Values in psi are rounded to whole numbers, in bar to one decimal: the format follows the chosen unit even while the numbers roll.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 6.3 KB; the libraries: GSAP 28 KB.

Testing

Tested on 23 November 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

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.

All animations