Skip to content
animorio
IT
Back to the library

Shop the room hotspots

Images, HoverGSAP, CSS onlyMediumCompressed weight: Demo 7.4 KBGSAP 28 KBFreeDownload the zip

«Shop the room» for Hallam & Rye, a made-up furniture shop: a real photo of a bright lounge with coral armchairs, and on top four plus points in a glass ring. Tap a point and the plus turns into an x, a hairline draws from the point to a small card with the kind of piece, the name, the material, the price and View; the room dims around the point and leans in a touch. Tap another point and the card glides there while the line redraws.

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>
<!--
  "Shop the room hotspots" 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>Shop the room hotspots</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>
  <!-- Shop the room for Hallam & Rye, a made-up furniture shop: a real photo of a lounge with four plus points.
       Touch a point and a hairline draws from it to a small card with the piece, the price and View; the room
       dims around the point and leans in a touch. Another point moves the card there. -->
  <main class="stage">
    <header class="bar">
      <p class="brand">Hallam <span>&amp; Rye</span></p>
      <p class="room">Shop the room <span class="room__count" data-count>4 pieces</span></p>
    </header>

    <figure class="frame" data-frame>
      <div class="scene" data-scene>
        <img class="photo" src="salotto.webp" width="2048" height="1536" alt="A bright lounge with coral armchairs, grey loveseats, white coffee tables and pendant lamps by arched windows" data-photo>
        <div class="dim" data-dim aria-hidden="true"></div>

        <button class="spot" type="button" data-spot="0" aria-label="Armchair, Wren Wingback" aria-expanded="false">
          <span class="spot__ring" data-ring></span>
          <span class="spot__core" data-core>
            <svg class="spot__plus" data-plus viewBox="0 0 12 12" width="12" height="12" aria-hidden="true"><path d="M6 1.5v9M1.5 6h9" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>
          </span>
        </button>
        <button class="spot" type="button" data-spot="1" aria-label="Coffee table, Linnet" aria-expanded="false">
          <span class="spot__ring" data-ring></span>
          <span class="spot__core" data-core>
            <svg class="spot__plus" data-plus viewBox="0 0 12 12" width="12" height="12" aria-hidden="true"><path d="M6 1.5v9M1.5 6h9" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>
          </span>
        </button>
        <button class="spot" type="button" data-spot="2" aria-label="Pendant lamp, Harbour" aria-expanded="false">
          <span class="spot__ring" data-ring></span>
          <span class="spot__core" data-core>
            <svg class="spot__plus" data-plus viewBox="0 0 12 12" width="12" height="12" aria-hidden="true"><path d="M6 1.5v9M1.5 6h9" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>
          </span>
        </button>
        <button class="spot" type="button" data-spot="3" aria-label="Loveseat, Arden" aria-expanded="false">
          <span class="spot__ring" data-ring></span>
          <span class="spot__core" data-core>
            <svg class="spot__plus" data-plus viewBox="0 0 12 12" width="12" height="12" aria-hidden="true"><path d="M6 1.5v9M1.5 6h9" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>
          </span>
        </button>
      </div>

      <svg class="wire" data-wire aria-hidden="true"><path data-path pathLength="1" d="M0 0"/></svg>

      <aside class="tag" data-tag aria-live="polite">
        <div class="tag__in" data-tag-in>
          <p class="tag__kind" data-kind>Armchair</p>
          <p class="tag__name" data-name>Wren Wingback</p>
          <p class="tag__meta" data-meta>Coral bouclé, oiled oak legs</p>
          <div class="tag__foot">
            <span class="tag__price" data-price>$1,180</span>
            <a class="tag__view" href="#" data-view>
              <span>View</span>
              <svg viewBox="0 0 12 12" width="11" height="11" aria-hidden="true"><path d="M3 9l6-6M4.5 3H9v4.5" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>
            </a>
          </div>
        </div>
      </aside>
    </figure>

    <p class="caption">The Harbour Lounge, styled by Hallam &amp; Rye</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.

26 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 “Shop the room hotspots” 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

At the top Hallam & Rye on the left and «Shop the room, 4 pieces» on the right; in the middle, in a round-cornered frame, the photo of a lounge with arched windows, coral armchairs, grey loveseats, white coffee tables and pendant lamps. On four pieces sit four points: a white circle with a plus inside a blurred glass ring. On hover the plus turns 45 degrees and the ring tightens. Tap a point and the circle turns black with the white plus turned into an x, the ring widens with a bounce, the room dims all around leaving a clear circle around the point and leans in by 3.5% keeping the point still; a thin white line starts from the point and draws itself to the edge of the card, which arrives right after with a small bounce, its rows one after the other: Armchair, Wren Wingback, Coral bouclé, oiled oak legs, $1,180 and the black View pill with its arrow. Tap another point and the line pulls back, the card glides to the other side of the photo as its rows refresh, the clear circle follows and the line draws again. Tapping the same point, outside the card or Esc closes everything. On its own it tours the four pieces.

How it works

Points on a cover photo

The photo uses object-fit: cover, so the points cannot be placed in percentages: the script computes the photo’s scale (the larger of frame width and height divided by the photo’s), the offset of the cropped edges, and places each point in pixels; a point that lands in the cropped part is hidden. It is computed again on resize, even mid-animation.

The room leaning in around the point

The scene (photo, shade and points) has its transformOrigin in the centre; to lean in by LEAN keeping point p still it moves by (p minus the centre) times (1 minus LEAN). Between points scale and offset are interpolated together, with no jumps.

The shade with a hole

Over the photo sits a dark veil with a radial-gradient mask: transparent up to 54 pixels from the point, full from 210. GSAP moves the --mx and --my variables in pixels, so the clear circle slides from one piece to the next.

The line and the card

The card goes to the side of the photo with room, GAP pixels from the point, kept inside the frame; if it does not fit beside, above or below. The line is a path with pathLength 1 from the edge of the point to the nearest point of the card (the point clamped into the card’s rectangle); it draws with stroke-dashoffset from 1 to 0 and pulls back to −1. autoRound is off, otherwise the line appears all at once.

Values to change

NameFileDefaultWhat it changes
SPEEDscript.js1The speed of everything.
LEANscript.js1.035How much the room leans in towards the open point.
SHADEscript.js1How much the room dims around the point (0 none).
GAPscript.js96The distance in pixels between the point and the card.
DRAWscript.js0.55Seconds of the line drawing itself.
MOVEscript.js0.7Seconds of the card moving from one point to another.
STEPscript.js2.6Seconds on each point in the self-running tour.
SHOPscript.js"Hallam & Rye"The shop name.

Try them in the Playground

When to use it

On the page of a furniture shop, a design brand or a hotel that sells its furniture: a styled photo where every piece can be bought, a lookbook, a collection’s «shop the look» page.

On phones

On phones you tap: the points are a little smaller, the card more compact, and if it does not fit beside the point it goes above or below. The frame is sized on the height too (calc on 100vh), so photo, points and card fit in the box.

With reduced motion

No movement: the room does not lean in, the line and the card fade in in place, the plus becomes an x without turning and the shade fades in.

Pitfalls

  • With object-fit: cover, points in percentages slide off the furniture as soon as the frame changes proportions: they must be computed in pixels from the photo’s scale.
  • Leaning the room in by changing transformOrigin mid-way makes a jump: the origin stays in the centre and the offset compensates.
  • Without autoRound off the line with pathLength 1 appears all at once instead of drawing.
  • The hidden card keeps visibility hidden, otherwise its View can be tapped while the card is closed.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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