Skip to content
animorio
IT
All components

Guided breathing card

Cards, Transitions, HoverGSAP, CSS onlyMediumCompressed weight: Demo 9.5 KBGSAP 28 KBFreeDownload the zip

The guided breathing session card of a meditation app, Lull, in frosted glass in a warm dark room, like a Dribbble shot. In the middle a soft shape of glass with a light inside swells while you breathe in, stays while you hold and empties while you breathe out; the word of the phase changes with a slow fade, the seconds roll down, a thin ring of eight arcs counts the breaths of the session and the light changes temperature: cool when empty, warm when full, rose while it empties. Pause slows everything to a stop, End saves the session.

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>
<!--
  "Guided breathing 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>The guided breathing card with the glass shape that swells</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" data-stage>
    <!-- two warm lights in the room, so the frosted card has something to blur -->
    <span class="room room--a" aria-hidden="true"></span>
    <span class="room room--b" aria-hidden="true"></span>

    <!-- the guided breathing session of a meditation app: a soft shape of glass with a light inside swells (breathe in),
         stays (hold) and empties (breathe out); the word of the phase fades, the seconds roll, a thin ring counts the
         breaths of the session and the light changes temperature with the phases. -->
    <section class="card" data-card aria-label="Guided breathing session">
      <span class="card__sheen" aria-hidden="true"></span>

      <header class="card__head">
        <div class="brand">
          <svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true">
            <path d="M3.5 13.2c2.4-3 5.2-3 8.5 0s6.1 3 8.5 0"/>
            <path d="M6 8.6c1.8-1.7 3.8-1.7 6 0s4.2 1.7 6 0" opacity=".55"/>
          </svg>
          <span class="brand__name">Lull</span>
        </div>
        <div class="meta">
          <span class="meta__title">Evening wind-down</span>
          <span class="meta__sub">4 · 4 · 6 breathing</span>
        </div>
      </header>

      <div class="well" data-well>
        <span class="well__floor" data-floor aria-hidden="true"></span>
        <svg class="ring" data-ring viewBox="0 0 200 200" aria-hidden="true"></svg>

        <div class="orb" data-orb aria-hidden="true">
          <span class="orb__halo" data-halo></span>
          <span class="orb__shape" data-shape>
            <span class="orb__core" data-core></span>
            <span class="orb__caustic" data-caustic></span>
            <span class="orb__spec" data-spec></span>
            <span class="orb__rim"></span>
          </span>
        </div>

        <div class="readout">
          <p class="phase" data-phase aria-live="polite">
            <span class="phase__word" data-word-a></span>
            <span class="phase__word" data-word-b></span>
          </p>
          <p class="count" data-count><span class="roll" data-sec></span><span class="count__unit">s</span></p>
        </div>
      </div>

      <footer class="card__foot">
        <div class="tally">
          <p class="tally__breaths"><span class="roll roll--small" data-breath></span><span class="tally__of" data-of>of 8 breaths</span></p>
          <p class="tally__left"><span data-left>1:52</span> left</p>
        </div>
        <div class="controls">
          <button class="ctl ctl--pause" type="button" data-pause aria-label="Pause">
            <span class="ctl__face">
              <svg class="ctl__icon" viewBox="0 0 16 16" aria-hidden="true">
                <g class="ctl__bars" data-bars><rect x="4" y="3.2" width="2.6" height="9.6" rx="1"/><rect x="9.4" y="3.2" width="2.6" height="9.6" rx="1"/></g>
                <path class="ctl__play" data-play d="M5 3.4v9.2c0 .6.6.9 1.1.6l7-4.6c.4-.3.4-.9 0-1.2l-7-4.6C5.6 2.5 5 2.8 5 3.4z"/>
              </svg>
              <span class="ctl__label" data-pause-label>Pause</span>
            </span>
          </button>
          <button class="ctl ctl--end" type="button" data-end>
            <span class="ctl__face"><span class="ctl__label">End</span></span>
          </button>
        </div>
      </footer>
    </section>
  </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.

30 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 “Guided breathing 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 a warm dark room, with an amber light on one side, a violet one on the other and a very fine grain, there is only the frosted glass card of a meditation app, Lull: on top the brand with two waves and, on the right, the session, Evening wind-down, with its 4 · 4 · 6 rhythm. In the middle, inside a thin ring of eight arcs (two already lit in cream, the third filling as you breathe), there is a soft shape of glass with a light inside, the highlight on the top left, a thread of edge catching the light and a caustic turning slowly. For four seconds the shape swells and the light goes from cool blue to warm amber, with Breathe in written on it and the seconds rolling down; for four it stays full, with Hold, a one pixel settle and the light breathing on its own; for six it empties, the light turns rose and then cool again, with Breathe out. The outline of the glass is never a perfect circle: it moves slowly like a drop. At the bottom left the breath you are on (3 of 8 breaths, rolling to the next) and the time left; on the right Pause and End. Pause slows everything down to a stop, the word becomes Paused and the two bars turn into the triangle of Resume; End saves the session, the shape settles halfway, the light cools down and the button becomes Again. Left alone the session goes on breath after breath, and when it ends it says Well done and starts again.

How it works

The glass in layers

The shape is a box moved only by GSAP (scale) holding the layers of the glass: the body with backdrop-filter and two radial gradients, the blurred light inside, a conic-gradient caustic that turns, the highlight on top and a one pixel edge made with the content-box exclude mask. The soft outline is an eight value border-radius that an endless timeline moves between four shapes close to a circle.

One timeline for the session

Each breath is a piece of the same timeline: breathe in (scale up to 1, sine.inOut), hold (a settle to 1.014 and back) and breathe out (down to SMALL). Seconds, word and breath are call()s placed on the right second, so pause, resume and the Playground all stay in sync.

The light that changes temperature

The light inside, the halo and the reflection on the floor of the card read two CSS variables, --core and --halo, that GSAP interpolates as colours on the card: from cool to warm while you breathe in, then rose in the first half of the breath out and cool again in the second. The strength follows with the opacity of the three layers.

The ring of breaths

Eight SVG arcs computed once in a 200x200 viewBox, each one doubled: the dim one below and the lit one above with pathLength 1 and stroke-dashoffset going from 1 to 0 over the fourteen seconds of its breath.

Rolling digits and a fading word

Every new digit comes in from above on a spring while the old one leaves below and is removed. The word of the phase is two stacked spans swapping with a slow fade, a blur and Mona Sans’s wdth axis narrowing on the way out and widening on the way in.

A soft pause

Pause does not stop at once: it brings the timeScale of the session, the outline and the caustic to 0 in 0.8 s, and Resume brings it back to 1, so the breath slows down and starts again like a real person.

Values to change

NameFileDefaultWhat it changes
INHALEscript.js4Seconds to breathe in.
HOLDscript.js4Seconds to hold (0 = no hold).
EXHALEscript.js6Seconds to breathe out.
BREATHSscript.js8How many breaths in the session (the arcs of the ring).
START_BREATHscript.js3The breath the session is on when the page opens.
SMALLscript.js0.62How small the shape gets when empty (1 = always full).
GLOWscript.js1How strong the light inside the glass is.
MORPHscript.js1How much the soft outline of the glass moves (0 = a perfect circle).
SPRINGscript.js1How springy the rolling digits and the buttons are.

Try them in the Playground

When to use it

For a meditation, sleep or wellness app, a breathing page before bed, a health or yoga app, a guided break inside a work app: it shows the rhythm of the breath without reading, how long is left and lets you pause or finish.

On phones

On the phone the card is 92% of the screen wide, the shape is measured on height and width together and the rhythm of the session on top is hidden; Pause and End are tapped and the rest is the same.

With reduced motion

Nothing moves: the shape keeps the same size and the breath is read only from the light, which turns warm, stays and fades to cool with dissolves; words and digits change in place, the ring still fills.

Pitfalls

  • The ring animated with strokeDashoffset did not move: Chromium reads the style value in pixels ignoring pathLength, so from 1px to 0px the arc stayed full or empty. The stroke-dashoffset attribute is animated with attr, which does respect pathLength.
  • The arcs still empty left a dot at every joint: a round cap draws a circle even for a stroke of zero length. The lit arcs have a flat cap.
  • The rolling digits sat higher than the s next to them, like an exponent: the inline-block box with hidden overflow takes its bottom edge as baseline. The lines are centred with a fixed line height.
  • When empty, the shape with the cool light looked like a grey steel marble: the glass has a veil of the colour of the light inside and the cool light never goes below a third of its strength.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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