Skip to content
animorio
IT
Back to the library

Marquee that speeds up with scroll

An endless ribbon of words: scrolling speeds it up and tilts it in the direction of travel, and you can grab it and throw it.

Scroll, Text, HoverGSAPMediumLifetime

Scroll inside the preview

The code

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

The code for this animation is part of lifetime access.

The preview stays open: watch it, slow it down, try it on your phone.

Lifetime access

What it does

Two ribbons of words run on their own in opposite directions, one solid and one outlined. When you scroll the page they pick up speed and tilt, then slowly return to their cruising pace. With a mouse or a finger you can grab them, drag them and throw them: the push fades by itself.

How it works

One piece and its copies

The first .pezzo is copied until the track is at least twice the screen width plus one piece: there is always text on the right.

A position that wraps

The x position grows forever and gsap.utils.wrap brings it back between minus one piece width and zero. The jump back lands on an identical copy, so it cannot be seen.

The scroll push

A ScrollTrigger with no animation reads the page velocity (getVelocity). Part of it becomes extra speed, which the brake brings back to zero every frame.

The tilt

skewX follows the velocity with a soft delay (it closes 12% of the gap each frame): the ribbon leans as if it had weight.

Grab and throw

With setPointerCapture the drag continues outside the ribbon; on release the speed of the last move becomes a throw that fades out.

Values to change

NameFileDefaultWhat it changes
CROCIERAscript.js60Resting speed, in pixels per second.
SPINTAscript.js0.22How much scrolling speeds up the ribbon.
PENDENZA / MAX_PENDENZAscript.js0.012 / 10Tilt per unit of velocity and its limit in degrees. Zero removes the tilt.
data-versoindex.html1 / -1Each ribbon's direction: 1 to the left, -1 to the right.

When to use it

As an interlude between two sections, for services, clients or keywords. Not for text meant to be read calmly.

On phones

It speeds up with finger scrolling and can be thrown with a horizontal swipe; touch-action: pan-y keeps vertical page scrolling free.

With reduced motion

The ribbons stand still, with readable words.

Pitfalls

  • Put aria-hidden on the copies, or a screen reader reads the same words five times.
  • If the font loads later, the piece width changes: recompute wrap after document.fonts.ready or on resize.
  • Never animate left or margin: transform only, or the browser recomputes layout every frame.

Libraries

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

Weight: 6.2 KB of our own files.

Testing

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