Skip to content
animorio
IT
Back to the library

Driving lesson hours

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

The learner’s page of a driving school: a steering wheel inside the ring of the hours driven, the large number next to it and the manoeuvres to tick below. Ticking one, the wheel takes the bend and comes back on a loose spring, the hours count, the ring advances; at the required hours the tag says you are ready for the test.

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>
<!--
  "Driving lesson hours" 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>Driving school hours with the ring around the steering wheel that fills and the manoeuvres that get ticked</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 learner's page of a driving school: a steering wheel inside the ring of the hours driven; ticking a
         manoeuvre turns the wheel, adds its hours and moves the ring, until the learner is ready for the test -->
    <section class="drv" data-drv aria-label="Driving hours">
      <div class="drv__top">
        <svg class="wheel" viewBox="0 0 120 120" aria-hidden="true">
          <defs>
            <linearGradient id="drv-rim" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#4a4d55"></stop><stop offset="1" stop-color="#24262b"></stop></linearGradient>
          </defs>
          <circle class="wheel__track" cx="60" cy="60" r="55"></circle>
          <circle class="wheel__ring" data-ring cx="60" cy="60" r="55" pathLength="1" transform="rotate(-90 60 60)"></circle>
          <g transform="translate(60 60)"><g data-wheel>
            <circle class="wheel__rim" cx="0" cy="0" r="39"></circle>
            <circle class="wheel__rim-hi" cx="0" cy="0" r="43.500"></circle>
            <path class="wheel__spokes" d="M-38 0h26M12 0h26M0 12v26"></path>
            <circle class="wheel__hub" cx="0" cy="0" r="13"></circle>
            <rect class="wheel__mark" x="-2.500" y="-44.500" width="5" height="10" rx="2.500"></rect>
            <path class="wheel__logo" d="M-4.500 2.500l4.500-6 4.500 6"></path>
          </g></g>
        </svg>
        <div class="drv__say">
          <span class="drv__school">Kerb Driving School</span>
          <span class="drv__hours"><b data-hours>14</b><i>of <span data-goal>20</span> h</i></span>
          <span class="drv__tag" data-tag><span data-tagtext>6 hours to go</span></span>
        </div>
      </div>

      <div class="drv__rows" data-rows></div>
      <p class="sr" data-live aria-live="polite"></p>
    </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>

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.

18 values to change

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 “Driving lesson hours” 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 black, a dark card: on the left a three-spoke steering wheel with a yellow mark at the top, inside a yellow ring that says the hours done; on the right the school’s name, a large “14” with “of 20 h” and a tag “6 hours to go”; below, four manoeuvres with box, name and hours. On opening the wheel arrives turning and settles, ring and number rise from zero. Hovering a manoeuvre, the wheel leans nine degrees its way. Ticking it, the box fills with yellow and the tick draws itself, the wheel turns 120 degrees with a quick hand and comes back sliding through the fingers, the number counts and the ring advances. With every manoeuvre done the ring closes and the tag turns yellow: “Ready for the test”. Unticking one takes everything back, with the wheel turning the other way.

How it works

The wheel

An SVG group drawn around zero, inside a group that moves it to the centre, with its rotation written into the transform attribute from an animated number: it goes to TURN degrees in 0.42 seconds with power2.out and back to zero in 1.1 with elastic.out(1, 0.55). The side alternates by row, and unticking turns it the other way. The yellow mark on the rim makes the rotation readable.

One number for the hours

An object with the hours shown: the large number and the ring’s stroke-dashoffset (pathLength 1) come from it, with power2.out. No spring: hours never overshoot.

The rows

Each manoeuvre is a button with aria-pressed; the tick draws itself in 0.34 seconds and the box bounces from 0.8. The tag rolls only if its text changes.

Values to change

NameFileDefaultWhat it changes
DRIVENscript.js14The hours already driven at the start.
GOALscript.js20The hours to do before the test.
TURNscript.js120By how many degrees the wheel turns when a manoeuvre is ticked.
ACCENTscript.js#ffc53dThe colour of the hours done.
PAUSEscript.js1.9Alone: how many seconds between one manoeuvre and the next.
LOOPscript.jstrueLeft alone, a pointer ticks the manoeuvres left.

Try them in the Playground

When to use it

On the site or in the learner area of a driving school, in a driving lessons app, in any path counted in hours with stages to tick (licences, practical courses, internships).

On phones

The same card, as wide as the screen; the wheel never exceeds 30% of the height, the number drops to 38 pixels below 350 of width and the rows to 38 in short windows.

With reduced motion

The wheel stays still, the tick appears, the number and the ring are at their value at once and the tag changes without rolling.

Pitfalls

  • While the wheel is turning for a tick the hover lean is suspended: the two motions on the same group would stop each other.
  • autoRound is off at the top of the script: with pathLength 1 the ring would be all full or all empty.
  • The ring at zero hours has opacity 0: a zero-length stroke with a round cap would leave a dot.

Libraries

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.

Testing

Tested on 16 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