Skip to content
animorio
IT
Back to the library

Letters from afar

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

The page transition of a made-up brand studio’s manifesto, on a warm white: the letters of the old sentence scatter into the depth, turning and blurring, and vanish; those of the new sentence arrive from scattered, faraway places and settle into place left to right on a spring, the key words landing last and slower. The paragraph comes in line by line and the nav indicator slides to the chosen page.

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>
<!--
  "Letters from afar" 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 page transition with letters arriving from afar</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>
  <main class="stage" data-stage>
    <!-- the manifesto of a made-up agency in three pages: changing page, the old sentence scatters into the depth and the
         new one arrives letter by letter from far away, settling left to right, the key words last -->
    <header class="top">
      <a class="marchio" href="#" aria-label="Merrow">Merrow<span class="marchio__sub">Brand studio</span></a>
      <nav class="nav" data-nav aria-label="Manifesto pages">
        <span class="nav__ind" data-ind aria-hidden="true"></span>
        <button class="nav__item" data-voce type="button">Fewer</button>
        <button class="nav__item" data-voce type="button">Slower</button>
        <button class="nav__item" data-voce type="button">Words</button>
      </nav>
    </header>

    <section class="pagina" data-pagina aria-live="polite">
      <p class="etichetta" data-etichetta>The manifesto</p>
      <h1 class="frase" data-frase></h1>
      <span class="riga" data-riga aria-hidden="true"></span>
      <p class="testo" data-testo></p>
    </section>

    <footer class="piede">
      <span class="piede__nota" data-nota>Use the arrows or pick a page</span>
      <span class="frecce">
        <button class="freccia" data-prev type="button" aria-label="Previous page"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M10 3.5 5.5 8l4.5 4.5"></path></svg></button>
        <button class="freccia" data-next type="button" aria-label="Next page"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M6 3.5 10.5 8 6 12.5"></path></svg></button>
      </span>
    </footer>

    <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.

18 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 “Letters from afar” 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, with a barely visible orange glow behind the middle, sits the manifesto of Merrow, a made-up brand studio, in three pages: Fewer, Slower and Words, the three items of the pill nav at the top right. Each page has a small orange label, a big sentence on two lines with the key words in orange, a thin line and a three-line grey paragraph. On opening and at every page change the letters of the sentence arrive from afar: they start scattered in the depth, turned and blurred, and settle into place one after the other from left to right, each on a spring that carries it a hair too far and sets it back; the key words wait a moment and land last, slower. Changing page, the letters of the old sentence come loose, fly into the depth turning and blurring and vanish while the new one arrives; the paragraph leaves upwards and the new one comes in line by line from below, the line withdraws to the right and draws itself again from the left, the label changes and the nav’s black pill slides to the chosen item. With the pointer the sentence leans a degree or two towards it. Pages change from the nav, the two arrows at the bottom right or the arrow keys; when nobody touches it, a drawn pointer goes to the next item and presses it.

How it works

One sentence, three levels

Each sentence is made of lines, words and letters, each in a span: the lines keep the line breaks, the words never split, the letters move on their own. The words between asterisks in PAGES become the key words, with the is-chiave class.

Real depth

The page has perspective 900px and lines, words and letters have transform-style preserve-3d: a negative z really sends the letter far away, smaller and drawn towards the middle, instead of just shrinking it.

From afar, scattered

Each letter starts from a random place: x and y up to almost half the screen, z between 45 and 100 percent of DEPTH, small rotations on the three axes, zero opacity and a BLUR pixel blur. It reaches zero with back.out(SPRING), which carries it a hair too far and sets it back.

The order of arrival

Normal letters start STAGGER seconds apart, left to right; those of the key words wait KEY_DELAY seconds more, start further apart and last 1.6 seconds instead of 1.05: the sentence reads first, then its weight arrives.

The old sentence coming loose

On change the old sentence leaves the flow (position absolute, exactly where it stood) and the new one takes its place: the two share the space for a moment without pushing each other. The old letters head for faraway places with power2.in, in scattered order, and the sentence is removed at the end.

Values to change

NameFileDefaultWhat it changes
PAGESscript.js'We make *fewer* things,|*better.*~*Slow* on the sketch,|*fast* on the build.~Every brand starts|with a *sentence.*'The sentences of the three pages: the tilde separates pages, the vertical bar breaks the line, the key words go between asterisks.
DEPTHscript.js1200How far into the depth the letters start and end, in pixels.
STAGGERscript.js0.028The seconds between one letter and the next as they land.
SPRINGscript.js1.15How much the letters bounce as they land (0 means no bounce).
BLURscript.js8How blurred the letters are when far away, in pixels.
KEY_DELAYscript.js0.2The extra seconds before the key words land.
DWELLscript.js3.2The seconds held on each page before the autopilot changes page.

Try them in the Playground

When to use it

For the page change of a studio, agency or brand site that speaks in sentences: a manifesto, the values, the method, a presentation page in chapters. It works where the sentence is the protagonist and the page has little else.

On phones

The same animation with adapted sizes: the sentence is measured on the width and height of the screen and stays on two lines, the letters start from scattered places within the small screen, the brand’s subtitle and the note at the bottom are hidden and the nav items tighten. Pages change with a tap on the nav or the arrows.

With reduced motion

No flying letters, no depth and no blur: sentence, label and paragraph swap with a cross-fade, the nav pill takes its new place at once and the sentence does not lean with the pointer.

Pitfalls

  • Without transform-style preserve-3d on lines and words, the letters’ translateZ flattens: perspective only applies to the direct children of the element that has it.
  • The old sentence must be lifted out of the flow exactly where it stood, measured before the new one is added: if both stay in the flow together, the new one arrives below the old and jumps up when it vanishes.
  • A blur filter on many letters at once is costly: here there are about forty per sentence and the blur ends before the motion does. For long sentences lower BLUR or remove it.
  • If the page changes halfway through an arrival, the running timeline must be taken to the end (progress(1)) before the new sentence is built, otherwise letters are left halfway.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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