Skip to content
animorio
IT
Back to the library

House light gallery

Images, HoverCanvas, GSAPAdvancedCompressed weight: Demo 15 KBGSAP 28 KBFreeDownload the zip

The gallery of a flat to rent from Ambra Living, an invented estate agency: one large real photo of the living room, with the oak floor, the linen sofa and the windows with louvred shutters, and the slider of the day under it. Dragging it from Morning to Evening really changes the light over the photo: from 12:40 the striped patch of sun, with the shadow of the louvres and the bars, comes in under the window and stretches across the rug and the floor towards the sofa, the colour goes from the cool of the morning to the warm of the evening and at dusk the floor lamp and the ceiling spots come on. The time rolls on its digits, the compass says ‘South-west facing’ and hovering the photo a thin loupe magnifies the detail and names it.

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>
<!--
  "House light gallery" 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 house gallery with the room light from morning to evening</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 gallery of a flat to rent: one large photo of the living room (living-room.webp, a real photo) in a canvas,
         and a slider under it. Dragging the slider through the day lays veils of light over the photo: the striped patch
         of sun through the shutters moves and stretches, the colour goes from the cool of the morning to the warm of the
         evening and the lamps come on.
         Hovering the photo shows a thin loupe with the detail under it -->
    <section class="card" data-card aria-label="The Linden Loft, living room">
      <header class="head">
        <span class="mark" aria-hidden="true">
          <svg viewBox="0 0 20 20"><path d="M4.2 16.4V9.6a5.8 5.8 0 0 1 11.6 0v6.8"></path><path d="M8 16.4v-4.6a2 2 0 0 1 4 0v4.6"></path><path d="M2.6 16.4h14.8"></path></svg>
        </span>
        <span class="who">
          <span class="brand">Ambra Living</span>
          <span class="title">The Linden Loft, 2 bed</span>
        </span>
        <span class="price"><b>&pound;2,450</b><small>per month</small></span>
      </header>

      <figure class="photo" data-photo>
        <canvas class="photo__cv" data-cv role="img" aria-label="Photo of the living room of The Linden Loft"></canvas>
        <span class="chip chip--room">Living room</span>
        <span class="chip chip--count">
          <svg viewBox="0 0 16 16" aria-hidden="true"><rect x="1.8" y="4.2" width="12.4" height="9" rx="2.2"></rect><path d="M5.6 4.2 6.6 2.6h2.8l1 1.6"></path><circle cx="8" cy="8.7" r="2.4"></circle></svg>
          <span>12 photos</span>
        </span>
        <span class="hint" data-hint>
          <svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="7" cy="7" r="4.4"></circle><path d="m10.3 10.3 3.4 3.4"></path></svg>
          <span data-hint-text>Hover to look closer</span>
        </span>
        <div class="lens" data-lens aria-hidden="true">
          <div class="lens__glass"><canvas data-lens-cv></canvas></div>
          <span class="lens__tag" data-lens-tag><span>Oak floor, oiled</span></span>
        </div>
      </figure>

      <div class="readout">
        <div class="clock">
          <span class="time" data-time aria-hidden="true">
            <span class="digit" data-digit></span><span class="digit" data-digit></span><span class="colon">:</span><span class="digit" data-digit></span><span class="digit" data-digit></span>
          </span>
          <span class="phase" data-phase><span>Soft morning light</span></span>
        </div>
        <div class="facing">
          <svg class="compass" viewBox="0 0 28 28" aria-hidden="true">
            <circle class="compass__ring" cx="14" cy="14" r="12.2"></circle>
            <g class="compass__ticks"><path d="M14 2.6v2.2M14 23.2v2.2M2.6 14h2.2M23.2 14h2.2"></path></g>
            <g class="compass__needle" data-needle><path class="compass__n" d="M14 5.6 16 14h-4Z"></path><path class="compass__s" d="M14 22.4 12 14h4Z"></path></g>
            <circle class="compass__hub" cx="14" cy="14" r="1.2"></circle>
          </svg>
          <span class="facing__txt"><b>South-west facing</b><small>Direct sun 12:40 to 19:50</small></span>
        </div>
      </div>

      <div class="track" data-track>
        <div class="rail" data-rail>
          <span class="rail__ticks" data-ticks aria-hidden="true"></span>
          <span class="knob" data-knob role="slider" tabindex="0" aria-label="Time of day" aria-valuemin="420" aria-valuemax="1200" aria-valuenow="420" aria-valuetext="07:00">
            <span class="knob__in">
              <svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="2.6"></circle><path data-rays d="M8 1.8v1.6M8 12.6v1.6M1.8 8h1.6M12.6 8h1.6M3.6 3.6l1.1 1.1M11.3 11.3l1.1 1.1M3.6 12.4l1.1-1.1M11.3 4.7l1.1-1.1"></path></svg>
            </span>
          </span>
        </div>
        <div class="stops">
          <button type="button" data-stop="0">Morning</button>
          <button type="button" data-stop="0.5">Noon</button>
          <button type="button" data-stop="1">Evening</button>
        </div>
      </div>
    </section>

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

38 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 “House light gallery” 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 warm light background with a fine grain sits the card of a listing from Ambra Living, an invented estate agency: at the top the arch mark, ‘The Linden Loft, 2 bed’ and the rent, £2,450 a month. Below, large, the real photo of the living room: the oak plank floor, two steps up to the dining room behind glazed doors, panelled walls, a print, the linen sofa with checked cushions, a wooden side table, the grey rug, a floor lamp and two windows with white louvred shutters, the large one over the radiator. The photo sits in a canvas and the light of the hour is laid over it in veils: a light map multiplied over the photo (cooler and lower in the morning, full at noon, amber and then blue in the evening), the glass with the sky of the hour, the burning patches of sun, the beam in the air with glinting dust, the grade, the vignette and the grain. Under the photo the rolling time, a line that names the light (Soft morning light, Bright midday sun, Afternoon sun, Golden hour, Lamps on at dusk), the compass with the needle settling on south-west and ‘South-west facing’, then the slider of the day with Morning, Noon and Evening. A drawn pointer takes the handle and carries the day from seven in the morning to eight in the evening: in the morning the room is cool with no direct sun, from 12:40 the striped patch of sun, with the louvres of the shutters and the bars of the three bays, appears short under the window and then stretches and slides left across the rug and the floor towards the sofa, yellow and then orange; the room warms, then turns blue and at dusk first the floor lamp comes on, washing the ceiling with warm light, then the spots, with their pools on the ceiling and the floor. Then the pointer moves over the photo and the loupe magnifies the lamp, the sofa and the window, with the label rolling to the new name; finally it brings the day back to the morning.

How it works

The room is a real photo

living-room.webp, a CC0 photo, is drawn to cover the canvas every frame. Everything the light needs (the three bays of the window, the floor line under it, the sofa, the side table, the lamps) is measured on the photo in a 1200 by 797 frame, and the same frame scales with the photo.

The light of the hour is multiplied over it

Every frame a small light map is composed, at a third of the size: the colour of the hour (cool in the morning, full at noon, amber and then blue in the evening), the glow by the windows, the glass with the sky, the sun and the lamps. The map is laid over the photo with multiply, like real light over colours.

The patch of sun comes through the shutters

Every louvre of every bay is thrown onto the floor: a point of the window h above the floor lands h times further forward and sideways, depending on the hour. So the patch has the stripes of the louvres and the bars, short at noon and long towards the sofa in the evening; it is clipped to the floor and the sofa, side table and desk are cut out of it.

What makes it read as real light

The patch burns with two screen glows, the beam is a faint polygon from the window to the patch with dust glinting only inside it, in the evening the floor lamp washes the ceiling and the spots light their pools, and over it all go the cool or warm grade, the vignette and the grain.

The rolling time and the loupe

Every digit is a strip of numbers with a position that eases to the right digit the shortest way round. The loupe redraws a piece of the canvas magnified in a circle, and a polygon for each thing in the photo tells it what it is looking at.

Values to change

NameFileDefaultWhat it changes
STARTscript.js0.06Where the day starts: 0 = seven, 0.5 = one o'clock, 1 = eight in the evening.
SUNscript.js1How strong the sun coming through the window is.
BLOOMscript.js0.7How much the sunlight burns and spreads.
WARMTHscript.js1How much the colour warms towards the evening.
LAMPSscript.js1How strong the two lamps are in the evening.
GRAINscript.js0.04How visible the grain of the photo is.
DUSTscript.js46How many specks of dust glint in the beam.
ZOOMscript.js2.4How much the loupe magnifies.
LENSscript.js120How large the loupe is, in pixels.
SPEEDscript.js12 = the walk on its own twice as fast, 0.5 = half.
LOOPscript.jstrueRepeats the pointer's walk on its own.
ACCENTscript.js#d9772fThe colour of the evening: the compass needle and the sun on the handle.

Try them in the Playground

When to use it

In the gallery of a property listing, a holiday home, a hotel or a short let, where the aspect and the light matter as much as the square metres: whoever looks sees for themselves that the room gets the afternoon sun. The room is changed with another photo (and the measures of the window, the floor and the lamps in script.js), the light in SUN, WARMTH and LAMPS.

On phones

The same animations at adapted sizes: the card is as wide as the screen, the photo is measured on width and height, framed to cover keeping the window and the floor, and recomputed when the size changes. The loupe appears while a finger is held on the photo; on narrow screens the direct sun line goes.

With reduced motion

No pointer walking on its own, no drifting dust and no changing grain: the room starts in the late afternoon with the sun already on the floor, the slider moves the light at once without easing and the loupe fades in.

Pitfalls

  • Adding the warm lamp light to an already bright map clips the red before the green and the room turns yellow green: the lamp light in the map stays below white and the warmth comes from the grade on top.
  • On a photo that is already bright an added patch of sun does not show: the daytime ambient sits a little under full, so the patch brings the photo back to its whites and the screen glow makes it burn.
  • Rolling digits during a drag always look half way: the time is rounded to the quarter hour and the strip has soft edges.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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