Skip to content
animorio
IT
Back to the library

Leaning letters headline

Text, HoverGSAP, CSS onlyEasyCompressed weight: Demo 4.3 KBGSAP 28 KBFreeDownload the zip

A minimal text animation with a single gesture: every letter of the headline leans from its foot toward the pointer, like a stem toward the light, and stands back up on a spring when the pointer moves away. The nearest letter takes the accent colour and a touch of weight, and a short mark slides along the rule and stops under it.

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>
<!--
  "Leaning letters headline" 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 headline that leans toward you</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="scena" data-stage>
    <p class="marchio">Alder Type Foundry</p>
    <!-- the headline: the script splits it into letters, each one leaning from its own foot toward the pointer -->
    <h1 class="titolo" data-title aria-label="Toward the light">Toward the light</h1>
    <!-- the thin rule under the headline, with the short accent mark that slides under the nearest letter -->
    <div class="riga" data-rule><span class="tacca" data-mark></span></div>
    <p class="nota" data-note>Move the pointer over the letters</p>
  </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.

16 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 “Leaning letters headline” 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 warm white there is the headline Toward the light of a made-up type foundry, Alder Type Foundry, large in Mona Sans, with a thin rule underneath. The letters come in rising from the rule one after the other with a little bounce. Then, wherever the pointer goes, every letter leans from its foot toward it: the near ones more, up to 14 degrees, the far ones barely, and the one right under the pointer stays straight. Each one has its own spring, so when the pointer leaves they stand back up with a small sway, one after the other. The nearest letter turns orange and gains a touch of weight, and an orange mark slides along the rule and stops under it. A click or a tap sends a ripple: the letters bow away from that point, the near ones first and then the far ones, and come back up. Left alone, an invisible pointer strolls slowly over the headline.

How it works

One letter, two elements

The headline is split into words and letters. Each letter sits inside a box: GSAP moves the box for the entrance, CSS rotates the letter with rotate(var(--a)). That way the GSAP transform never wipes out the rotation.

Toward the pointer

For each letter the distance from the pointer is measured: the pull falls off like a bell, exp(-d²/R²), with R equal to REACH times the letter height. The angle follows the horizontal distance, clamped to plus or minus LEAN: zero over the letter, strongest a little to the side.

A spring per letter

Each letter has an angle and a velocity and chases the wanted angle on a spring (SPRING and DAMPING) in the GSAP ticker. The pivot sits at 92% of the height, on the letter’s foot: it leans like a stem instead of spinning on its centre.

The accent and the mark

The same pull sets the colour, with color-mix between the ink and the orange, and the weight, from 640 to 740. The mark on the rule chases the nearest letter on its own spring and fades when none is close.

The ripple of a click

A click gives each letter a push away from the point, delayed by distance: the spring does the rest.

Values to change

NameFileDefaultWhat it changes
TITLEscript.jsToward the lightThe headline.
LEANscript.js14How far a letter leans at most, in degrees.
REACHscript.js1.9How far the pull reaches, in letter heights.
SPRINGscript.js170How stiff the letters are.
DAMPINGscript.js13How quickly the swing dies down.
ACCENTscript.js1How much the nearest letter takes the accent.
RIPPLEscript.js1The strength of the click ripple.
SPEEDscript.js1The speed of the invisible pointer.

Try them in the Playground

When to use it

For the opening of a type foundry, a studio or a portfolio, for a headline that should answer whoever passes by without filling the page.

On phones

The same animation with adapted sizes: the headline breaks onto two lines and the letters lean toward the finger as it touches or slides.

With reduced motion

The letters stay upright: only the colour of the nearest letter changes softly, and the mark moves without a spring.

Pitfalls

  • The rotation goes on the letter and the entrance on its box: with a GSAP transform on the same letter, the CSS rotate disappears.
  • Letter positions are measured at zero rotation, and again on resize and once the font has loaded.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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