Skip to content
animorio
IT
Back to the library

Perfume glass page

Hover, ImagesGSAP, CSS onlyMediumCompressed weight: Demo 11 KBGSAP 28 KBFreeDownload the zip

The product page of an eau de parfum from an invented house, dark and elegant: on the left a real photo of an amber perfume bottle kept in the half dark, on the right the name, the notes, the price and Add to bag. A light follows the pointer on a spring and goes through the glass: it lifts the photo where it falls, lights up the amber inside the bottle, slides a glint along the glass, warms the air behind and throws a caustic on the table on the other side. As it goes down from the cap to the base, the top, heart and base notes light up one after the other.

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>
<!--
  "Perfume glass page" 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 perfume page with the light that crosses the glass</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/fraunces@5.3.0/full.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage" data-stage>
    <!-- the product page of an invented perfume house. On the left a real photograph of an amber perfume bottle, kept
         in the dark; a light follows the pointer and goes through the glass: it lifts the photo where it falls, makes
         the amber glow inside the bottle, draws a glint on the glass, warms the air behind and throws a caustic on the
         table. On the right the notes light up one after the other as the light passes from the cap to the base -->
    <article class="product" data-product>
      <figure class="photo" data-photo>
        <div class="shot" data-shot>
          <img class="shot__img" src="profumo.webp" width="631" height="1024" alt="An amber eau de parfum in a cut glass bottle with a clear cap, on a wooden table, two more bottles out of focus behind it" decoding="async">
          <img class="shot__lit" src="profumo.webp" width="631" height="1024" alt="" aria-hidden="true" decoding="async">
          <i class="shot__halo" data-halo aria-hidden="true"></i>
          <span class="shot__caustic" data-caustic aria-hidden="true"><i class="shot__caustic-light" data-caustic-light></i></span>
          <div class="shot__glass" data-glass aria-hidden="true">
            <img class="shot__amber" src="profumo.webp" width="631" height="1024" alt="" decoding="async">
            <span class="shot__streak" data-streak><i class="shot__streak-light"></i></span>
            <span class="shot__streak shot__streak--back" data-streak-back><i class="shot__streak-light"></i></span>
          </div>
        </div>
        <i class="photo__shade" aria-hidden="true"></i>
        <i class="photo__seam" aria-hidden="true"></i>
        <figcaption class="photo__tag">Eau de Parfum</figcaption>
      </figure>

      <section class="info" aria-label="Ambre Nocturne">
        <p class="info__house">Maison Ardesia</p>
        <h1 class="info__name">Ambre <em>Nocturne</em></h1>
        <p class="info__kind"><span>Eau de Parfum</span><i class="info__sep" aria-hidden="true"></i><span>50 ml</span></p>
        <p class="info__line">A warm amber lit from within: resin, iris and a trace of smoke.</p>

        <ul class="notes" data-notes>
          <li class="note" data-note>
            <span class="note__tier">Top</span>
            <span class="note__names">Bergamot, pink pepper</span>
            <i class="note__rule" aria-hidden="true"><i class="note__fill" data-fill></i></i>
          </li>
          <li class="note" data-note>
            <span class="note__tier">Heart</span>
            <span class="note__names">Orris, orange blossom</span>
            <i class="note__rule" aria-hidden="true"><i class="note__fill" data-fill></i></i>
          </li>
          <li class="note" data-note>
            <span class="note__tier">Base</span>
            <span class="note__names">Amber, sandalwood, tonka</span>
            <i class="note__rule" aria-hidden="true"><i class="note__fill" data-fill></i></i>
          </li>
        </ul>

        <div class="buy">
          <p class="buy__price"><span class="buy__amount">€148</span><span class="buy__note">Free delivery, 2 ml sample included</span></p>
          <button class="bag" type="button" data-bag>
            <span class="bag__face" data-bag-face>
              <span class="bag__words" data-bag-words>Add to bag</span>
              <svg class="bag__icon" viewBox="0 0 18 18" aria-hidden="true">
                <path class="bag__shape" data-bag-shape d="M4.2 6.4h9.6l-.7 8.4H4.9zM6.6 6.4V5.2a2.4 2.4 0 0 1 4.8 0v1.2"/>
                <path class="bag__check" data-bag-check pathLength="1" d="M4.6 9.4l2.9 2.9 5.9-6.3"/>
              </svg>
            </span>
          </button>
        </div>
      </section>
    </article>

    <!-- the pointer that walks on its own until a real one arrives -->
    <svg class="pointer" data-pointer viewBox="0 0 20 24" aria-hidden="true">
      <path d="M3 2.2v17.4l4.6-4.3 2.9 6.6 2.9-1.3-2.9-6.4h6.3z"/>
    </svg>
    <i class="grain" data-grain aria-hidden="true"></i>
    <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.

34 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 “Perfume glass page” 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 a near black page a dark product page with round corners and a thread of light on its edge rises slowly. On the left the real photo of an amber eau de parfum in a cut glass bottle with a clear cap, on a wooden table, with two more bottles out of focus behind it: it is in the half dark, as in an unlit room. On the right Maison Ardesia in amber small capitals, the name Ambre Nocturne in a serif typeface (Nocturne in italics), Eau de Parfum and 50 ml split by a thin dash, a line describing it, the three notes (Top: Bergamot, pink pepper; Heart: Orris, orange blossom; Base: Amber, sandalwood, tonka) each above a hairline, the price €148 with free delivery and the light Add to bag button with its bag. A drawn pointer comes in above the cap and goes down the bottle in an S: the light follows it on a spring, a little behind, passes the mark by a pixel and settles. Where it falls the photo brightens in a soft circle; inside the bottle the perfume lights up in a warmer amber, as if a light went through it; a white glint slides on the glass on the side of the light and a warm one on the far side, both moving less than the light, as on a curved surface; behind the bottle the air warms up, and on the table, on the side away from the light, an amber caustic lands with its rings, longer when the light is low. The hairline between the photo and the words lights up at the light's height. As the light goes down, the notes light up one after the other: the words gain weight and colour, the label turns amber and an amber line runs along the hairline on a spring; they stay lit for a couple of seconds and then go out, draining from the right. At the end the pointer goes to Add to bag: a warm light crosses the button, it gives under the finger and comes back on an elastic, the words turn into Added to bag and the bag makes way for a checkmark that draws itself. Then the pointer leaves, the button goes back as it was and the loop starts again. With a real pointer the drawn one disappears and the light goes where it goes; three seconds after it stops, the loop starts again. Over everything a fine grain that shivers.

How it works

A box with the photo's proportions

The photo is not cropped with object-fit on the column: it sits in .shot, a box with its own proportions (631 by 1024) that the script scales just enough to cover the column, centred on the bottle and without leaving gaps. So every layer over the photo is written in the photo's pixels, and the outline of the bottle lands on the glass at every size, even when the window changes.

The same photo three times

At the bottom the photo in the half dark (brightness 0.38). Over it the same photo lit, with a radial-gradient mask centred on --lx and --ly: that is the pool of light. Over that, inside the glass layer, a third copy brighter and more saturated, with a wider mask: the amber lighting up as the light goes through it. The script changes just three CSS variables per frame.

The outline of the bottle

The bottle is a polygon of 32 points written in the photo's pixels, turned into percentages for clip-path: polygon(). It clips the glass layer, with the amber and the glints. The same outline, joined to the photo's rectangle in an evenodd polygon, does the opposite: it leaves the warm glow everywhere but on the glass, so it seems to be behind.

Glint, caustic and notes

The script measures where the light is against the bottle: across, how far to the side of the axis, and along, how far down from the cap to the base. The white glint moves by 0.42 times across, as on a curved surface, and the warm one on the other side; the caustic goes on the table on the opposite side, skewed and longer when the light is low. Every note has its band of along: when the light passes through it the note lights up and stays lit for HOLD seconds.

A spring for the light

The light chases the pointer, real or drawn, on a spring integrated by hand in two steps per frame (stiffness 95, damping 13): it arrives a little late, passes the mark and settles. The amount of light has its own spring too and fades slowly when the pointer leaves the photo. The drawn pointer is a GSAP timeline that stops at the first real pointer and starts again three seconds later.

Values to change

NameFileDefaultWhat it changes
LIGHT_SIZEscript.js0.5The radius of the pool of light, as a share of the photo's width.
DARKNESSscript.js0.38How bright the photo is where the light does not reach (1 = not dimmed).
AMBERscript.js0.9How much the perfume glows when the light goes through it.
GLINTscript.js0.85How bright the glint on the glass is.
CAUSTICscript.js0.75How bright the caustic on the table is.
HOLDscript.js2.4How many seconds a note stays lit after the light has passed.
STIFFNESSscript.js95The spring pulling the light to the pointer: higher is quicker.
DAMPINGscript.js13Lower lets the light pass the mark and come back.
SPEEDscript.js12 = the walk on its own twice as fast, 0.5 = half.
LOOPscript.jstrueRepeats the light's walk down the bottle.

Try them in the Playground

When to use it

For the product page of a perfumery, a cosmetics brand, candles, wines or spirits: anything in glass with a colour inside, when the photo has to feel alive and make people want to pick it up.

On phones

The same animation with adapted sizes: the two columns stay side by side and narrow, the line describing the perfume goes, the notes put their label above the names and the button moves under the price. With a finger the light goes where you touch and follows as you drag.

With reduced motion

The light does not move: it stays still halfway down the bottle and fades in and out; the notes light up with a fade and the button changes its words and icon with a fade, without the drawn pointer.

Pitfalls

  • With object-fit: cover there is no knowing where the bottle ends up after the crop: that is why the photo sits in a box with its own proportions, measured by the script, and the outline is written in the photo's pixels.
  • GSAP must not touch the transform of elements the CSS already moves: the glint and the caustic are one element for GSAP and a child for the drawing and the mask.
  • The clip-path outline has to be closed twice in the glow's evenodd polygon (back to the bottle's first point and then to the photo's corner), or a clipped strip is left between the two.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, Fraunces (font variabile) 5.3.0.

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

Testing

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