Skip to content
animorio
IT
Back to the library

Three words, three frictions

Physics, TextGSAPMediumCompressed weight: Demo 6.3 KBGSAP 28 KBFreeDownload the zip

A minimal physics animation: the same push, three surfaces. Three words, ICE, WOOD and FELT, sit at the start of three hairlines; a thin vermilion bar winds up and strikes them all at once with the same speed, then friction does the rest: ICE glides almost to the end, WOOD stops a third of the way, FELT barely leaves and judders to a halt. Braking, the words lean forward from their feet; stopping, they rock back by a hair and settle; behind them stays the trail of the friction and under them the metres are read. Any word can be flicked with a finger.

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>
<!--
  "Three words, three frictions" 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>Three words pushed across three frictions</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>
    <div class="banco" data-bench>
      <!-- the one push: a thin accent bar that strikes the three words at once -->
      <span class="spinta" data-pusher aria-hidden="true"><span class="spinta-tratto"></span></span>
      <!-- three tracks: same push, three frictions; the script fills each one -->
      <div class="pista" data-track data-word="ICE" data-mu="ice"></div>
      <div class="pista" data-track data-word="WOOD" data-mu="wood"></div>
      <div class="pista" data-track data-word="FELT" data-mu="felt"></div>
    </div>
    <p class="nota" data-note>Flick a word along its line</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.

17 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 “Three words, three frictions” 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 empty warm white there are three hairlines one under the other, all the same length, and at the start of each a heavy word: ICE, WOOD, FELT. The first line is smooth; under the second there is a fine grain, under the third a dense one, and at the end of each line a small number gives its friction. To the left of the three words a thin vermilion bar, as tall as all three, pulls back a step, shrinking a little, and snaps forward: it strikes them together, at the same speed. The knock reaches the back letter of each word first and runs to the front: the letters squeeze one after the other on the width axis and spring back, while the word tips back for an instant from the jolt. Then friction does the rest. ICE glides for a long time, almost to the end; WOOD stops a third of the way; FELT barely leaves and judders to a halt, because felt grips unevenly. While they brake the words lean forward from their feet, more where the friction is stronger, and when they stop they rock back past upright by a hair and settle. Behind each word a vermilion trail stays on the line, stronger where the friction worked harder; under the word the metres climb while it slides and stop with it, and a small upright mark rises where it came to rest. After a breath the words go back to the start, the trails fade and the bar pushes again. Any word can be taken with the pointer or a finger and flicked along its line: it keeps the speed of the flick and brakes with its own friction, and if it reaches the end it bounces back a little. A click on the empty page brings everything back to the start and pushes again.

How it works

The same push for all

The speed of the knock is worked out from the line: the slipperiest word must reach REACH of its line in GLIDE seconds, so v0 = 2d / t. The others leave at the same v0 and brake with a deceleration proportional to their friction: at 0.3 against 0.1 they stop a third of the way.

One physics step per frame

Every word has a position and a speed; every requestAnimationFrame frame the speed loses a · dt until it reaches zero, never turning round because of friction. At the end of the line it bounces back with 30% of its speed.

Felt grips in jerks

The friction of each line wobbles a little with the distance (a sine on the position), the more the rougher the line is: on ice you cannot see it, on felt the word brakes in jerks and stops trembling.

Leaning from the feet

The lean chases a target proportional to the braking on a spring (stiffness 260, damping 13) and becomes skewX on the word’s child, pivoting at the bottom. When the word stops the target drops to zero and the spring passes upright by a hair; at the knock it gets a push backwards.

The knock runs through the word

Every letter has its own width on the wdth axis: at the knock GSAP squeezes it by SQUEEZE points, from the back letter to the front with 35 milliseconds between them, and brings it back to 100 with elastic.out. The trail is a div as wide as the distance covered, the metres are read from the position.

Values to change

NameFileDefaultWhat it changes
MU_ICEscript.js0.1The friction of the first line: lower slides further.
MU_WOODscript.js0.3The friction of the second line.
MU_FELTscript.js0.75The friction of the third line: felt grips and judders.
GLIDEscript.js2.4How many seconds the slipperiest word glides.
REACHscript.js0.86How far the slipperiest word gets, from 0.3 to 1 of its line.
LEANscript.js9How many degrees the words lean while braking.
SQUEEZEscript.js16How much the knock squeezes the letters, in points of the width axis.
HOLDscript.js1.8How many seconds the words rest before going back.
SPEEDscript.js12 = twice as fast, 0.5 = half as fast.
LOOPscript.jstruePushes again and again.

Try them in the Playground

When to use it

For the page of a physics course or a science museum, to show in an app the difference between three options with the same gesture, for the headline of a shop that sells materials, floors or fabrics, or for a portfolio that wants an experiment instead of a sentence.

On phones

The same animation with adapted sizes: the words are as big as the box allows in width and height, the push is worked out on the line and the words are flicked with a finger.

With reduced motion

No sliding and no leaning: the words fade in already where the push would have left them, with their trails, the metres and the stop mark.

Pitfalls

  • Friction brakes, it never pushes: if the speed is smaller than what one frame would take away, it must be set to zero, otherwise the word turns round and trembles for ever.
  • Positions and speeds are in pixels: on resize they have to be scaled onto the new line, even in the middle of a slide.
  • The physics writes the position on the wrapper and the lean on its child: two transforms on the same element cancel each other.

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 1 November 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