Skip to content
animorio
IT
Back to the library

Long shadow letters

Text, Scroll, 3DGSAPMediumCompressed weight: Demo 4.3 KBGSAP + ScrollTrigger + SplitText 49 KBFreeDownload the zip

Scroll inside the preview

A word standing on the ground line, casting its shadow in perspective. The mouse turns the sun, scrolling stretches the shadow.

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>
<!--
  "Long shadow letters" 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>Lettere in piedi con l'ombra lunga</title>
  <!-- Mona Sans ha l'asse della larghezza (wdth 75-125): serve per allargare le lettere.
       In produzione scarica il font e servilo dal tuo dominio. -->
  <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>
  <main class="corsa">
    <div class="palco">
      <div class="cielo" aria-hidden="true"></div>
      <div class="sole" aria-hidden="true"></div>
      <div class="terra" aria-hidden="true"></div>

      <!-- l'ombra: la stessa parola, capovolta, su un piano ruotato in 3D attorno alla linea di terra -->
      <div class="piano-vista" aria-hidden="true">
        <div class="piano">
          <p class="parola parola--ombra"><span class="parola__testo">Piazza</span></p>
        </div>
      </div>

      <h1 class="parola parola--luce"><span class="parola__testo">Piazza</span></h1>
    </div>
  </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/ScrollTrigger.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/SplitText.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.

22 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 “Long shadow letters” 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 word stands on a plane and casts a long shadow towards the viewer. The shadow turns with the sun: the mouse moves the sun by a few degrees, scrolling takes it towards evening, the shadows grow longer and the letters widen along the font's width axis.

How it works

Two copies of the word

The visible word and its shadow are two elements with the same text. The shadow lives inside a plane (.piano) rotated 72 degrees around the ground line, inside a container with perspective.

The baseline

A zero-height inline element (.base-misura) placed at the end of the text tells where the baseline falls. The word is moved until its baseline sits on the ground line, and the shadow starts exactly there.

The sun becomes a transform

The sun's elevation gives the shadow length (1 / tan(el)), its direction gives the slant (atan(tan(az))). The result is skewX(slant) scaleY(-length) on the shadow.

Scroll and mouse

A scroll-linked tween moves one value from 0 to 1: the sun's elevation, its direction, the sky colours and the letter width all come from it. The mouse adds a few degrees with gsap.quickTo.

One update per frame

Every change marks the scene as dirty; a function on the GSAP ticker redraws it once per frame.

Values to change

NameFileDefaultWhat it changes
LARGHEZZAscript.js0.84How much of the screen width the word takes.
BASEscript.js0.72Where the ground line falls, as a fraction of the height.
MATTINO / SERAscript.js38° / 8°Sun elevation and direction at the start and end of the scroll. Below 10 degrees the shadows get very long.
WDTHscript.js84, 122Letter width on the wdth axis, at the start and at the end. It needs a variable font with a width axis.
--ombra, --ombra-forzastyle.css#0b3b39, 0.52Shadow colour and strength. A dark colour from your palette works better than black.
.corsa heightstyle.css280vhHow far you scroll to bring the sun to evening.

Try them in the Playground

When to use it

A short, important name, at the top or in the footer of a page. Not for long text: the effect carries one word, two short ones at most.

On phones

Without a mouse the sun breathes on its own, back and forth, and stops when the scene leaves the screen. Scrolling works the same.

With reduced motion

Everything holds still: the sun stays in the afternoon, letters and shadow are already in place and scrolling changes nothing.

Pitfalls

  • Measure only after document.fonts.ready: before that the font is not loaded and the baseline is wrong.
  • Size the text on the word at its widest, otherwise it runs off screen as it widens.
  • Letters rise with scaleY: each letter's transformOrigin must sit on the baseline, not in the middle.
  • The shadow uses mix-blend-mode: multiply. On a very dark background pick a lighter shadow colour or drop the blend.

Libraries

GSAP 3.15.0, ScrollTrigger 3.15.0, SplitText 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 4.3 KB; the libraries: GSAP + ScrollTrigger + SplitText 49 KB.

Testing

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