Skip to content
animorio
IT
Back to the library

Spa treatment card

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

The card to book a massage at a spa: the length is chosen on an arc, dragging the handle or tapping one of the three marks at 30, 60 and 90 minutes. The arc fills on a spring, the minutes and the price count, the card’s warm light grows with the time. Below, today’s free slots with a sliding pill and the button that says what you are booking.

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>
<!--
  "Spa treatment 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>Spa treatment card with the duration on an arc and the price that rolls</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 booking card of a spa treatment: the length of the massage is chosen on an arc, dragging the handle or
         tapping one of the three marks; the arc fills on a spring, the minutes and the price count, the warm light
         of the card grows with the time; below, the free slots of the day and the button that says what you book -->
    <section class="card" data-card aria-label="Book a massage">
      <span class="card__warm" data-warm aria-hidden="true"></span>
      <header class="head">
        <p class="head__place">Alba Spa, thermal baths</p>
        <h1 class="head__title">Deep tissue massage</h1>
      </header>

      <div class="dial" data-dial>
        <svg viewBox="0 0 260 138" aria-hidden="true">
          <path class="dial__track" d="M30 126A100 100 0 0 1 230 126"></path>
          <path class="dial__fill" data-fill pathLength="1" d="M30 126A100 100 0 0 1 230 126"></path>
          <g class="dial__marks">
            <path d="M30 126h-9" data-tick></path><path d="M130 26v-9" data-tick></path><path d="M230 126h9" data-tick></path>
          </g>
          <g data-handle><circle class="dial__halo" r="15"></circle><circle class="dial__knob" r="9.5"></circle><circle class="dial__pin" r="3"></circle></g>
        </svg>
        <button class="stop stop--a" type="button" data-stop="30">30</button>
        <button class="stop stop--b" type="button" data-stop="60">60</button>
        <button class="stop stop--c" type="button" data-stop="90">90</button>
        <div class="dial__read" aria-hidden="true">
          <p class="dial__min"><span data-min>60</span><small>min</small></p>
          <p class="dial__price"><span data-price></span></p>
        </div>
        <input class="sr" type="range" min="30" max="90" step="30" value="60" data-range aria-label="Length in minutes">
      </div>

      <div class="slots" role="group" aria-label="Free today">
        <span class="slots__pill" data-pill aria-hidden="true"></span>
        <button type="button" data-slot aria-pressed="true">15:00</button>
        <button type="button" data-slot aria-pressed="false">16:30</button>
        <button type="button" data-slot aria-pressed="false">18:00</button>
      </div>

      <button class="book" type="button" data-book><span class="book__in"><span data-book-word>Book 60 min at 15:00</span></span></button>
    </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.

23 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 “Spa treatment 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 a sand background, a cream card with a warm light rising from behind: the spa’s name and the treatment, ‘Deep tissue massage’. Below, a half-circle arc: the part already covered is terracotta, the rest very light grey, with a round white handle on the arc and three numbers at the ends and at the top, 30, 60 and 90. Inside the arc, large, the chosen minutes and below them the price. Dragging the handle along the arc the minutes and the price change as you move it and the warm light grows; letting go, it snaps to the nearest mark and the arc settles with a small bounce. Tapping a number the handle goes there by itself, on a spring. Under the arc three times, 15:00, 16:30 and 18:00, with a white pill sliding onto the chosen one, and a dark button whose label rolls at every change: ‘Book 90 min at 18:00’. Left alone, a pointer drags the handle to 90 minutes, picks 18:00 and puts everything back.

How it works

One number, the minutes

Everything is drawn from a number between 30 and 90: paint derives the fraction, the filled part of the arc (stroke-dashoffset on a path with pathLength 1), the handle’s position with sine and cosine, the minutes, the price and the warm light’s opacity.

Dragging along the arc

On touch the angle between the pointer and the arc’s centre is worked out with atan2 and mapped to minutes: the handle follows the finger. On release the value snaps to the nearest multiple of 30 with elastic.out.

The price

It is the fixed part plus the minutes times the price per minute; while dragging it changes at every minute, with no animation, so it can be read.

Without dragging too

The three numbers are buttons, and underneath there is a range input hidden from sight but not from the keyboard: left and right arrows change the length.

Slots and button

The slots’ pill takes the position and width of the chosen button and goes there on a spring; the label of the button at the bottom rolls up when you increase and down when you reduce.

Values to change

NameFileDefaultWhat it changes
STARTscript.js60The minutes at the start: 30, 60 or 90.
PER_MINscript.js1How many euros each minute costs.
FIXEDscript.js25The fixed part of the price, in euros.
SPRINGscript.js0.8How long the spring of the changing arc lasts, in seconds.
ACCENTscript.js#b9683fThe colour of the arc and the price.
GLOWscript.js#e2a56aThe colour of the card’s warm light.
PAUSEscript.js1.8By itself: the pause after each choice, in seconds.
LOOPscript.jstrueLeft alone, a pointer lengthens the massage and changes the slot.

Try them in the Playground

When to use it

For the site or app of a spa, a hotel with a wellness centre, a salon or a massage studio: people booking choose how long the treatment lasts and see at once what it costs. The same arc suits any timed service: a lesson, a rehearsal room, a tennis court.

On phones

The same card, as wide as the screen: the arc is dragged with a finger (the page underneath does not scroll while you touch it) and on a short screen arc and buttons tighten a little.

With reduced motion

No springs: arc, handle and pill go straight to the new value and the button’s label changes without rolling. Dragging works the same.

Pitfalls

  • The arc needs touch-action none, or on a phone the finger scrolls the page instead of moving the handle.
  • With the spring the value passes 90 or drops under 30 for a moment: the arc’s fraction and the minutes shown must be kept within limits, the handle may go out by a hair.
  • Pointer measures are in screen pixels: they must be brought back to drawing units by dividing by the SVG’s real width.

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