Skip to content
animorio
IT
All components

Meter reading form

Forms, HoverGSAP, CSS onlyMediumCompressed weight: Demo 5.7 KBGSAP 28 KBFreeDownload the zip

A gas meter reading form with five drums like the ones on the meter: each drum turns one step at a time and settles, changed digits turn orange, the usage since the last reading is recounted, and the button sends the reading with its arrow becoming a tick.

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>
<!--
  "Meter reading form" 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>Meter reading form</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 meter reading form: five drums like the ones on the meter, turned one step at a time;
         the usage since the last reading is worked out as they turn, and the reading is sent -->
    <form class="mr" data-mr aria-label="Gas meter reading" novalidate>
      <header class="mr__head">
        <span class="mr__title">Meter reading</span>
        <span class="mr__kind">Gas</span>
      </header>

      <div class="mr__window" data-window role="group" aria-label="Reading, five digits">
        <span class="mr__unit" aria-hidden="true">m³</span>
      </div>

      <dl class="mr__facts">
        <div><dt>Last reading</dt><dd data-last></dd></div>
        <div><dt>Used since then</dt><dd class="mr__used" aria-live="polite"><span data-used></span></dd></div>
      </dl>

      <button class="mr__send" type="submit" data-send>
        <span class="mr__label"><span data-label>Send reading</span></span>
        <svg viewBox="0 0 20 20" aria-hidden="true"><path class="mr__arrow" data-arrow d="M4 10h11M10.500 5.500 15 10l-4.500 4.500"></path><path class="mr__tick" data-tick pathLength="1" d="M4.500 10.500 8.500 14.500 15.500 6"></path></svg>
      </button>
    </form>

    <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 “Meter reading form” 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 white, a card: at the top “Meter reading” and the label “Gas”; then the meter’s dark window with five light drums, each with its large digit and shaded edges like a cylinder, and the unit m³; below, on the left the last reading with its date and on the right “Used since then”; at the bottom the dark “Send reading” button. On opening the drums arrive on their digits from a few numbers before, one after the other. Tapping a drum’s upper half takes the digit up by one, the lower half down: the drum clicks and settles with a small bounce, passes from 9 to 0 without a jump, and the changed digit turns orange. The usage counts to the new value; if the reading is lower than the last one the line says “Lower than last time” with a shake and the button goes dim. On sending, the arrow leaves, the tick is drawn, the button turns green and states the reading sent; then the drums roll back the shortest way round.

How it works

A number that never goes back

Each drum has a position that grows or falls without limits: the digit is the remainder of the division by ten. The strip has a 9 at the head and a 0 at the tail, so the passage from 9 to 0 is drawn like any other.

Drums for the keyboard

Each drum is a button with the spinbutton role and its aria-values: up and down arrows turn it, so does the wheel, and a click on the upper or lower half. No numeric keyboard to open on a phone.

Usage without a spring

The difference from the last reading counts with power2.out, which never overshoots: a billing figure does not bounce. The spring stays with the drums and the button.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#f26a1bThe colour of the changed digits and of the label.
LASTscript.js4218The last recorded reading, in cubic metres (up to 99999).
LAST_DATEscript.js12 OctThe day of the last reading.
SPINscript.js0.5How many seconds a drum takes to make one step.
HOLDscript.js1.6On its own: how many seconds it stays on the sent reading.
LOOPscript.jstrueLeft alone, a pointer turns two drums and sends the reading.

Try them in the Playground

When to use it

In the customer area of a gas, electricity or water supplier, in the app of a block of flats or a rental home; and wherever a number read off an instrument is entered: a car’s mileage, a copy counter, a serial number.

On phones

The same form: the drums are 40 pixels wide and 54 tall (46 in short windows), turned by tapping above or below the digit; below 330 pixels they get narrower.

With reduced motion

No clicks or counting: digits, usage and button change at once.

Pitfalls

  • The demo accepts any reading not lower than the last: a real supplier also checks that the usage is plausible and asks for confirmation if it is far higher than usual.
  • The drums are independent: turning the units from 9 to 0 does not move the tens, as in a form field and unlike the real meter.
  • For those who would rather type, a plain text field is needed beside the drums: there is none here, this is a demo of the gesture.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 18 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 components