Skip to content
animorio
IT
Back to the library

Cycle tracker ring

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

The ring of a period tracker app: one segment per day, the period, the fertile window and ovulation in three shades of one pink; slide along the ring and the segments swell under the knob while the day, the phase and the forecast roll over. Let go, it springs back to today.

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>
<!--
  "Cycle tracker ring" 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>Cycle tracker ring</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 cycle tracker: one segment per day around the ring, the period, the fertile window and the
         ovulation day in shades of one colour; move along the ring and the day, the phase and the forecast follow -->
    <section class="cy" data-cy aria-label="Cycle tracker">
      <div class="cy__ring" data-ring role="slider" tabindex="0" aria-label="Day of the cycle" aria-valuemin="1">
        <span class="cy__glow" aria-hidden="true"></span>
        <svg viewBox="0 0 220 220" aria-hidden="true">
          <g data-segs></g>
          <line class="cy__today" data-today x1="110" x2="110" y1="44" y2="50"></line>
          <g class="cy__knob" data-knob transform="translate(110 25)">
            <circle class="cy__knob-halo" r="13.500"></circle>
            <circle class="cy__knob-dot" r="10"></circle>
            <circle class="cy__knob-core" data-core r="4"></circle>
          </g>
        </svg>
        <span class="cy__mid">
          <span class="cy__day-label">Day</span>
          <b class="cy__num" data-num>1</b>
          <span class="cy__phase"><span data-phase>Period</span></span>
          <span class="cy__hint"><span data-hint></span></span>
        </span>
      </div>
      <ul class="cy__legend" aria-label="Legend">
        <li><i class="is-period"></i>Period</li>
        <li><i class="is-fertile"></i>Fertile</li>
        <li><i class="is-ovulation"></i>Ovulation</li>
      </ul>
    </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.

15 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 “Cycle tracker ring” 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 warm paper, a ring of twenty-eight segments, one per day: the first five solid pink for the period, six lighter ones for the fertile window, a longer solid one for ovulation, the rest grey. At first the segments come in one after another round the ring and a white knob walks from day one to today, while the day number in the middle counts. In the middle are the day, the phase and the forecast: “Ovulation in 2 days”, “Period in 16 days”. Moving the pointer along the ring, or dragging with a finger, the knob follows the shortest way round, the nearby segments swell outward, the number gains weight the more fertile the day is and a pink light behind the ring brightens with it; phase and forecast roll in the direction of the movement. Leaving the ring, the knob springs back to today with a small bounce. The arrow keys move one day at a time.

How it works

One number on the ring

The position is a single unbounded number: the knob, the swelling segments and the written day read it wrapped between 0 and the cycle length. To go to a day the shorter way is picked, so from 28 to 1 the knob takes one step and not the whole lap.

Segments like a dock

Each segment is a line rotated round the centre; its length grows with the squared closeness to the knob, so the two or three nearby swell and not the whole ring.

Phases from three rules

Period in the first days, ovulation about fourteen days before the next cycle, fertile window in the five days before and the one after: change the length in the Playground and the ring redraws itself.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#e0567aThe cycle’s colour.
CYCLEscript.js28How many days the cycle lasts.
PERIODscript.js5How many days the period lasts.
TODAYscript.js12Today’s day in the cycle.
LOOPscript.jstrueLeft alone, a pointer turns the ring and comes back to today.

Try them in the Playground

When to use it

On the main screen of a period or fertility app, on its maker’s site, in a health app; and wherever a cycle of days must be read at a glance: a team’s shifts, the phases of the moon, a vegetable patch’s rotation.

On phones

The same scene: drag a finger along the ring without scrolling the page, and letting go goes back to today. The ring is also sized on the window’s height.

With reduced motion

The ring is already whole and the knob is on today. The knob jumps to the chosen day without gliding and the words change without rolling.

Pitfalls

  • The phases are worked out with simple, rough rules (ovulation about fourteen days before the next period): they are not medical advice nor a method to avoid or seek a pregnancy. In a real app the forecasts come from the user’s own data.
  • The ring is a role="slider" with an aria-valuetext giving day, phase and forecast, and it answers the arrow keys: the phase is not told by colour alone.
  • On a phone, touch-action: none on the ring lets you drag without scrolling the page; outside the ring the page scrolls as usual.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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