Skip to content
animorio
IT
All components

Time to leave notification

Notifications, Transitions, SVGGSAP, CSS onlyMediumCompressed weight: Demo 8.4 KBGSAP 28 KBFreeDownload the zip

The «Leave in 12 min» reminder of an invented calendar app, Quaybell, on black: a dark glass notification that arrives as a narrow pill and widens on a spring. The minutes left roll down on drums like an odometer and a thin ring empties with them. Tap it and it opens onto the drive: the line draws itself, the stretch with traffic lights up amber, the pin lands, the arrival time rolls. Snooze 10 min rolls the minutes back up, writes Snoozed with a tick and closes; a light runs around the rim at every change.

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>
<!--
  "Time to leave notification" 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>The time to leave reminder with the rolling minutes</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 time to leave reminder of Quaybell, a calendar app. A dark glass notification: the minutes left before you
         should leave roll down on drums and a thin ring empties with them. Tap it and it opens on a spring onto the
         route with the traffic, the arrival time and two buttons: Snooze 10 min rolls the minutes back up -->
    <div class="note" data-note role="group" aria-label="Time to leave reminder">
      <div class="note__skin" aria-hidden="true">
        <span class="note__edge" data-edge></span>
        <span class="note__sheen" data-sheen></span>
      </div>

      <button class="note__face" type="button" aria-expanded="false" aria-controls="note-more" data-face data-autoclic>
        <span class="note__icon" aria-hidden="true">
          <svg viewBox="0 0 24 24">
            <path class="icon__door" d="M10 4.5H6.8A1.8 1.8 0 0 0 5 6.3v11.4a1.8 1.8 0 0 0 1.8 1.8H10"/>
            <path class="icon__arrow" data-icon-arrow d="M10.5 12h9M16.3 8.6 19.7 12l-3.4 3.4"/>
          </svg>
        </span>
        <span class="note__text">
          <span class="note__title">Leave in <span class="roll" data-mins></span> min</span>
          <span class="note__meta"><span data-meta>Dinner at Osteria Nove</span><span class="note__sep"> · </span><span data-at>19:30</span></span>
        </span>
        <span class="note__ring" aria-hidden="true">
          <svg viewBox="0 0 30 30">
            <circle class="ring__track" cx="15" cy="15" r="12"/>
            <circle class="ring__fill" data-ring cx="15" cy="15" r="12" pathLength="100"/>
          </svg>
          <svg class="ring__chev" data-chev viewBox="0 0 12 12"><path d="M3.5 4.8 6 7.3l2.5-2.5"/></svg>
        </span>
      </button>

      <div class="note__more" id="note-more" data-more>
        <div class="more__in" data-more-in>
          <div class="route__head" data-part>
            <span class="route__time"><span class="roll" data-drive></span> min by car</span>
            <span class="route__traffic" data-traffic>+4 min traffic</span>
          </div>
          <div class="route" data-part aria-hidden="true">
            <svg class="route__line" viewBox="0 0 300 24" preserveAspectRatio="none" data-route-svg>
              <path class="route__base" d="M4 16 C 60 16, 70 6, 120 8 S 190 18, 230 12 S 280 8, 296 9"/>
              <path class="route__draw" data-route d="M4 16 C 60 16, 70 6, 120 8 S 190 18, 230 12 S 280 8, 296 9"/>
              <path class="route__slow" data-slow d="M4 16 C 60 16, 70 6, 120 8 S 190 18, 230 12 S 280 8, 296 9"/>
            </svg>
            <svg class="route__pin route__pin--a" viewBox="0 0 12 12"><rect x="3" y="3" width="6" height="6" rx="1.6"/></svg>
            <svg class="route__pin route__pin--b" data-pin viewBox="0 0 14 18"><path d="M7 16.5s5-5 5-9a5 5 0 0 0-10 0c0 4 5 9 5 9Z"/><path class="pin__hole" d="M7 9.2a1.7 1.7 0 1 0 0-3.4 1.7 1.7 0 0 0 0 3.4Z"/></svg>
          </div>
          <div class="route__ends" data-part>
            <span>Home</span>
            <span>Arrive <span class="roll" data-arrive></span></span>
          </div>
          <div class="note__actions" data-part>
            <button class="act act--ghost" type="button" data-snooze>
              <span class="act__fill" aria-hidden="true"></span>
              <span class="act__label" data-snooze-a>Snooze 10 min</span>
              <span class="act__label act__label--b" data-snooze-b aria-hidden="true">
                <svg viewBox="0 0 14 14"><path data-tick pathLength="1" d="M3 7.4 5.8 10 11 4.2"/></svg>Snoozed
              </span>
            </button>
            <button class="act act--main" type="button" data-go>
              <span class="act__label">Directions</span>
              <svg class="act__arrow" data-go-arrow viewBox="0 0 14 14" aria-hidden="true"><path d="M4 10 10 4M5.2 4H10v4.8"/></svg>
            </button>
          </div>
        </div>
      </div>
    </div>
    <p class="sr" aria-live="polite" data-live></p>
  </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.

31 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 “Time to leave notification” 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

The notification drops from the top as a narrow pill, widens on a spring and its parts come in staggered, while a light runs around the rim and a glint crosses the glass. The minutes of «Leave in 12 min» roll down one at a time on drums that turn like an odometer; the ring on the right empties and the icon’s arrow nudges towards the door. Tap it and it opens on a spring: the 18 min by car line, the route drawing itself from home to the restaurant, the slow stretch lighting up amber with +4 min traffic, the pin landing and the arrival time. Snooze 10 min fills with colour from the centre, the minutes roll up by ten (both digits turning), the ring fills, the label leaves upwards and Snoozed rises with a tick drawing itself; then the notification closes. Directions flicks its arrow and closes.

How it works

Minutes on drums

Every digit is a window one line tall holding a strip from 0 to 9 twice, moved with yPercent (one step is 5%). Going up past 9 the strip carries on into the second copy, going below 0 it starts from the second: so 10 becomes 20 turning forward and 20 becomes 19 turning back one step only. Digits start staggered from the right with back.out (SPRING); a gradient mask fades top and bottom.

The ring that empties

An SVG circle with pathLength="100" and stroke-dasharray 100: stroke-dashoffset goes from 0 to 100 with the minutes left over MINUTES + SNOOZE. With pathLength 1 GSAP rounded the pixels and the ring jumped from full to empty.

Opening on a spring

The lower part has height 0 and overflow hidden; GSAP takes it to height auto with back.out, then the rows rise staggered. The route is an SVG path with a stroke-dasharray as long as getTotalLength(): it draws from home to the restaurant, and a second amber copy with a short dash and a negative dashoffset lights only the stretch with traffic. The pin lands with back.out(3).

Light on the rim

The rim is a layer with 1px padding and a mask with mask-composite: inside, a conic-gradient whose angle lives in the --a variable, which GSAP takes from 0 to 360 degrees at every change. Over the glass a slanted blade crosses the notification with xPercent; GSAP moves .note and the look lives in its children, so the inline transform wipes nothing.

The pilot

A timeline brings the notification in, takes a minute off, opens it, takes another minute, presses Snooze, closes it, takes two minutes and sends it away upwards to start over. At the first real touch it stops; from then on the minutes keep ticking slowly and the notification opens and closes on tap and with Esc.

Values to change

NameFileDefaultWhat it changes
MINUTESscript.js12Minutes left before leaving when the reminder arrives.
SNOOZEscript.js10Minutes the Snooze button adds.
DRIVEscript.js18Minutes of driving, traffic included.
EVENT_ATscript.js'19:30'The time of the event in the calendar.
ROLL_TIMEscript.js0.75Seconds for a digit to roll into place.
SPRINGscript.js1.5How far the notification and the digits overshoot before settling (0 none).
ACCENTscript.js'#ffb03a'The reminder colour: ring, icon, traffic.
SPEEDscript.js1Pilot speed.
LOOPscript.jstrueThe pilot starts over.

Try them in the Playground

When to use it

In calendar, transport, navigation or restaurant and event booking apps: the alert that says when to leave to be on time, with the route and a button to snooze. It also works as a Live Activity or a widget on an app’s page.

On phones

The same animation: the notification is as wide as the screen minus 32 pixels, up to 360, 70 tall when closed and about 230 when open; the route stretches with it. A finger opens and presses just like the mouse.

With reduced motion

Nothing moves: the notification fades in, numbers change without rolling, the lower part opens already drawn with the amber stretch in place, Snoozed and the tick arrive at once, with no rim light or glint.

Pitfalls

  • The ring with pathLength="1" jumped from full to empty: GSAP rounds stroke-dashoffset pixels, so 0.55 became 1. With pathLength 100 the values are large enough.
  • The route has preserveAspectRatio none to stretch with the notification: with vector-effect non-scaling-stroke the dashes were measured in screen pixels and the line stopped short of the pin. Without it the dashes are back in path units.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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