Skip to content
animorio
IT
Back to the library

Rooms grid transition

Transitions, HoverGSAPMediumCompressed weight: Demo 12 KBGSAP + Flip 37 KBFreeDownload the zip

The smart home app of Wenlo Home, a made-up brand: a grid of four rooms, each with its own line floor plan seen from above, the lights on and the temperature. Tap a room and its tile grows into the room page (Flip), the floor plan grows with it, the other tiles step aside and fade and the lights switch on one after the other as circles of warm light on the plan, each with a small flare that settles. The title, the brightness and the «Evening» and «Focus» scenes arrive; back does the gesture in reverse and the tile shows the lights now on. On a near black page, one amber accent.

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>
<!--
  "Rooms grid transition" 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 rooms grid to room transition with the lights that switch on</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/geist-mono@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage" data-stage>
    <!-- the app of a made-up smart home brand, Wenlo Home. The rooms grid: tap a room and its tile grows into the
         room page (Flip), the floor plan grows with it and the lights on the plan switch on one after the other as
         circles of warm light. Back does the gesture in reverse and the tile shows the lights now on -->
    <section class="app" data-app aria-label="Wenlo Home">
      <span class="app__rim" aria-hidden="true"></span>

      <div class="home" data-home>
        <header class="home__head" data-head>
          <span class="brand">
            <svg class="brand__mark" viewBox="0 0 22 22" aria-hidden="true">
              <path d="M3.5 10.2 11 4l7.5 6.2V18a.8.8 0 0 1-.8.8H4.3a.8.8 0 0 1-.8-.8Z"/>
              <path d="M8.4 18.8v-4.6a2.6 2.6 0 0 1 5.2 0v4.6"/>
            </svg>
            <span class="brand__name">Wenlo Home</span>
          </span>
          <h1 class="home__title">Good evening</h1>
          <p class="home__sum"><span class="roll" data-sum></span> lights on across 4 rooms</p>
        </header>
        <div class="grid" data-grid></div>
      </div>

      <section class="room" data-room aria-label="Room" hidden>
        <header class="room__bar" data-fade>
          <button class="back" type="button" data-back aria-label="Back to rooms">
            <svg viewBox="0 0 20 20" aria-hidden="true"><path d="M12.2 4.6 6.8 10l5.4 5.4"/></svg>
          </button>
          <h2 class="room__title" data-room-title></h2>
          <span class="room__temp" data-room-temp></span>
        </header>
        <p class="room__meta" data-fade><span class="roll" data-room-count></span><span data-room-of></span></p>
        <div class="room__plan" data-room-plan-box></div>
        <div class="dim" data-fade>
          <div class="dim__top">
            <span class="dim__label">Brightness</span>
            <span class="dim__value" data-dim-value>0%</span>
          </div>
          <div class="dim__track" data-dim role="slider" tabindex="0" aria-label="Brightness" aria-valuemin="5" aria-valuemax="100">
            <span class="dim__fill" data-dim-fill></span>
            <span class="dim__thumb" data-dim-thumb></span>
          </div>
        </div>
        <div class="scenes" data-fade>
          <span class="scenes__pill" data-scene-pill aria-hidden="true"></span>
          <button class="scene" type="button" data-scene="evening">
            <svg viewBox="0 0 20 20" aria-hidden="true"><path d="M15.4 12.4A6.2 6.2 0 0 1 7.6 4.6a6.2 6.2 0 1 0 7.8 7.8Z"/></svg>
            <span>Evening</span>
          </button>
          <button class="scene" type="button" data-scene="focus">
            <svg viewBox="0 0 20 20" aria-hidden="true"><circle cx="10" cy="10" r="6.2"/><circle cx="10" cy="10" r="2.4"/></svg>
            <span>Focus</span>
          </button>
        </div>
      </section>
    </section>

    <svg class="cursor" data-cursor viewBox="0 0 24 24" aria-hidden="true"><path d="M5 2.8v16.4l4.2-4 2.8 6.2 2.9-1.3-2.8-6.1h5.9Z"/></svg>
  </main>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/Flip.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.

28 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 “Rooms grid transition” 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 near black page with a warm haze sits the app of Wenlo Home: the mark with the amber little house, «Good evening» and the line with how many lights are on at home. Below, a grid of four tiles, Living room, Kitchen, Bedroom and Studio: in each the floor plan of the room seen from above, with the walls, the door swinging on its arc, the window, the sofa, the bed, the kitchen island, and the lamps as small circles; the ones on are amber with a circle of warm light under them. Under the plan the name, «2 of 4 on» and the temperature in mono. On arrival the tiles rise staggered and the lights that are on switch on. Under the pointer a tile catches the light where the pointer is, the plan lines brighten and the little arrow slides into the corner; pressing it sinks. Tapped, the tile grows until it fills the app and becomes the room page, its corners rounding like the app’s; the plan grows from its place to the middle of the page, the other tiles step away from it and fade, the greeting at the top leaves. As soon as the page is still, the lights of the room switch on one after the other: the lamp swells and returns, the circle of light blooms a little too bright and settles, and the number of lights rolls up. Meanwhile the back button, the title, the temperature, the brightness slider and the two scenes, «Evening» and «Focus», rise in. A scene slides the amber pill with a small squash, switches the lights of the scene off or on one after the other, brings the brightness to its value and changes the colour of the light, warmer in the evening and paler to focus. A lamp on the plan can be tapped too. Going back, the page shrinks into its tile, the others come back on a small spring and the tile rolls to the number of lights on now. Left alone, a pointer opens a room, raises the brightness, picks a scene, goes back and opens another.

How it works

The line plans

Each room is an object with the SVG paths of its plan in a 160 by 120 viewBox: the walls with the gaps of the door and the window, the door arc, the furniture, the dashed rug, and the position and radius of each lamp. The same function draws the small plan of the tile and the big one of the page; each circle of light is a circle with a four stop radialGradient and mix-blend-mode: screen, under the furniture lines.

The tile that becomes the page

The tile and the page share the same data-flip-id, and so do the two plans. Flip.getState takes the tile and the small plan, the tile hides with visibility (its place in the grid stays), the page appears over the whole app and Flip.from(state, { targets: [page, plan], nested: true, absolute: true, props: "borderRadius" }) starts it from the tile in 0.85 s on power4.inOut. Each tile has its own grid-area, so when one turns absolute during the Flip the others do not move.

The others step aside

For each other tile the distance from the centre of the chosen one is measured and the tile moves away by 12% of it, to scale 0.92, while it fades; the further it is, the later it starts. On the way back they return on back.out(1.4), 0.04 s apart.

The light switching on

At the end of the Flip the lamps that are on switch on 0.16 s apart: the lamp turns amber and goes from scale 1.6 to 1 on elastic.out, the circle of light goes from scale 0.35 to a little past its size with an opacity 25% higher in 0.3 s, then settles in 0.8 s on power3.out. Opacity and size of the circle follow the brightness; the number of lights rolls up at every one.

Brightness and scenes

The brightness slider is dragged with the pointer (setPointerCapture) or the arrow keys and changes the lit circles and the warm haze of the page at once. A scene tweens the brightness to its value, changes the stop-color of the gradient stops in 0.8 s, switches on in a row the lights it needs and switches off the others; the amber pill slides under it on back.out with an elastic squash. Tapping a lamp or moving the brightness deselects the scene.

The way back and the walk on its own

Going back, the page fades its controls, takes its state and runs Flip.from towards the tile, which already has the plan with the lights as they are now; name and rows come back at the end and the number rolls. On its own, a GSAP timeline moves a fake pointer: it opens a room, drags the brightness, picks the scene that is not on, goes back and opens the next room; every round the two rooms change.

Values to change

NameFileDefaultWhat it changes
OPENscript.js0.85Seconds the tile takes to grow into the room page.
CLOSEscript.js0.8Seconds the page takes to shrink back into its tile.
IGNITE_GAPscript.js0.16Seconds between one light switching on and the next.
FLAREscript.js1.25How much brighter the circle of light blooms before it settles (1 = none).
PUSHscript.js0.12How far the other tiles step aside, as a share of their distance.
SPRINGscript.js1.4The spring of the tiles coming back and of the scenes pill (0 = none).
IDLEscript.js1.6Seconds before the pointer walks the app by itself.
LOOPscript.jstrueLeft alone, it opens the rooms again and again.

Try them in the Playground

When to use it

For the app or dashboard of a smart home, a home automation or a lighting system, and in general whenever a grid of tiles leads to the detail of one of them: hotel rooms, office areas, warehouse zones. The gesture of the tile becoming the page keeps the eye on the thing chosen.

On phones

The same animation with adapted sizes: the app is at most 66% of the height wide and everything inside is measured in container units (cqw, cqh), so the grid and the page fit the phone box. A finger taps a room, a scene, a lamp on the plan or drags the brightness.

With reduced motion

No Flip and no moving tiles: the room page fades in and out, the lights fade on without growing, the tiles fade away and back. No pointer on its own.

Pitfalls

  • With an auto placed grid, the tile turning absolute during the Flip leaves a hole and the others slide into it: each tile has its own grid-area, and the chosen one hides with visibility, not display.
  • The Flip of the plan sits inside the Flip of the page: without nested: true the plan would take the movement of the page twice and land out of place.
  • The small tile and the page are two different elements with the same data-flip-id: to go back the state of the page is taken and Flip.from runs on the tile, not the other way round.
  • The name and rows of the tile would sit at the top of a box as big as the app on the way back: they hide and come back when the tile has almost arrived.
  • GSAP writes its transform inline: the hover of the tile uses no transform in CSS (the Flip would wipe it), only the light, the lines and the little arrow, and the press is done by GSAP.
  • Each plan has its own radialGradient with a different id for the tile and the page, so the colour of the scene changes in the page without touching the tile until you go back.

Libraries

GSAP 3.15.0, GSAP Flip 3.15.0, Mona Sans (font variabile) 5.3.0, Geist Mono (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 12 KB; the libraries: GSAP + Flip 37 KB.

Testing

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