Skip to content
animorio
IT
Back to the library

Shop the look photo

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

The real photo of a living room in the shop of an invented furniture brand, to buy piece by piece: passing over the armchair, the pendant lamp or the coffee table, four thin corners frame it with a small bounce, the rest of the photo sinks under a warm veil and the photo moves slightly closer to the piece. Beside it its card opens, with a thumbnail cropped from the same photo, the material, the price and Add to bag.

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 look photo" 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 shop-the-look photo that frames each piece on hover</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="palco">
    <!-- the room photo of a furniture shop: passing over a piece frames it, dims the rest and opens its card -->
    <section class="vetrina" data-vetrina>
      <div class="quadro">
      <figure class="foto" data-foto>
        <div class="foto__lente" data-lente>
          <img class="scena" src="soggiorno.webp" width="853" height="640" decoding="async" alt="A bright living room with a taupe tufted armchair, a drum pendant lamp and a white lacquer coffee table on a grey rug">
          <!-- the warm glow of the pendant, lit when the lamp is framed -->
          <svg class="luce" viewBox="0 0 800 600" preserveAspectRatio="xMidYMid slice" aria-hidden="true">
            <defs>
              <radialGradient id="bagliore" cx=".5" cy=".42" r=".5"><stop offset="0" stop-color="#ffcf8a" stop-opacity=".85"/><stop offset=".55" stop-color="#ffcf8a" stop-opacity=".3"/><stop offset="1" stop-color="#ffcf8a" stop-opacity="0"/></radialGradient>
            </defs>
            <ellipse data-luce cx="481" cy="118" rx="170" ry="150" fill="url(#bagliore)" opacity="0"/>
          </svg>

          <!-- the veil over the rest of the photo, with a hole where the piece is -->
          <svg class="velo" viewBox="0 0 800 600" preserveAspectRatio="xMidYMid slice" aria-hidden="true">
            <defs>
              <mask id="buco" maskUnits="userSpaceOnUse" x="0" y="0" width="800" height="600">
                <rect width="800" height="600" fill="#fff"/>
                <rect data-foro x="-20" y="-20" width="840" height="640" rx="18" fill="#000"/>
              </mask>
            </defs>
            <rect class="velo__ombra" data-ombra width="800" height="600" mask="url(#buco)"/>
          </svg>

          <div class="cornice" data-cornice aria-hidden="true"><i></i><i></i><i></i><i></i></div>

          <button class="zona" data-zona="0" aria-label="Slab coffee table"></button>
          <button class="zona" data-zona="1" aria-label="Arlo armchair"></button>
          <button class="zona" data-zona="2" aria-label="Halo pendant lamp"></button>
        </div>
        <div class="grana" aria-hidden="true"></div>

      </figure>
        <aside class="prodotto" data-prodotto aria-live="polite">
          <div class="prodotto__riga">
            <div class="prodotto__foto"><svg data-miniatura viewBox="0 0 100 100" preserveAspectRatio="xMidYMid slice" aria-hidden="true"><image href="soggiorno.webp" width="800" height="600" preserveAspectRatio="none"/></svg></div>
            <div class="prodotto__testi">
              <p class="prodotto__nome" data-nome></p>
              <p class="prodotto__dett"><i class="campione" data-campione></i><span data-dett></span></p>
              <p class="prodotto__prezzo" data-prezzo></p>
            </div>
          </div>
          <button class="aggiungi" data-aggiungi>
            <span class="aggiungi__testo" data-aggiungi-testo>Add to bag</span>
            <span class="aggiungi__fatto" data-aggiungi-fatto><svg viewBox="0 0 16 16" aria-hidden="true"><path data-spunta d="M3.5 8.4 6.6 11.4 12.6 4.8"/></svg>Added</span>
          </button>
        </aside>
      </div>

      <div class="piede">
        <p class="piede__titolo"><b>Oakline</b> Living room, autumn edit</p>
        <p class="borsa" aria-label="Bag"><span>Bag</span><span class="borsa__cifra"><span data-cifre><span>0</span><span>1</span><span>2</span><span>3</span></span></span></p>
      </div>

      <svg class="puntatore" data-puntatore viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2v15.4l4.1-3.9 2.7 6 2.6-1.2-2.7-5.9h5.6z"/></svg>
    </section>
  </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.

23 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 “Shop the look photo” 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 white background there is the real photo of a bright living room by Oakline, an invented furniture brand: a taupe tufted armchair with dark legs, a pendant lamp with a fretwork drum, a square white lacquer coffee table with chrome legs and a glass shelf, two white sofas, a grey rug and the window light behind the curtains. Passing over a piece, four thin white corners frame it: they arrive a little wider and stop with a one-pixel bounce; the rest of the photo sinks under a warm veil with a round-cornered hole right around the piece, and the whole photo moves slightly closer, towards the piece; when the lamp is framed its drum lights up warm. At the top, on the free side, its card opens: the thumbnail cropped from the same photo settling in, the name, a small square in the colour of the material, the price and Add to bag, one line after another. Moving to another piece the frame slides over to it and the old card leaves before the new one comes in. Add to bag becomes Added with a check that draws itself, and the bag counter under the photo goes up by one. Leaving the photo, veil and frame draw back. A drawn pointer does the round on its own: lamp, armchair with Add to bag, coffee table.

How it works

One photo, fixed sizes

The photo is a webp cropped to 4/3 in a frame with aspect-ratio 4/3, and every piece has its rectangle measured on the photo in units of an 800 by 600 plane: the hit areas, the frame and the veil are placed in percent and stay on the piece at any size, on resize and on a phone too.

The veil with a hole

Over the photo a second SVG with the same viewBox: a dark rectangle with a mask, and in the mask a black round-cornered rectangle that is the hole. GSAP animates a single object (x, y, width, height, darkness) and every frame moves the hole, the frame and the veil’s opacity.

Corners that bounce

The frame is four corners made of two borders; a CSS variable --stacco pushes them out. On every new piece --stacco goes from 9 px to 0 with back.out, so the corners overshoot by a pixel and come back.

The photo moving closer

Photo, veil and frame sit in one container that scales by AVVICINAMENTO from the centre; xPercent and yPercent shift it just enough for the piece’s centre to stay still, so the zoom goes towards the piece.

The thumbnail from the same photo

The card’s thumbnail is an SVG holding the same photo as an 800 by 600 <image>: changing its viewBox to the piece’s crop is enough. The old card leaves before the new one comes in, and Add to bag turns into Added the same way, one first and then the other.

Values to change

NameFileDefaultWhat it changes
VELOscript.js0.4How dark the rest of the photo gets around the piece.
AVVICINAMENTOscript.js1.03How much the photo moves closer to the framed piece.
MARGINEscript.js16The room between the piece and its frame, in photo units.
DURATAscript.js0.75The seconds the frame takes to move from one piece to another.
RIMBALZOscript.js3How far the frame’s corners overshoot before they stop.
SOSTAscript.js1.9The seconds on each piece in the drawn pointer’s round.

Try them in the Playground

When to use it

For the room shots of a furniture, fashion or homeware shop, when one photo shows several products together and each must be buyable without leaving the photo; also for a lookbook or a magazine with the products marked.

On phones

The photo takes the width of the box and stays 4/3; a tap on a piece frames it and opens its card, smaller but with the same lines; a tap on another piece moves the frame there.

With reduced motion

Frame and veil fade in already in place, without sliding or bouncing, the photo does not move closer and the card fades in and out; the drawn pointer is hidden.

Pitfalls

  • Veil, frame and hit areas must sit in the same container as the photo that zooms: if they stayed outside, as soon as the photo moves closer the hole would no longer match the piece.
  • Changing transformOrigin while the photo is already zoomed makes it jump: it always scales from the centre and compensates with xPercent and yPercent.
  • Two cards in the same place never cross-fade: the old one leaves in 0.18 seconds, then the texts change and the new one comes in.
  • With a real photo the pieces’ rectangles are measured on the photo already cropped to 4/3, not on the original: if photo and stage do not share the ratio, object-fit: cover trims the edges and every frame slides sideways.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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