Skip to content
animorio
IT
Back to the library

Shutter room card

Transitions, ImagesGSAP, CSS onlyMediumCompressed weight: Demo 9.8 KBGSAP 28 KBFreeDownload the zip

A transition for a hotel room card, with real photos: you tap the photo of the Sea Suite in an invented little hotel by the sea and the photo grows from the card to the whole stage; as it lands it splits into nine louvres that part by a hair, with a thread of light between each, and turn on their own axis like the slats of a shutter, from the middle outward. Behind them is the room's gallery: bed, bathroom, balcony and view, to swipe with a finger. Closing, the louvres shut again over the photo you chose and go back into the card, which now shows that one.

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>
<!--
  "Shutter room card" 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 room card that opens like shutters into its gallery</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" data-stage>
    <!-- the room card of a small hotel by the sea. Tapping the photo, the card grows to the whole stage while the
         photo splits into louvres; the louvres turn on their axis like shutters and behind them is the room's
         gallery, to swipe with a finger. Closing, the louvres turn back over the photo you stopped on -->
    <article class="room" data-card>
      <button class="room__media" type="button" data-open aria-label="Open the Sea Suite gallery, 5 photos">
        <span class="room__frame" data-frame>
          <img class="room__img" data-cover src="camera.webp" alt="The Sea Suite: a double bed, a desk and the balcony door open on the sea" width="1024" height="683">
          <img class="room__img room__img--next" data-cover-next src="camera.webp" alt="" width="1024" height="683" aria-hidden="true">
        </span>
        <span class="room__chip" data-chip>
          <svg viewBox="0 0 16 16" aria-hidden="true"><rect x="2" y="2" width="5" height="5" rx="1.2"/><rect x="9" y="2" width="5" height="5" rx="1.2"/><rect x="2" y="9" width="5" height="5" rx="1.2"/><rect x="9" y="9" width="5" height="5" rx="1.2"/></svg>
          <span data-chip-words>Room</span>
          <span class="room__chip-sep" aria-hidden="true"></span>
          <span>5 photos</span>
        </span>
      </button>
      <div class="room__info" data-info>
        <div class="room__top">
          <div>
            <p class="room__hotel">Casa Lumen, on the bay</p>
            <h1 class="room__name">Sea Suite</h1>
          </div>
          <p class="room__rate">
            <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 1.6l1.9 4 4.3.5-3.2 2.9.9 4.3L8 11.1l-3.9 2.2.9-4.3L1.8 6.1l4.3-.5z"/></svg>
            <span>4.92</span>
          </p>
        </div>
        <div class="room__bottom">
          <ul class="room__facts">
            <li>King bed</li>
            <li>34 m²</li>
            <li>Sea view</li>
          </ul>
          <p class="room__price"><strong>€310</strong><span>night</span></p>
        </div>
      </div>
    </article>

    <section class="sheet" data-sheet aria-label="Sea Suite gallery" aria-hidden="true">
      <div class="sheet__view" data-view>
        <div class="sheet__track" data-track></div>
      </div>
      <div class="sheet__shutters" data-shutters aria-hidden="true"></div>
      <header class="sheet__head" data-chrome>
        <div>
          <p class="sheet__hotel">Casa Lumen</p>
          <p class="sheet__room">Sea Suite</p>
        </div>
        <button class="sheet__close" type="button" data-close aria-label="Close the gallery">
          <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8"/></svg>
        </button>
      </header>
      <footer class="sheet__foot" data-chrome>
        <div class="sheet__caption">
          <p class="sheet__label"><span class="sheet__label-roll" data-label>Bedroom</span></p>
          <p class="sheet__note" data-note>Linen sheets, blackout curtains</p>
        </div>
        <div class="sheet__nav">
          <button class="sheet__arrow" type="button" data-prev aria-label="Previous photo">
            <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M10 3.5L5.5 8l4.5 4.5"/></svg>
          </button>
          <button class="sheet__arrow" type="button" data-next aria-label="Next photo">
            <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M6 3.5L10.5 8 6 12.5"/></svg>
          </button>
        </div>
        <div class="sheet__lines" data-lines aria-hidden="true"></div>
      </footer>
    </section>
    <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.

33 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 “Shutter room card” 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 stone page with a very fine grain, the white card of the Sea Suite at Casa Lumen rises slowly: at the top the real photo of the room (the bed, the desk, the balcony door open on the sea), with a glass label ‘Room, 5 photos’ and a grid icon; below it the hotel's name, ‘Sea Suite’ in large type, the 4.92 rating with a terracotta star, three tags (King bed, 34 m², Sea view) and the price ‘€310 night’. With the pointer over it the photo moves in a little and the label lifts by two pixels. Tapping it the photo gives under the finger and comes back on a spring, then grows from the card to cover almost the whole stage, its corners rounding a little more, while the card behind steps back and fades. As it lands the photo splits into nine vertical louvres that narrow by a hair, letting a thread of warm light through between them, and turn on their axis like the slats of a shutter, from the middle outward, darkening as they turn. Behind them is the photo of the bed, settling from slightly closer. The hotel and room names arrive at the top, the cross to close, and at the bottom ‘Bedroom’ in large type with a line describing it, two glass arrows and five thin lines, one per photo, that fill as you go. With a finger you swipe the gallery: each photo slides inside its frame with a little parallax, at both ends the gallery resists, the name rolls up and the new one arrives with a small bounce. Closing, the louvres turn back over the chosen photo, from the edges toward the middle, pass flat by a little and settle, close up with a click and the photo goes back into the card, which now shows that one and says so on its label. On its own, a pilot opens the gallery, moves to the bathroom and the balcony, closes on the balcony and after a moment the card fades back to its first photo.

How it works

A sheet over the stage

The gallery is a separate sheet, absolutely positioned over the stage. On opening the photo's box in the card is measured and the sheet starts there: GSAP takes its left, top, width and height to the big box, on expo.inOut. On closing the photo is measured again without the card's scale, which has stepped back in the meantime, so the sheet lands exactly in place.

The louvres are slices of the same photo

Each louvre holds a picture as wide as all the louvres together (nine times its width) moved back by its place, with background-size: cover. Side by side they rebuild the photo, and since it is all in percentages the photo stays whole while the sheet grows, with no maths on each frame.

The shutter that turns

The container holds the perspective; each louvre turns with rotationY up to 88 degrees, staggered from the middle. First it narrows to a scaleX of 0.975: between the louvres a thread of light shows (a one pixel edge that lights up). A dark veil inside each louvre rises as it turns, like a face turning away from the light.

The gallery under a finger

The photos sit in a row on a track moved with xPercent, so at any width. Under a finger the position follows the movement divided by the width, with resistance at the ends; on release the speed picks the photo and a back.out(0.55) spring takes it there with a pixel too many. Each photo is wider than its frame and slides the other way: the parallax.

Closing on the chosen photo

Closing, the louvres take the photo you stopped on, start edge on and turn flat from the edges toward the middle with back.out, close up with a click and the sheet goes back into the card, where the photo has already been swapped underneath. The pilot uses the same functions with GSAP waits, and stops at the first real touch.

Values to change

NameFileDefaultWhat it changes
SLATSscript.js9How many louvres the photo splits into.
GROWscript.js0.8Seconds the photo takes to grow from the card to the whole stage.
TURNscript.js0.62Seconds each louvre takes to turn.
STAGGERscript.js0.045Seconds between one louvre and the next.
TILTscript.js88How far the louvres turn, in degrees (90 = edge on).
SPRINGscript.js1.5How far the louvres overshoot as they shut again.
GAPscript.js0.025How much each louvre narrows before turning, letting the light through.
PARALLAXscript.js7How far each photo slides inside its frame while you swipe, in %.
LOOPscript.jstrueThe pilot opens, swipes and closes again and again.

Try them in the Playground

When to use it

For the rooms page of a hotel, a B&B or a holiday home, for an apartment or villa listing: when a card with one photo has to open all the photos of that place without leaving the page, and close again on the one that was liked best.

On phones

The same animation with adapted sizes: the card is as wide as the box and the photo is sized on the height too, the gallery takes almost the whole screen with narrower margins, the words get smaller and the photos are swiped with a finger.

With reduced motion

No movement: the gallery fades in at full size, with no turning louvres; changing photo the new one fades in; closing, the gallery fades out and the card already shows the chosen photo.

Pitfalls

  • The louvres must rebuild the photo exactly as the card shows it: that is why they share the card image's cover and centre and start from the same box; otherwise the photo jumps on the first frame.
  • The card steps back with a scale while the gallery is open: measuring the photo at that moment the sheet would go back into a smaller box. The scale is taken out of the measure, from the card's centre.
  • A track moved in pixels goes wrong while the sheet grows: with xPercent the position stays right at any width, on resize too.
  • A finger on the gallery must stop the pilot only if the touch is real (isTrusted), otherwise the recorder's fake clicks would switch it off.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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