Skip to content
animorio
IT
Back to the library

Print grid transition

Transitions, HoverGSAP, CSS onlyMediumCompressed weight: Demo 12 KBGSAP 28 KBFreeDownload the zip

The shop window of a made-up art print shop, Halden Editions: six abstract prints of ours, framed in oak, in a grid on a warm gallery white. On hover a band of gallery light slides across the glass and the frame lifts a little off the wall; pick a print and it leaves the grid with a FLIP and flies to its own page, growing, while the passe-partout widens, a pencil signature writes itself on the mat, the others step back and fade, and the artist, the title, the sizes, the price and the measuring rules arrive. «All prints» puts it back in its place in the grid. Premium minimal style.

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>
<!--
  "Print 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 print grid that becomes the print page, with the mat that widens</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/fraunces@5.3.0/full.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="shop" data-shop>
    <!-- the shop window of a made-up print studio, Halden Editions: six framed abstract prints of ours in a grid. Hover one
         and a band of gallery light slides across its glass; pick one and the print leaves the grid (FLIP), flies to the
         page of the print, its mat widens to a deep passe-partout, the others step back and fade, and the title, the
         artist, the sizes and the price arrive. All prints puts it back in its place in the grid -->
    <header class="top">
      <span class="brand">
        <svg class="brand__mark" viewBox="0 0 20 20" aria-hidden="true">
          <rect x="3" y="2.5" width="14" height="15" rx="0.6" />
          <rect x="6.2" y="5.7" width="7.6" height="8.6" />
        </svg>
        <span class="brand__name">Halden</span>
        <span class="brand__sub">Editions</span>
      </span>
      <nav class="nav" aria-label="Shop">
        <span class="nav__item nav__item--on">Prints</span>
        <span class="nav__item">Artists</span>
        <span class="bag" data-bag aria-live="polite">
          <svg class="bag__icon" viewBox="0 0 20 20" aria-hidden="true">
            <path d="M4.5 7h11l-1 10h-9z" />
            <path d="M7.5 7V5.8a2.5 2.5 0 0 1 5 0V7" />
          </svg>
          <span class="bag__count"><span class="bag__num" data-count>0</span></span>
        </span>
      </nav>
    </header>

    <section class="grid" data-grid aria-label="Prints"></section>

    <section class="detail" data-detail aria-label="Print" aria-hidden="true">
      <div class="detail__stage">
        <div class="slot" data-slot>
          <span class="rule rule--w" data-rule-w aria-hidden="true">
            <span class="rule__line"></span>
            <span class="rule__label" data-rule-w-label>30 cm</span>
          </span>
          <span class="rule rule--h" data-rule-h aria-hidden="true">
            <span class="rule__line"></span>
            <span class="rule__label" data-rule-h-label>40 cm</span>
          </span>
        </div>
      </div>
      <div class="panel" data-panel>
        <p class="eyebrow" data-in><span data-artist>Anouk Varel</span><span class="eyebrow__year" data-year>2025</span></p>
        <h2 class="title"><span class="title__line"><span class="title__in" data-title>Three Arches</span></span></h2>
        <p class="desc" data-in>Gicl&eacute;e on 310 gsm cotton rag. Edition of 50, signed and numbered by hand.</p>
        <div class="sizes" role="radiogroup" aria-label="Size" data-in data-sizes>
          <span class="sizes__pill" data-pill aria-hidden="true"></span>
          <button class="size" type="button" role="radio" aria-checked="true" data-size="0">30&#8239;&times;&#8239;40</button>
          <button class="size" type="button" role="radio" aria-checked="false" data-size="1" data-autoclic>50&#8239;&times;&#8239;70</button>
          <button class="size" type="button" role="radio" aria-checked="false" data-size="2">70&#8239;&times;&#8239;100</button>
        </div>
        <div class="buy" data-in>
          <span class="price" aria-live="polite"><span class="price__cur">&euro;</span><span class="price__digits" data-price></span></span>
          <button class="add" type="button" data-add data-autoclic>
            <span class="add__bg" aria-hidden="true"></span>
            <span class="add__sheen" aria-hidden="true"></span>
            <span class="add__text" data-add-text>Add to bag</span>
            <svg class="add__tick" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8.4 6.6 11.4 12.6 4.8" /></svg>
          </button>
        </div>
        <p class="ship" data-in>Framed in oak, ready to hang. Ships in 4 days.</p>
        <!-- last in the page, so the autopilot clicks it after the size and the bag; CSS puts it on top -->
        <button class="back" type="button" data-back data-autoclic>
          <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M10 3.5 5.5 8l4.5 4.5" /></svg>
          <span>All prints</span>
        </button>
      </div>
    </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.

39 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 “Print 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 warm gallery white, with a pale light falling from the top and a very fine paper grain, sits the shop window of Halden Editions: the header with the brand, «Prints», «Artists» and the bag with its small terracotta count, and under it six abstract prints in oak frames with their mats: Low Sun, Three Arches, Tide Lines, Quiet Grid, Half Moon Garden and Red Ridge, each with its title in a light serif and «from €…». On load the prints rise one after another and a light passes over each glass. On hover the frame comes a few pixels off the wall on a spring, the shadow under it widens, it leans slightly towards the pointer and a band of gallery light slides across the glass. On click the print leaves the grid: a copy of the frame starts exactly where it was and flies to the empty place of the page, growing; meanwhile the passe-partout widens from a thin strip to a deep margin, the light crosses the glass and a pencil signature writes itself on the mat. The other prints step back, move a little away and fade out as they blur, the nearest first. The frame lands with a pixel of bounce, and in come the «All prints» button, the artist with the year, the big title rising from a slit, the line about the paper, the three sizes in a pill, the price and «Add to bag», while two terracotta rules draw themselves beside and under the frame. A size slides the pill on a spring, rolls the digits of the price and changes the centimetres on the rules. «Add to bag» gives, draws a tick, says «Added» and the bag count goes up with a hop. «All prints» brings the print back to its place in the grid, the passe-partout narrows and the others come forward on a small spring.

How it works

The prints, drawn by us

Each print is an SVG on a 120 by 160 sheet with preserveAspectRatio slice, inside three boxes: the frame (the oak padding with its grain in a repeating-linear-gradient), the passe-partout (the paper coloured padding) and the bevelled cut (two one pixel box-shadows). Every size is a share of the frame width, in a --w variable, and the passe-partout is --w times --matk.

The FLIP by hand

On click the frame in the grid is measured (the first position) and so is the empty place of the page (the last), the frame is cloned into a layer above everything, set exactly on the first, the original is hidden and GSAP brings left, top, width, height and --w to the last with expo.inOut. No scale: the frame really grows, so the wood stays thin and does not stretch.

The passe-partout that widens

In the same flight --matk goes from 0.075 to 0.15 of the width, starting a little later: the print inside gets smaller while the frame grows, and it reads as a margin opening up. Near the end the pencil signature writes itself with stroke-dashoffset, and on arrival the frame rises two pixels and drops back with elastic.out.

The others step back, the nearest first

For every other print the distance in cells from the chosen one is worked out: it shrinks to 0.86, moves ten pixels per cell away from it, fades and blurs, with a delay that grows with the distance. On the way back the same in reverse, with back.out(1.5) and the farthest first, so they all land together with the print.

The page arriving

The title rises from a slit (overflow hidden and yPercent), the artist and the lines arrive staggered, the rules draw themselves with scale from zero and the size pill is a single element GSAP moves under the chosen button. The price digits are columns from zero to nine that roll with a small delay from right to left.

The light on the glass

Over the print sits a glass with a still diagonal reflection and a skewed band of light with mix-blend-mode screen: on hover GSAP slides it from left to right, while the frame lifts with back.out and leans towards the pointer with a rotationX and rotationY of a few degrees.

Values to change

NameFileDefaultWhat it changes
OPENscript.js1.05Seconds for the print to fly from the grid to its page (and back).
MAT_GRIDscript.js0.075Width of the mat in the grid, as a share of the frame.
MAT_PAGEscript.js0.15Width of the passe-partout on the page of the print.
STEP_BACKscript.js0.86How small the other prints get as they step back.
BLURscript.js6Blur of the other prints as they fade, in pixels.
STAGGERscript.js0.05Seconds between two prints stepping back or coming forward.
GLINTscript.js0.95Seconds for the light to slide across the glass.
LIFTscript.js4How far a hovered print comes off the wall, in pixels.
PANEL_DELAYscript.js0.55Seconds after the flight starts when the words of the page arrive.

Try them in the Playground

When to use it

For the step from the shop window to a product page in a shop of prints, posters, paintings, photographs or ceramics; for the gallery of an artist, a photographer or a museum opening a work; for a portfolio where the project leaves the grid and becomes its own page without losing the thread.

On phones

The same animation with adapted sizes: grid, frames, the place on the page and the type are measured on the width and on the height (min of vw and vh), and on a phone held upright the page puts the print on top and the words under it. The flight is measured on click, and if the window changes size while the page is open the print goes back onto its place. On touch there is no hover light: the light passes over the glass as the print leaves.

With reduced motion

No flight and no movement: the grid fades out, the print appears already large on its page with the wide mat and the signature, and the words fade in; on the way back the same in reverse. The price changes with a fade.

Pitfalls

  • A FLIP with scale stretches the frame: the wood and the mat would grow as thick as the enlarged print. Here the copy really grows in width and height, and every size inside is a share of --w, which GSAP animates along with it.
  • The first position is measured on the frame of the chosen print, which never moves: only the others step back. So on the way back its position is still the true one, even with the others shrunk.
  • Clicking while the prints are still rising on load, that tween would bring the chosen print’s caption back: on click the tweens of the arrival are stopped (killTweensOf).
  • The shadow under the chosen print must be hidden too, or a grey smudge stays where the frame was, next to the page.
  • The autopilot clicks the data-autoclic elements in page order: the «All prints» button is written last in the panel and CSS brings it to the top with order: -1.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, Fraunces (font variabile) 5.3.0.

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

Testing

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