Skip to content
animorio
IT
Back to the library

Aroma diffuser

Hover, PhysicsCanvas, GSAP, CSS onlyMediumCompressed weight: Demo 6.3 KBGSAP 28 KBFreeDownload the zip

An essential oil diffuser in the dark, on black: a pale ceramic dome on a wooden base, with a line of warm light, and from the spout the mist rising softly, spreading and fading. Move the pointer through it and the mist parts and bends the way you go, then comes together again. Below, three modes change its rhythm: Gentle a thin thread, Steady a continuous plume, Burst thick puffs and a pause. For an aromatherapy shop or a diffuser’s app. Minimal style.

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>
<!--
  "Aroma diffuser" 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>Aroma diffuser</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">
    <!-- an aroma diffuser in the dark: mist rising from the spout and bending under the pointer, and three modes
         that change its rhythm -->
    <section class="df" data-df aria-label="Aroma diffuser">
      <div class="df__air" data-air>
        <canvas class="df__mist" data-mist aria-hidden="true"></canvas>
        <svg class="df__body" data-body viewBox="0 0 132 78" aria-hidden="true">
          <defs>
            <linearGradient id="df-clay" x1="0" y1="0" x2="1" y2="0"><stop offset="0" stop-color="#b9b0a2"></stop><stop offset="0.3" stop-color="#efe9df"></stop><stop offset="0.62" stop-color="#e4dccf"></stop><stop offset="1" stop-color="#9c9284"></stop></linearGradient>
            <linearGradient id="df-wood" x1="0" y1="0" x2="1" y2="0"><stop offset="0" stop-color="#5b3a22"></stop><stop offset="0.35" stop-color="#9a6a42"></stop><stop offset="1" stop-color="#4c2f1b"></stop></linearGradient>
          </defs>
          <ellipse class="df__floor" cx="66" cy="74" rx="62" ry="4"></ellipse>
          <path d="M18 62C18 30 38 6 66 6s48 24 48 56Z" fill="url(#df-clay)"></path>
          <ellipse cx="66" cy="8" rx="7" ry="2.200" fill="#2a2622"></ellipse>
          <path class="df__band" data-band d="M19 60.500h94"></path>
          <path d="M16 62h100v6a6 6 0 0 1-6 6H22a6 6 0 0 1-6-6Z" fill="url(#df-wood)"></path>
        </svg>
      </div>

      <div class="df__seg" role="radiogroup" aria-label="Mist mode" data-seg>
        <span class="df__thumb" data-thumb></span>
        <button type="button" class="df__opt" role="radio" data-opt data-line="A thin, slow thread of mist" data-left="Runs for 6 h"><span>Gentle</span></button>
        <button type="button" class="df__opt" role="radio" data-opt data-line="A steady, even plume" data-left="Runs for 3 h"><span>Steady</span></button>
        <button type="button" class="df__opt" role="radio" data-opt data-line="Thick puffs, then a pause" data-left="Runs for 4 h"><span>Burst</span></button>
      </div>

      <div class="df__info">
        <strong class="df__clip df__clip--tall"><span data-outline>A steady, even plume</span></strong>
        <span class="df__clip"><span data-outleft>Lavender and bergamot. Runs for 3 h</span></span>
      </div>
    </section>
    <span class="live" aria-live="polite" data-live></span>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></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.

15 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Aroma diffuser” 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 black, in the middle, a diffuser seen from the front: an ivory ceramic dome with a soft light on its side, the dark hole on top, a wooden base and between the two a thin line of warm light. Mist rises from the hole: pale, soft puffs that start small, rise swaying, spread and fade before the edge. Below, a three-way control, Gentle, Steady, Burst, with a pale pill under the chosen one, and two centred lines: “A steady, even plume” and “Lavender and bergamot. Runs for 3 h”. Moving the pointer inside the mist the nearby puffs step aside and are dragged the way you move, then go back to rising straight. Choosing Burst the pill slides with a bounce, the line of light brightens and the mist comes out in thick puffs for a second, then rests a second and a half; with Gentle a thin thread is left and the light dims. The two lines roll at every change. The arrow keys move from one mode to the next.

How it works

One puff, many times

A soft puff is painted once on a small canvas; every particle is that same picture stamped larger or smaller, more or less transparent.

Born, rising, fading

Every particle is born at the spout (measured from the drawing), rises, sways slowly, grows and lives three or four seconds: it comes in fast and fades calmly.

The pointer is a wind

Particles within 62 pixels are pushed away from the pointer and take some of its speed; friction then returns them to rising.

Modes are numbers

How many puffs a second, for how long, with what pause and how large: changing mode only changes these numbers, and the mist already in the air carries on.

Values to change

NameFileDefaultWhat it changes
MISTscript.js#f1ece3The colour of the mist.
MODEscript.js2The mode at the start: 1 Gentle, 2 Steady, 3 Burst.
RISEscript.js46How many pixels a second the mist rises.
WINDscript.js1How much the pointer moves the mist: 0 = not at all, 3 = a lot.
LOOPscript.jstrueLeft alone, the demo’s pointer passes through the mist and changes mode.

Try them in the Playground

When to use it

On the product page of a diffuser or an essential oil shop, in the hero of a spa’s site, or in the home app that controls it; the same mist carries the steam of a cup of tea, the smoke of incense, a greenhouse humidifier or the dry ice of a club.

On phones

The scene is at most 340 pixels wide; the air above the diffuser is 230 pixels tall or half the screen, whichever is less. With a finger the mist moves as you drag. The three options are 34 pixels tall.

With reduced motion

The mist is a still picture, the plume as it stands after a few seconds, and changes in one step when the mode changes; no bounces, the pointer does not move it. The demo’s pointer does not start.

Pitfalls

  • The canvas is sized on the screen’s real pixels (up to 2 per point) and sized again on resize together with the spout’s place, or the mist comes out grainy or from the wrong spot.
  • Drawing a gradient per particle every frame is slow: the puff is a picture made once and stamped again.
  • The time step is capped at a tenth of a second: coming back from another tab the mist does not jump.
  • The mode is a radio group with `aria-checked`: the mist is decorative, what changes is written in the two lines and announced.
  • Oils and running times are invented.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 2 December 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