Skip to content
animorio
IT
All components

Daily medication card

Cards, Hover, SVGGSAP, CSS onlyMediumCompressed weight: Demo 6.7 KBGSAP 28 KBFreeDownload the zip

The card of a medication reminder app: three doses for today, each with its pill, its time and a circle to tick. At every tap the circle fills on a spring, the tick draws itself, the name is struck through and the pill tips; at the top the ring advances and the line says how many are left. With the third the ring closes into a tick, the title becomes ‘All done for today’ and a sheen crosses the card.

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 medication card" 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>Today’s medication card with doses that tick off and a ring that closes</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 card of a medication reminder app: three doses for today; tapping one fills its check on a spring, draws
         the tick, strikes the name and tips the capsule, while the ring in the corner advances and the line under the
         title says what is left; with the third dose the ring closes into a tick, the title rolls to all done and a
         sheen crosses the card -->
    <section class="card" data-card aria-label="Today’s doses">
      <span class="card__glow" aria-hidden="true"></span>
      <span class="card__face" aria-hidden="true"><span class="card__sheen" data-sheen></span></span>

      <header class="head">
        <div class="head__text">
          <p class="head__day">Saturday</p>
          <h1 class="head__title"><span data-title>Today’s doses</span></h1>
          <p class="head__next"><span data-next>3 doses left, next at 8:00</span></p>
        </div>
        <div class="ring" data-ring-box aria-hidden="true">
          <svg viewBox="0 0 52 52">
            <circle class="ring__track" cx="26" cy="26" r="22"></circle>
            <circle class="ring__arc" data-ring cx="26" cy="26" r="22" pathLength="1"></circle>
          </svg>
          <span class="ring__count"><span data-count>0</span></span>
          <svg class="ring__tick" viewBox="0 0 24 24"><path data-ring-tick pathLength="1" d="M6.2 12.6 10.4 16.8 18 8"></path></svg>
        </div>
      </header>

      <ul class="doses">
        <li>
          <button class="dose" type="button" data-dose data-time="8:00" aria-pressed="false">
            <span class="tile tile--a" data-tile><svg viewBox="0 0 24 24"><g data-pill transform="rotate(-38 12 12)"><rect class="pill__back" x="3.4" y="7.6" width="17.2" height="8.8" rx="4.4"></rect><path class="pill__half" d="M12 7.6h4.2a4.4 4.4 0 0 1 0 8.8H12Z"></path><path class="pill__shine" d="M6.8 10.2h3.4"></path></g></svg></span>
            <span class="dose__text"><span class="dose__name"><span data-name>Vitamin D</span><i class="dose__strike" data-strike></i></span><span class="dose__meta">1 capsule, with breakfast</span></span>
            <span class="dose__time">8:00</span>
            <span class="check"><span class="check__fill" data-fill></span><svg viewBox="0 0 24 24"><path data-tick pathLength="1" d="M6.6 12.5 10.5 16.4 17.6 8.2"></path></svg></span>
          </button>
        </li>
        <li>
          <button class="dose" type="button" data-dose data-time="13:30" aria-pressed="false">
            <span class="tile tile--b" data-tile><svg viewBox="0 0 24 24"><g data-pill><circle class="pill__back" cx="12" cy="12" r="7.6"></circle><path class="pill__score" d="M6.6 12h10.8"></path><path class="pill__shine" d="M8.4 8.6a5 5 0 0 1 3.2-1.5"></path></g></svg></span>
            <span class="dose__text"><span class="dose__name"><span data-name>Magnesium</span><i class="dose__strike" data-strike></i></span><span class="dose__meta">2 tablets, after lunch</span></span>
            <span class="dose__time">13:30</span>
            <span class="check"><span class="check__fill" data-fill></span><svg viewBox="0 0 24 24"><path data-tick pathLength="1" d="M6.6 12.5 10.5 16.4 17.6 8.2"></path></svg></span>
          </button>
        </li>
        <li>
          <button class="dose" type="button" data-dose data-time="21:00" aria-pressed="false">
            <span class="tile tile--c" data-tile><svg viewBox="0 0 24 24"><g data-pill transform="rotate(32 12 12)"><ellipse class="pill__back" cx="12" cy="12" rx="8.6" ry="5"></ellipse><path class="pill__shine" d="M7 10.6c1.4-1.2 3.2-1.7 5-1.7"></path></g></svg></span>
            <span class="dose__text"><span class="dose__name"><span data-name>Omega 3</span><i class="dose__strike" data-strike></i></span><span class="dose__meta">1 softgel, before bed</span></span>
            <span class="dose__time">21:00</span>
            <span class="check"><span class="check__fill" data-fill></span><svg viewBox="0 0 24 24"><path data-tick pathLength="1" d="M6.6 12.5 10.5 16.4 17.6 8.2"></path></svg></span>
          </button>
        </li>
      </ul>
    </section>
    <p class="sr" data-live aria-live="polite"></p>

    <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.

28 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 medication card” 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

In the middle, on white, a light card with soft corners and a layered shadow. At the top the day, the title ‘Today’s doses’ and the line ‘3 doses left, next at 8:00’; next to them, a grey ring with the number of doses taken. Below, three rows that come up one after the other: a coloured tile with a drawn pill (a teal capsule, an amber tablet, an indigo softgel), the name and how to take it, the time and an empty circle. On hover the row darkens slightly and the circle’s edge takes colour; on press the row squeezes a little. On tap the circle fills with teal on a spring, the white tick draws itself, a line strikes the name from left to right, the tile loses colour and the pill tips and comes back with a wobble. Meanwhile the ring advances by a third with a small bounce, the number rolls and the line under the title rolls to how many are left and the time of the next. With the third dose the number leaves, the ring gives an elastic kick and a tick draws itself inside, the title rolls to ‘All done for today’, the line to ‘Next dose tomorrow at 8:00’, a sheen crosses the card and a teal light appears underneath. Another tap on a row opens it again and everything goes back. Left alone, a pointer ticks the three doses, waits and starts again.

How it works

Real buttons

Each dose is a button with aria-pressed: it works with touch, mouse and keyboard. The click calls setDose, which changes the state, the is-taken class (colours and opacity, in the CSS) and starts the movements with GSAP.

The tick, the line, the pill

Inside the circle a coloured disc scales from 0 to 1 with elastic.out; the tick is a path with pathLength 1 and stroke-dashoffset from 1 to 0. The line on the name is an element 1.6 pixels tall that scales horizontally from the left. The tile rotates back by TIP degrees and returns on a slow spring.

The ring and the rolling lines

update counts the doses taken: the ring’s stroke-dashoffset goes to 1 minus the fraction, on a spring; the number and the ‘how many left’ line leave upwards and the new version comes in from below. The time of the next one is that of the first dose not taken.

Day done

When none is left the card takes the is-done class: the number goes, a tick draws itself in the ring, the ring gives a kick, a band of light slides from one side of the card to the other and the light underneath turns on. Removing a tick takes everything back to the state before.

Values to change

NameFileDefaultWhat it changes
DONEscript.jsAll done for todayThe title when every dose is taken.
TOMORROWscript.jsNext dose tomorrow at 8:00The line under the title when the day is done.
ACCENTscript.js#0fa58fThe colour of the ticks, the ring and the light.
SPRINGscript.js0.7How long the spring of the tick and the ring lasts, in seconds.
TIPscript.js16By how many degrees the pill tips when you take it.
PACEscript.js0.7By itself: the pause between one dose and the next, in seconds.
HOLDscript.js2.6By itself: how many seconds the finished day stays before starting again.
LOOPscript.jstrueLeft alone, a pointer ticks the doses by itself.

Try them in the Playground

When to use it

For a health app, a pharmacy or a service that reminds people of their medication and supplements: the day’s card on the main screen. With other names and drawings it suits any short list to finish within the day: habits, exercises, to-dos.

On phones

The same card, as wide as the screen minus the margins: the rows stay on a single line and the note under the name is cut with an ellipsis if it does not fit. On touch there is no hover; the rest is the same.

With reduced motion

No springs, no tipping and no sheen: the circle fills with a fade with the tick already drawn, the name is struck at once, the ring advances linearly and the words change with a fade.

Pitfalls

  • With a spring the ring overshoots the value for a moment: on the last dose the stroke-dashoffset goes below zero and the stroke reopens from the other side. Here the spring is heavily damped (0.7) and the stroke has a round cap, so it does not show.
  • The line that strikes the name sits inside the name (position absolute on its container, as wide as the text), not on the whole row: otherwise it strikes the empty space too.
  • The row’s press is in the CSS (transform on .dose): GSAP moves only the children and the li around it, so the two transforms do not clash.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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