Skip to content
animorio
IT
Back to the library

Home thermostat

Hover, SVGGSAPMediumCompressed weight: Demo 9.9 KBGSAP 28 KBFreeDownload the zip

The thermostat of Calora, a made-up smart home app, on an almost black page: a wide ring with a tick every half degree, turned with a finger. Behind the knob runs an arc of light from cold blue to warm amber, the figure in the middle rolls, the nearby ticks grow as if under a lens and a light of the colour of the temperature spreads behind the ring; let go, the knob settles on the half degree on a spring and the time to get there appears below. Eco takes everything to 19° with one long gesture.

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>
<!--
  "Home thermostat" 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 home thermostat with the arc of light that follows the finger</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/geist-mono@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage" data-stage>
    <!-- the thermostat of a made-up smart home app, Calora. A wide ring with a tick every half degree: drag the knob
         round, the arc of light follows from cold blue to warm amber, the ticks near the knob grow like under a lens,
         the figure rolls and a soft glow of the same colour spreads behind. Let go, the knob settles on the nearest
         half degree on a spring and the time to get there appears. Eco glides the ring down to 19 degrees -->
    <section class="unit" data-unit aria-label="Calora thermostat, living room">
      <header class="unit__head">
        <span class="brand">
          <svg class="brand__mark" viewBox="0 0 22 22" aria-hidden="true">
            <path d="M5.2 15.6a7.4 7.4 0 1 1 11.6 0"/>
            <path d="M11 11 14.4 7.6"/>
          </svg>
          <span class="brand__name">Calora</span>
        </span>
        <span class="room">Living room</span>
      </header>

      <div class="dial" data-dial>
        <div class="dial__glow" data-glow aria-hidden="true"></div>
        <svg class="dial__base" viewBox="0 0 300 300" aria-hidden="true">
          <defs>
            <radialGradient id="faceFill" cx="50%" cy="38%" r="62%">
              <stop offset="0" stop-color="#1b1d22"/>
              <stop offset="1" stop-color="#0d0e11"/>
            </radialGradient>
            <linearGradient id="rimLight" x1="0" y1="0" x2="0" y2="1">
              <stop offset="0" stop-color="#ffffff" stop-opacity=".16"/>
              <stop offset=".5" stop-color="#ffffff" stop-opacity=".02"/>
              <stop offset="1" stop-color="#ffffff" stop-opacity=".07"/>
            </linearGradient>
          </defs>
          <circle class="dial__face" cx="150" cy="150" r="103" fill="url(#faceFill)"/>
          <circle class="dial__facerim" cx="150" cy="150" r="103" stroke="url(#rimLight)"/>
          <path class="dial__groove" data-groove/>
          <path class="dial__groove-edge" data-groove-edge/>
          <g class="dial__ticks" data-ticks></g>
          <g class="dial__ends" data-ends></g>
        </svg>
        <div class="dial__arc" data-arc aria-hidden="true"><span class="dial__sheen" data-sheen></span></div>
        <svg class="dial__top" viewBox="0 0 300 300" data-top>
          <circle class="dial__cap" data-cap r="9.5"/>
          <g class="knob" data-knob>
            <g class="knob__body" data-knob-body>
              <circle class="knob__shadow" r="16" cy="3"/>
              <circle class="knob__disc" r="15"/>
              <circle class="knob__ring" r="14.4"/>
              <circle class="knob__dimple" data-dimple r="4.2"/>
            </g>
          </g>
          <circle class="dial__hit" data-hit cx="150" cy="150" r="140" role="slider" tabindex="0"
                  aria-label="Target temperature" aria-valuemin="10" aria-valuemax="30" aria-valuenow="21.5" aria-valuetext="21.5 degrees"/>
        </svg>

        <div class="readout" aria-hidden="true">
          <span class="readout__mode" data-mode>Heating</span>
          <span class="readout__num" data-num></span>
          <span class="readout__room">Indoor <b data-indoor>20.1°</b></span>
        </div>
      </div>

      <p class="status" data-status aria-live="polite"><span data-status-text>Heating to 21.5° · 12 min</span></p>

      <button class="eco" type="button" data-eco aria-pressed="false">
        <span class="eco__body" data-eco-body>
          <svg class="eco__leaf" viewBox="0 0 20 20" aria-hidden="true">
            <path class="eco__leaf-fill" d="M4.2 15.8C3.4 9.4 7.6 4.6 16 4.2c.4 7.8-4 12.2-11.8 11.6Z"/>
            <path class="eco__vein" d="M4.4 15.6 11.6 8.6"/>
          </svg>
          <span class="eco__word">Eco</span>
          <span class="eco__val">19°</span>
        </span>
      </button>
    </section>

    <svg class="cursor" data-cursor viewBox="0 0 24 24" aria-hidden="true"><path d="M5 2.8v16.4l4.2-4 2.8 6.2 2.9-1.3-2.8-6.1h5.9Z"/></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.

37 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 “Home thermostat” 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 an almost black page is the living room thermostat of Calora: at the top the brand and «Living room», in the middle a wide ring over three quarters of a turn, from 10 to 30 degrees, with a tick every half degree outside it (longer every degree), inside a dark face with «Heating», the large figure «21.5°» and «Indoor 20.1°»; below the line «Heating to 21.5° · 12 min» and an «Eco 19°» pill with a leaf. On arrival the arc of light starts at 10 and climbs to 21.5 while the digits roll. Taking the knob with a finger or the mouse the knob swells, the nearby ticks grow outwards and brighten as if under a lens that follows it, the light behind the ring turns up and leans towards the knob; turning, the arc follows the hand and changes colour from blue to amber, the figure rolls every half degree and gains weight as it gets warmer, the word at the top goes from Heating to Holding to Cooling. Let go, the knob settles on the nearest half degree on a spring, squashes a little and comes back, and below the line with the estimated time rises again, with the minutes counting. Eco presses the pill, the leaf turns sage and the ring glides slowly to 19°; pressed again, it goes back where it was. Left alone, a pointer takes the temperature to 24.5, then to 20.5, presses Eco and brings everything back to 21.5.

How it works

The ring drawn

A 300 unit SVG with its centre at 150: the groove is an arc of radius 118 over 270 degrees, from −135 to +135 from the top clockwise; a tick every half degree is a radial line worked out with the sine and cosine of the angle of its temperature.

The conic arc of light

Over the groove sits a div with a conic-gradient starting at 225 degrees, from blue to amber, cut by two masks: a radial-gradient leaves only the ring, a conic-gradient leaves only the angle up to the knob, with the --a variable. In Chromium mask-composite: intersect, in Safari -webkit-mask-composite: source-in.

The hand

Under the finger the angle is measured with atan2 around the centre and turned into degrees of the scale; in the gap at the bottom of the ring it stays at the end nearest to where it was, so it never jumps from 30 to 10. A 0.18 s gsap.quickTo chases the value, and a single render redraws arc, knob, ticks, light and figure.

The lens on the ticks

Each tick grows outwards by LENS_GROW times a gaussian of its distance from the knob (LENS_REACH degrees) and brightens the same way; the strength of the lens is 0.45 at rest, 0.7 on hover and 1 while dragging. A tick is only rewritten when it changes.

The spring and the time

Let go, the value goes to the nearest half degree with elastic.out(1, 0.42) in SNAP_TIME seconds and the knob squashes to 94% and comes back; the line below rises out of the blur with «Heating to … · N min», the minutes worked out from how far the room is, times MIN_PER_DEGREE, counted up by a tween.

Eco

Eco remembers where it was and glides the value to ECO_TEMP in ECO_TIME seconds with power3.inOut, with the lens on for the whole journey; pressed again, it goes back to the value before. Turning the knob away from 19 switches Eco off by itself.

Values to change

NameFileDefaultWhat it changes
START_TEMPscript.js21.5The temperature asked for when the page opens.
ROOM_TEMPscript.js20.1The temperature of the room now: it decides Heating, Holding or Cooling and the time.
ECO_TEMPscript.js19Where the Eco button takes the ring.
MIN_PER_DEGREEscript.js9Minutes the house takes to change by one degree.
LENS_REACHscript.js1.4How many degrees around the knob the lens reaches.
LENS_GROWscript.js9How much the ticks under the lens grow.
FOLLOWscript.js0.18Seconds the knob takes to catch the finger.
SNAP_TIMEscript.js0.9Seconds of the spring that settles the knob on the half degree.
ECO_TIMEscript.js1.9Seconds of the long glide to Eco.
ROLL_TIMEscript.js0.5Seconds a digit takes to roll.
IDLEscript.js3.6Seconds before the pointer plays by itself.

Try them in the Playground

When to use it

For a smart home app, the panel of a thermostat or an air conditioner, the control of an oven, a boiler or a dimmable light, and in general for any value picked on a circular scale (volume, intensity, speed) in a dashboard.

On phones

The same animation with adapted sizes: the ring is min(78vw, 56vh) wide and everything inside is in SVG units, the masks in percent; a finger drags the knob (touch-action: none on the ring, so the page does not scroll) and taps Eco.

With reduced motion

No glides and no springs: the knob goes straight to the half degree, Eco goes straight to 19°, the digits are already in place and the time line fades in. No pointer by itself.

Pitfalls

  • In the gap at the bottom of the ring the angle jumps from +135 to −135: without keeping the end nearest to the value before, moving the finger under the knob would fly it from 30 to 10.
  • The conic-gradient and the conic mask must start from the same angle (225 degrees, bottom left), otherwise the colours of the arc do not match the ones worked out for the light and the dot of the knob.
  • Mona Sans digits in tabular-nums change shape (the slashed zero): here every reel has a fixed width of 0.6 em with the digit centred.
  • Rewriting 41 lines every frame costs: each tick remembers its rounded lens strength and is touched only when it changes.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, Geist Mono (font variabile) 5.3.0.

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

Testing

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