
Stacking certificates
Hover, Images
The rooms of a small made-up hotel in a mosaic of real photos, in the clean style of product interfaces: hover a photo and its column and row widen on a spring while the others make room without jumping, the picture follows the pointer and the caption with the price rises; click it and the room fills the whole mosaic with its details, and the cross closes it again.
A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN. The React tab holds the same demo as a ready component, which switches its animations off when it leaves the page.
<!doctype html>
<!--
"Rooms mosaic" 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>Wrenlow House, the rooms</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>
<!-- the rooms of a small made-up hotel, Wrenlow House, in a mosaic of real photos. Hover a photo and
its column and row widen on a spring while the others make room without jumping; the picture inside drifts with
the pointer and its caption rises. Click it and it fills the whole mosaic with its details; the cross closes it -->
<main class="stage" data-stage>
<div class="wrap" data-wrap>
<header class="head">
<div class="brand">
<svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 20V9.5L12 4l8 5.5V20"/><path d="M9.5 20v-5.5h5V20"/></svg>
<span data-hotel>Wrenlow House</span>
</div>
<p class="head__note" data-note>Five rooms by the sea</p>
</header>
<div class="mosaic" data-mosaic role="list" aria-label="Rooms"></div>
</div>
<svg class="pointer" viewBox="0 0 24 24" aria-hidden="true" data-pointer><path d="M5 3.5 18.5 12 12.4 13.6 9.4 19.6z"/></svg>
</main>
<template data-cell>
<div class="cell" role="listitem">
<button class="cell__hit" type="button" data-hit></button>
<div class="cell__photo" data-photo><canvas data-canvas></canvas></div>
<div class="cell__shade" aria-hidden="true"></div>
<div class="cap" data-cap>
<span class="cap__name" data-name></span>
<span class="cap__price" data-price></span>
</div>
<div class="more" aria-hidden="true" data-more>
<svg viewBox="0 0 24 24"><path d="M7 17 17 7M9 7h8v8"/></svg>
</div>
<div class="detail" data-detail>
<div class="detail__top">
<div>
<p class="detail__kind" data-kind></p>
<h2 class="detail__name" data-dname></h2>
</div>
<p class="detail__price"><strong data-dprice></strong><span>/ night</span></p>
</div>
<p class="detail__meta" data-meta></p>
<div class="detail__foot">
<span class="detail__free">Free cancellation</span>
<span class="detail__book">Book this room</span>
</div>
</div>
<button class="close" type="button" aria-label="Close" data-close>
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M7 7l10 10M17 7 7 17"/></svg>
</button>
</div>
</template>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
<script src="script.js"></script>
</body>
</html>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.
14 values to change
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 “Rooms mosaic” from Animorio and fit it into my siteThe mosaic is not a CSS grid: each cell says which columns and rows it spans, and the script computes the position and size of every cell from the weights of the columns and rows, on every frame. Widening a photo means raising the weight of its column to 2.1 and of its row to 1.7: the others narrow by themselves, always touching, with no jumps.
GSAP animates the two lists of weights, index by index, with back.out: the chosen cell goes slightly past and comes back, and every update redraws the mosaic. The corners follow the shape: the smaller the cell, the tighter the radius.
Each photo is a real photo drawn into a canvas as large as the whole mosaic, plus a margin for the drift. Whenever its cell changes size the photo is redrawn to cover it, around a focus point chosen for each room (the tub, the bed, the table): so a small cell still shows the subject, the open room shows the whole photo, and the picture can follow the pointer without showing its edges.
In a wide box the mosaic has three columns and two rows, with the tall room on the left; in a tall box, like on a phone, it has two columns and three rows, with the wide room on top. On resize the mosaic is chosen again, measured and the photos redrawn.
| Name | File | Default | What it changes |
|---|---|---|---|
HOTEL | script.js | Wrenlow House | The made-up hotel’s name, written at the top. |
GROW | script.js | 2.1 | How much the chosen photo’s column widens compared with the others. |
GROW_ROW | script.js | 1.7 | How much the chosen photo’s row grows. |
SPRING | script.js | 0.8 | The seconds of the spring that reshapes the mosaic. |
PARALLAX | script.js | 16 | How many pixels the photo moves with the pointer: 0 no parallax. |
ACCENT | script.js | #c8553d | The accent colour. |
HOLD | script.js | 2.4 | The seconds the open room stays full size before the drawn pointer closes it. |
For the rooms page of a hotel, a B&B or a holiday home, or for a portfolio gallery: the mosaic shows everything at once and lets you look closely at one photo at a time without leaving the page.
The same mosaic, turned for the tall screen: two columns and three rows, with the wide room on top; tap a photo to widen and open it.
No spring and no movement: the cells change size at once, and captions, card and cross simply fade in.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 8.1 KB; the libraries: GSAP 28 KB.
Tested on 8 November 2026
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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.