Skip to content
animorio
IT
Back to the library

Page into card

Transitions, ImagesGSAPAdvancedCompressed weight: Demo 7.4 KBGSAP + CustomEase 31 KBFreeDownload the zip

At the first scroll gesture the page shrinks into a card and four tall cards arrive above it; choose one and its page rises into the gap, then takes the whole screen.

Rebuilt from scratch studying realevate.agency by Or Halevi: the idea is theirs; code, copy and images are ours. Read how it’s made

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>
<!--
  "Page into 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="it">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>La pagina che diventa una carta</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/standard.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <svg class="disegni" aria-hidden="true" focusable="false" width="0" height="0">
    <defs>
      <symbol id="c-casa" viewBox="0 0 200 200">
        <rect width="200" height="200" fill="#E9E2D6" />
        <path d="M60 200 V98 a40 40 0 0 1 80 0 V200 Z" fill="#CFE0EA" />
        <circle cx="116" cy="122" r="11" fill="#F4D66A" />
        <path d="M60 150 H140 V200 H60 Z" fill="#2E6A93" />
        <path d="M60 200 V98 a40 40 0 0 1 80 0 V200" fill="none" stroke="#1D2340" stroke-width="7" />
      </symbol>
      <symbol id="c-mare" viewBox="0 0 200 200">
        <rect width="200" height="200" fill="#BFD6E4" />
        <circle cx="138" cy="62" r="24" fill="#F4D66A" />
        <path d="M0 118 Q25 106 50 118 T100 118 T150 118 T200 118 V200 H0 Z" fill="#2E6A93" />
        <path d="M0 140 Q25 128 50 140 T100 140 T150 140 T200 140 V200 H0 Z" fill="#1F4F76" />
        <path d="M0 162 Q25 150 50 162 T100 162 T150 162 T200 162 V200 H0 Z" fill="#163A58" />
      </symbol>
      <symbol id="c-bosco" viewBox="0 0 200 200">
        <rect width="200" height="200" fill="#DCE6D3" />
        <path d="M34 156 L66 62 L98 156 Z" fill="#3E7358" />
        <path d="M82 162 L124 38 L166 162 Z" fill="#2F5D46" />
        <path d="M132 166 L158 96 L184 166 Z" fill="#24493A" />
        <rect y="156" width="200" height="44" fill="#29402F" />
      </symbol>
      <symbol id="c-citta" viewBox="0 0 200 200">
        <rect width="200" height="200" fill="#E6DDE6" />
        <rect x="20" y="72" width="54" height="128" fill="#5A3D57" />
        <rect x="80" y="34" width="60" height="166" fill="#3A2438" />
        <rect x="146" y="94" width="40" height="106" fill="#6E4E6A" />
        <g fill="#E8C98A">
          <rect x="90" y="48" width="8" height="10" /><rect x="106" y="48" width="8" height="10" /><rect x="122" y="48" width="8" height="10" />
          <rect x="90" y="70" width="8" height="10" /><rect x="122" y="70" width="8" height="10" />
          <rect x="106" y="92" width="8" height="10" /><rect x="90" y="114" width="8" height="10" /><rect x="122" y="114" width="8" height="10" />
          <rect x="30" y="86" width="8" height="10" /><rect x="52" y="108" width="8" height="10" /><rect x="156" y="108" width="8" height="10" />
        </g>
      </symbol>
      <symbol id="c-deserto" viewBox="0 0 200 200">
        <rect width="200" height="200" fill="#F3DCC1" />
        <circle cx="64" cy="66" r="22" fill="#F8E6A6" />
        <path d="M0 132 C50 102 90 104 130 128 C160 146 184 140 200 132 V200 H0 Z" fill="#D9874F" />
        <path d="M0 162 C40 140 80 150 120 164 C150 174 180 166 200 158 V200 H0 Z" fill="#B7633A" />
      </symbol>
      <symbol id="s-casa" viewBox="0 0 40 40"><path d="M8 34 V18 L20 8 L32 18 V34 Z M16 34 V24 H24 V34" /></symbol>
      <symbol id="s-mare" viewBox="0 0 40 40"><path d="M4 20 q6 -6 12 0 t12 0 t12 0 M4 30 q6 -6 12 0 t12 0 t12 0" /></symbol>
      <symbol id="s-bosco" viewBox="0 0 40 40"><path d="M20 5 L33 30 H7 Z M20 30 V36" /></symbol>
      <symbol id="s-citta" viewBox="0 0 40 40"><path d="M6 35 V14 H18 V35 M18 35 V6 H32 V35 M4 35 H36" /></symbol>
      <symbol id="s-deserto" viewBox="0 0 40 40"><path d="M3 31 C13 22 22 22 37 31" /><circle cx="26" cy="13" r="5" /></symbol>
    </defs>
  </svg>

  <!-- il guscio non scorre mai: un gesto di scorrimento apre il mazzo, la pagina diventa una carta -->
  <main class="guscio" data-guscio>
    <section class="palco attivo" data-pagina="casa" style="--fondo: #F2F1EC; --testo: #1D2340" aria-label="Altrove">
      <p class="palco__marchio">Altrove</p>
      <div class="palco__centro">
        <div class="scorrevole" aria-hidden="true"><div class="scorrevole__binario"><span>Altrove</span></div></div>
        <div class="finestra" aria-hidden="true"><svg viewBox="0 0 200 200" preserveAspectRatio="xMidYMid slice"><use href="#c-casa" /></svg></div>
      </div>
      <div class="palco__piede">
        <p class="palco__frase">Case in quattro paesaggi.<br>Scorri, o scegli dove svegliarti.</p>
        <button class="scegli" type="button" data-apri>Scegli un paesaggio</button>
      </div>
    </section>
    <section class="palco" data-pagina="mare" style="--fondo: #1F3A5F; --testo: #F2F1EC" aria-label="Mare">
      <p class="palco__marchio">Altrove</p>
      <div class="palco__centro">
        <div class="scorrevole" aria-hidden="true"><div class="scorrevole__binario"><span>Mare</span></div></div>
        <div class="finestra" aria-hidden="true"><svg viewBox="0 0 200 200" preserveAspectRatio="xMidYMid slice"><use href="#c-mare" /></svg></div>
      </div>
      <div class="palco__piede">
        <p class="palco__frase">Sulla costa, con il vento che entra dalle finestre.</p>
        <button class="scegli" type="button" data-apri>Scegli un paesaggio</button>
      </div>
    </section>
    <section class="palco" data-pagina="bosco" style="--fondo: #2F5D46; --testo: #F2F1EC" aria-label="Bosco">
      <p class="palco__marchio">Altrove</p>
      <div class="palco__centro">
        <div class="scorrevole" aria-hidden="true"><div class="scorrevole__binario"><span>Bosco</span></div></div>
        <div class="finestra" aria-hidden="true"><svg viewBox="0 0 200 200" preserveAspectRatio="xMidYMid slice"><use href="#c-bosco" /></svg></div>
      </div>
      <div class="palco__piede">
        <p class="palco__frase">Fra gli alberi, dove la sera arriva prima.</p>
        <button class="scegli" type="button" data-apri>Scegli un paesaggio</button>
      </div>
    </section>
    <section class="palco" data-pagina="citta" style="--fondo: #3A2438; --testo: #F2F1EC" aria-label="Città">
      <p class="palco__marchio">Altrove</p>
      <div class="palco__centro">
        <div class="scorrevole" aria-hidden="true"><div class="scorrevole__binario"><span>Città</span></div></div>
        <div class="finestra" aria-hidden="true"><svg viewBox="0 0 200 200" preserveAspectRatio="xMidYMid slice"><use href="#c-citta" /></svg></div>
      </div>
      <div class="palco__piede">
        <p class="palco__frase">In alto, sopra i tetti e sotto le luci.</p>
        <button class="scegli" type="button" data-apri>Scegli un paesaggio</button>
      </div>
    </section>
    <section class="palco" data-pagina="deserto" style="--fondo: #B4552F; --testo: #FBF3EA" aria-label="Deserto">
      <p class="palco__marchio">Altrove</p>
      <div class="palco__centro">
        <div class="scorrevole" aria-hidden="true"><div class="scorrevole__binario"><span>Deserto</span></div></div>
        <div class="finestra" aria-hidden="true"><svg viewBox="0 0 200 200" preserveAspectRatio="xMidYMid slice"><use href="#c-deserto" /></svg></div>
      </div>
      <div class="palco__piede">
        <p class="palco__frase">Case di terra cruda, dove il sole cade tardi.</p>
        <button class="scegli" type="button" data-apri>Scegli un paesaggio</button>
      </div>
    </section>
    <div class="velo-scambio" aria-hidden="true"></div>

    <nav class="mazzo" data-mazzo aria-label="Paesaggi" hidden>
      <button class="carta" type="button" data-carta="mare" style="--tinta: #1F3A5F; --carta-testo: #F2F1EC">
        <span class="carta__pannello">
          <svg class="carta__segno" aria-hidden="true"><use href="#s-mare" /></svg>
          <span class="carta__nome">Mare</span>
          <span class="carta__testo">Case sulla costa,<br>con il vento in casa.</span>
        </span>
        <span class="carta__copertina" aria-hidden="true"><svg viewBox="0 0 200 200" preserveAspectRatio="xMidYMid slice"><use href="#c-mare" /></svg></span>
      </button>
      <button class="carta" type="button" data-carta="bosco" style="--tinta: #2F5D46; --carta-testo: #F2F1EC">
        <span class="carta__pannello">
          <svg class="carta__segno" aria-hidden="true"><use href="#s-bosco" /></svg>
          <span class="carta__nome">Bosco</span>
          <span class="carta__testo">Rifugi fra gli alberi,<br>lontano da tutto.</span>
        </span>
        <span class="carta__copertina" aria-hidden="true"><svg viewBox="0 0 200 200" preserveAspectRatio="xMidYMid slice"><use href="#c-bosco" /></svg></span>
      </button>
      <button class="carta" type="button" data-carta="citta" style="--tinta: #3A2438; --carta-testo: #F2F1EC">
        <span class="carta__pannello">
          <svg class="carta__segno" aria-hidden="true"><use href="#s-citta" /></svg>
          <span class="carta__nome">Città</span>
          <span class="carta__testo">Appartamenti in alto,<br>sopra i tetti.</span>
        </span>
        <span class="carta__copertina" aria-hidden="true"><svg viewBox="0 0 200 200" preserveAspectRatio="xMidYMid slice"><use href="#c-citta" /></svg></span>
      </button>
      <button class="carta" type="button" data-carta="deserto" style="--tinta: #B4552F; --carta-testo: #FBF3EA">
        <span class="carta__pannello">
          <svg class="carta__segno" aria-hidden="true"><use href="#s-deserto" /></svg>
          <span class="carta__nome">Deserto</span>
          <span class="carta__testo">Case di terra,<br>dove il sole cade.</span>
        </span>
        <span class="carta__copertina" aria-hidden="true"><svg viewBox="0 0 200 200" preserveAspectRatio="xMidYMid slice"><use href="#c-deserto" /></svg></span>
      </button>
    </nav>
  </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/CustomEase.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.

58 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 “Page into 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

The page does not scroll. The first wheel movement down, or the button, shrinks it: it rests at the bottom centre, as wide as two cards, and only its top shows. Four tall cards rise above it, one per landscape, each with its colour, a mark, its name standing up and two lines of text. Choose one and that landscape's page rises into the free gap while the old one darkens; then it grows to full screen, the cards fall back in reverse order and the old page drops away. The card of the landscape you are in becomes «Home» and takes you back to the first page.

How it works

Sizing the card

The shrunken page is as wide as two cards plus the gap between them: scale = (2 × card width + gap) / screen width. The transform origin is at the bottom centre, and the page moves down by (height × scale − free space under the deck): so only its top shows, exactly in the space that is left.

The cards arriving

The cards rise from yPercent 110 to 0 in 0.86 seconds, 47 milliseconds apart. Inside each one, a moment later, come the mark (from below), the name (from the right) and the text (from below), 35 milliseconds apart. Everything on the same curve, a cubic-bezier(0.7, 0.6, 0, 1) that starts slowly and brakes for a very long time.

The swap

The chosen page is born already at card scale but half a screen lower: it rises into the gap in half a second while a black veil over the old one reaches 0.5. Then, in one second, the new one goes back to scale 1, the old one drops and disappears, and the cards fall from the last to the first.

The word behind the window

Each page has a huge word scrolling forever behind a square window: side-by-side copies moving by one word and starting again. When the page becomes a card the word stops, and it starts again when the page returns.

Values to change

NameFileDefaultWhat it changes
DURATAscript.js1Seconds for the page to become a card and back.
SFASATURAscript.js0.047Seconds between one card and the next.
VELOscript.js0.5How dark the leaving page gets.
VELOCITAscript.js15Seconds for the big word to cross one screen.

Try them in the Playground

When to use it

As the main menu of a site with a few strong sections (collections, places, services): the menu becomes the site's most memorable gesture. Not for sites made for long reading.

On phones

The cards become four rows one below the other, the shrunken page takes the deck's width and shows below the last row. The deck opens with the button; outside an iframe also with a swipe up.

With reduced motion

No shrinking page and no scrolling word: the deck fades in over the page and the swap is a crossfade.

Pitfalls

  • Measure the deck through its container (the grid's getBoundingClientRect), not the cards: the cards are offset by yPercent and would give wrong sizes.
  • The shrunken page must stay under the deck and the new page above the old one: three layers (old, veil, new) and the deck above all, so the falling cards are visible.
  • If you turn the wheel into a menu, block it on the shell (non-passive wheel) and add a short pause between gestures, or a single trackpad swipe opens and closes in a row.
  • Inside an iframe on phones do not steal the finger from the page that contains it: there the deck opens only with the button.

Libraries

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

Compressed with gzip, the three demo files weigh 7.4 KB; the libraries: GSAP + CustomEase 31 KB.

Testing

Tested on 27 September 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: Done

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