Skip to content
animorio
IT
Back to the library

Daily steps tracker

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

The day’s steps on a dark card: a marker walks along a winding road towards the goal, with its small bob, the part done lights up and the milestones stand up as it passes them. Below, a bar for each hour: scrubbing them takes the marker back to where the day had got by that hour, with the figure following.

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>
<!--
  "Daily steps tracker" 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>Daily step counter</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 day's steps: a marker walks along a road towards the goal, the milestones stand up as it
         passes them, and the hours below can be scrubbed to see how far the day had got -->
    <section class="st" data-st aria-label="Steps today">
      <header class="st__head">
        <span class="st__title">Steps</span>
        <span class="st__when"><span data-when>Now</span></span>
      </header>

      <p class="st__read" aria-live="polite">
        <b class="st__num" data-num>0</b>
        <span class="st__goal">of <span data-goal></span></span>
      </p>

      <svg class="st__road" data-road viewBox="0 0 300 64" aria-hidden="true">
        <path class="road__bed" data-bed d="M10 44C44 44 52 22 86 22s42 26 76 26 40-22 74-22 28 10 54 10"></path>
        <path class="road__done" data-done pathLength="1" d="M10 44C44 44 52 22 86 22s42 26 76 26 40-22 74-22 28 10 54 10"></path>
        <g data-flags></g>
        <g data-walker><circle class="walk__halo" r="9"></circle><circle class="walk__core" r="4.500"></circle></g>
      </svg>

      <div class="st__hours" data-hours role="group" aria-label="Steps by hour"></div>
      <p class="st__foot"><span data-foot></span></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.

16 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 “Daily steps tracker” 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 midnight blue card: at the top “Steps” and a pill saying “Now”; below, the large step figure in lime green and “of 10,000”; then a softly curving dashed road with four milestones marked by a small pole (2.5k, 5k, 7.5k, Goal) and a round marker; below again a row of bars, one per hour, and at the bottom kilometres and calories. On opening the bars grow in a fan, then the marker sets off from zero and walks along the road bobbing like a step: the road done lights up behind it, the figure counts and gets heavier, and each milestone passed stands up on a spring and changes colour. Moving over the hour bars takes the marker back to where the day had got by that hour: the bars up to there stay lit, the pill says “By 13:00”, the milestones not yet reached go dim. On leaving, the marker walks the road again up to now.

How it works

One number, the steps shown

Everything comes from the steps shown: the fraction of the goal gives the lit road’s stroke-dashoffset, the point on the path with getPointAtLength, the figure’s weight and the milestones passed.

The bob of a step

The marker rises on a sine computed on the road covered, not on time: it bobs only while moving, and a second variable damps it to a stop when the figure arrives.

The hours as a scrubber

The bars are the day’s running total: the hour under the pointer gives the steps done up to there, and the marker goes there with a tween that replaces the previous one.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#c8f24aThe colour of the road done and of the steps.
GOALscript.js10000The day’s step goal.
STEPSscript.js7482The steps taken so far.
NOWscript.js17The present hour, from 7 to 22.
GLIDEscript.js0.9How many seconds the marker takes to go back to now.
HOLDscript.js1.4On its own: how many seconds it stops on each hour.
LOOPscript.jstrueLeft alone, a pointer scrubs through the day’s hours.

Try them in the Playground

When to use it

In a sports watch or health app, in a step challenge among colleagues, in a walk’s summary; and wherever a total grows towards a target: a fundraiser, pages read, the kilometres of a trip.

On phones

The same card: a finger on the bars scrubs through the day (the page still scrolls vertically) and shortly after lifting it the marker goes back to now. Figure, road and bars shrink with the window’s height.

With reduced motion

No walking and no springs: the marker already sits where the steps have got to and, scrubbing the hours, figure, road and milestones change at once.

Pitfalls

  • The demo’s day is made up and scaled to the chosen steps: real data comes from the phone’s or watch’s sensor, hour by hour.
  • Kilometres and calories are rough estimates (0.72 metres and 0.04 kilocalories per step): they depend on height, weight and pace, and should be presented as estimates.
  • The bars are not buttons: the keyboard needs a real slider (a range input over the hours) beside the pointer gesture.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 5.4 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 animations