Skip to content
animorio
IT
Back to the library

Jumping letters

Passing over the letters, each one does a cartoon jump: it squashes, rises, takes a colour and falls back with a bounce. Its neighbours make a wave.

Text, HoverGSAPEasyFree

The code

A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN.

<!doctype html>
<html lang="it">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Lettere che saltano</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>
  <main class="palco">
    <p class="sopra">Passa sulle lettere col mouse, o strisciaci sopra col dito</p>
    <h1 class="titolo" data-salta>
      <span class="riga">Lettere</span>
      <span class="riga">che saltano!</span>
    </h1>
    <p class="sotto">Ogni lettera si schiaccia, salta, prende un colore e ricade con un rimbalzo. Le vicine fanno l’onda.</p>
  </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/SplitText.min.js"></script>
  <script src="script.js"></script>
</body>
</html>

What it does

The title is split into letters. When the pointer enters a letter, it squashes and widens like a ball winding up, jumps, tilts a little at random and takes a colour; then it falls back on an elastic curve, wobbles two or three times and returns to its colour. The two neighbouring letters on each side rise slightly, a moment later, like a wave. With a finger, just swipe sideways across the title.

How it works

One letter, one element

SplitText splits the title into words and letters; every letter is an inline-block with its origin at the bottom centre, so squashing it keeps it sitting on the line.

Squash and stretch

First a short hit (0.16 s): scaleX 1.12 and scaleY 0.86 while it rises 20% of its height. It is the cartoon principle: weight shows in the moment the letter deforms.

The elastic fall

Then a full second of elastic.out(1, 0.32): the letter comes down, overshoots the line slightly and wobbles. The colour returns in parallel, a little slower.

The wave and the finger

The two neighbours on each side rise 8% and 3% with 50 and 100 milliseconds of delay, only within the same word. With a finger the touch stays captured by the first element: on every pointermove the letter under the finger is found with elementFromPoint.

Values to change

NameFileDefaultWhat it changes
COLORIscript.jsarancio, pesca, menta, verde acqua, gialloThe colours the jump picks at random.
SALTOscript.js-20How far the letter rises, as a percentage of its height.
INCLINAscript.js12The maximum rotation in degrees, in a random direction.
RIMBALZOscript.jselastic.out(1, 0.32)The fall: lower the second number for more wobbles.
RICHIAMOscript.js5How many seconds between automatic waves across the title when nobody touches it. Remove it if the title should stay still.

When to use it

For a big title with character: a portfolio, a playful brand, a sign. Not for text to be read: a jumping paragraph cannot be read.

On phones

Swipe sideways across the title with a finger and the letter under it jumps; tapping a letter makes it jump. The title still lets the page scroll vertically (touch-action: pan-y).

With reduced motion

The letters stay still.

Pitfalls

  • No hidden overflow on the lines: letters jump out of their line and would be clipped.
  • Split the title after document.fonts.ready: with the fallback font letters have different widths and the title shifts when the real one arrives.
  • Set overwrite auto on the timelines: passing back and forth over the same letter piles up jumps and the letter stays crooked.
  • With touch, pointerenter does not fire while the finger slides: the pointer is captured by the first touched element. Find the letter with elementFromPoint.

Libraries

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

Weight: 6.1 KB of our own files.

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