Skip to content
animorio
IT
Back to the library

Squeezed title transition

Transitions, TextGSAP, CSS onlyMediumCompressed weight: Demo 8.2 KBGSAP 28 KBFreeDownload the zip

The page transition of an invented design studio’s work index, in the style of product components: you pick a project, the other rows slide away, the title squeezes on the font’s width axis, flies to the top and widens there into the page heading. Meanwhile a thin slit opens into two edges and reveals the project image. Index plays it all back the other way.

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>
<!--
  "Squeezed title 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>Ferrow Studio, selected work</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 index of an invented design studio: a project title squeezes on its width axis, a slit opens where it
       stood and becomes the project image, while the title flies to the top and widens into the page heading -->
  <main class="palco" data-palco>

    <section class="vista vista--indice" data-indice aria-label="Selected work">
      <header class="barra">
        <span class="marchio">
          <svg viewBox="0 0 20 20" aria-hidden="true"><path d="M3 17V3h14" /><path d="M3 10h9" /></svg>
          Ferrow Studio
        </span>
        <span class="barra-destra">Selected work, 2021 to 2026</span>
      </header>
      <ol class="righe" data-righe></ol>
    </section>

    <section class="vista vista--progetto" data-progetto aria-hidden="true">
      <header class="barra">
        <button class="indietro" type="button" data-indietro aria-label="Back to the index">
          <span class="indietro-freccia"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M10 3.5 5.5 8l4.5 4.5" /></svg></span>
          <span>Index</span>
        </button>
        <span class="barra-destra" data-pezzo>Ferrow Studio</span>
      </header>
      <h1 class="titolo-progetto" data-titolo></h1>
      <dl class="dati" data-dati>
        <div data-entra><dt>Client</dt><dd data-cliente></dd></div>
        <div data-entra><dt>Year</dt><dd class="num" data-anno></dd></div>
        <div data-entra><dt>Role</dt><dd data-ruolo></dd></div>
      </dl>
      <figure class="immagine" data-immagine>
        <div class="immagine-dentro" data-arte></div>
        <figcaption class="didascalia" data-entra data-didascalia></figcaption>
      </figure>
    </section>

    <div class="fessura" data-fessura aria-hidden="true"><span class="bordo bordo--s" data-bordo></span><span class="bordo bordo--d" data-bordo></span></div>
    <span class="volo" data-volo aria-hidden="true"></span>

    <svg class="puntatore" data-puntatore viewBox="0 0 24 24" aria-hidden="true">
      <path d="M5 3.5v15.2l4.1-3.9 2.7 6.2 2.6-1.1-2.7-6.1 5.7-.3z" />
    </svg>
  </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.

21 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 “Squeezed title 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 white background there is Ferrow Studio’s work index: at the top the logo and “Selected work, 2021 to 2026”, below five projects in rows split by thin lines (Saltmarsh, Kiln House, Northbound, Ostra, Lumen Hall), each with its name large in a variable sans and, on the right, the role and the year. Hovering a row its name widens with a spring and the others fade. On click the other rows slide away, the closest first, the lines retract, and the chosen name squeezes and gets heavier, flies to the top still narrow and widens there into the page heading. In the middle of the image a dark terracotta line drops and opens into two edges, and between them the project image appears: a terracotta ground with a few drawn shapes (arches, pots, rails, shells, windows) rising into place one after another. Last come Index, client, year, role and the caption. Index makes the trip back to the right row. A drawn pointer opens two projects on its own.

How it works

One copy that flies

The row name and the page heading are two different elements. On click both are measured against the stage, hidden, and a single copy of the text appears above the page, starting from the row at its font size and arriving at the heading’s place at the big size.

Squeezing with the variable font

Mona Sans has a width axis from 75 to 125. The copy has font-variation-settings bound to two CSS variables, --wdth and --wght, and GSAP animates the variables: first to 75 and 760 (narrow and heavy), then, two thirds into the flight, to 125 and 600. The title squeezes to leave and widens to arrive.

The slit

The image starts with clip-path inset(0 50% 0 50%), a zero-width line in the middle. Two thin edges drop at that same spot with scaleY, then the inset goes to zero and the edges run left and right with the same expo.inOut curve: they seem to be the ones opening the photo.

The way back

Index does the same in reverse: the page leaves, the slit closes and the edges rise, the title squeezes at the top, returns to the row measured again and widens there to 100 with a small bounce, while the other rows spring back, the closest first.

Values to change

NameFileDefaultWhat it changes
STRINGIscript.js75How much the title squeezes on the width axis, from 75 (fully narrow) to 100.
VIAGGIOscript.js0.9How long the title’s flight to the top of the page lasts, in seconds.
APERTURAscript.js0.85How long the slit takes to open across the whole image, in seconds.
FUGAscript.js34How many pixels the other rows slide away.
SFALSAscript.js0.05The delay between one row and the next, and between the pieces of the incoming page, in seconds.
SOSTAscript.js2.4How long the project stays open in the automatic tour, in seconds.

Try them in the Playground

When to use it

For the portfolio of a studio, a photographer or an agency where the work index is made of names: the chosen name becomes the page heading, so the viewer never loses the thread. It also suits a magazine archive or a gallery catalogue.

On phones

The same transition, with sizes taken from the height too: row names with min(vw, vh), the big heading recalculated so it always fits on one line, the image taking the space that is left. On short screens the role in the rows hides. A tap opens the row like a click.

With reduced motion

No flight and no slit: the index fades out and the project page fades in already in place, and Index does the same the other way. The automatic tour does not start.

Pitfalls

  • The big heading must be measured after filling it and with the page shown (even if transparent): with visibility hidden the size exists, with display none it does not.
  • The flying copy must carry the same axes as the name it leaves: if the row was hovered at 112, the flight starts at 112, otherwise the name jumps on click.
  • GSAP animates CSS variables only when they are set on the element: --wdth and --wght live in the CSS of the copy and the heading, and font-variation-settings reads them.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 29 October 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