Skip to content
animorio
IT
Back to the library

Falling tools

Physics, HoverCSS onlyMediumCompressed weight: Demo 4.1 KBMatter.js 25 KBFreeDownload the zip

Tool pills fall into a box with real physics: they bounce, pile up, and can be grabbed with the mouse or a finger and thrown.

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>
<!--
  "Falling tools" 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>Attrezzi che cadono</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="pagina">
    <div class="testa">
      <div>
        <p class="sopra">La cassetta dell’animatore</p>
        <h1 class="titolo">Prendili e lanciali</h1>
      </div>
      <button type="button" class="scuoti" data-autoclic>Scuoti la cassetta</button>
    </div>
    <!-- gli attrezzi sono elementi HTML veri: la fisica li muove con i trasformati -->
    <div class="cassetta" data-cassetta>
      <ul class="attrezzi" aria-label="Attrezzi">
        <li class="attrezzo t1">easing</li>
        <li class="attrezzo t2">stagger</li>
        <li class="attrezzo t3">scrub</li>
        <li class="attrezzo t4">pin</li>
        <li class="attrezzo t1">timeline</li>
        <li class="attrezzo t2">morph</li>
        <li class="attrezzo t3">shader</li>
        <li class="attrezzo t4">spring</li>
        <li class="attrezzo t2">mask</li>
        <li class="attrezzo t1">parallax</li>
        <li class="attrezzo t3">keyframe</li>
        <li class="attrezzo t4">blur</li>
        <li class="attrezzo t1">SplitText</li>
        <li class="attrezzo t3">ScrollTrigger</li>
        <li class="attrezzo t2">Flip</li>
        <li class="attrezzo t4">WebGL</li>
      </ul>
    </div>
  </main>

  <script src="https://cdn.jsdelivr.net/npm/matter-js@0.20.0/build/matter.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.

28 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 “Falling tools” 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

When the box enters the screen, the tools, coloured pills with a name each, fall from the top one after another, bounce on the bottom and pile up crooked like real objects. Each one can be grabbed with the mouse or a finger, dragged and thrown: the others get pushed away. The button at the top shakes the box and makes them all jump.

How it works

Real pills, invisible bodies

The pills are HTML elements (text readable by screen readers, styled with CSS). For each one Matter.js creates a rectangle with corners rounded to half its height: the same shape, but invisible.

Fixed step

Physics advances in 1/60 s steps with an accumulator, independent of frames: with variable steps Matter becomes unstable. After each step the pills copy their bodies’ position and rotation through a transform.

Readable while falling

Every body’s inertia is multiplied by 2.5: the pills tilt and roll little, so they almost never end up upside down.

Grab and throw

On pointerdown an elastic constraint ties the grabbed point to the pointer; moving moves the constraint’s end. On release the constraint goes away and the pill’s speed becomes the throw. setPointerCapture keeps the drag going outside the pill.

Values to change

NameFileDefaultWhat it changes
GRAVITAscript.js1.1Gravity: higher, they fall faster and bounce less.
RIMBALZO / ATTRITOscript.js0.3 / 0.4How much they bounce and how much they grip each other.
RIGIDITAscript.js2.5Multiplies rotational inertia: higher, they flip less.
INTERVALLOscript.js90Milliseconds between one drop and the next.

Try them in the Playground

When to use it

For a list that does not need to be read in order: tools, skills, clients, ingredients. It is a toy: the same information should also be there in a normal form.

On phones

It works with a finger. Only the pills block scrolling (touch-action none): touching outside the pills scrolls the page normally.

With reduced motion

No physics: the pills sit in a row, still and readable.

Pitfalls

  • Measure the pills before creating the bodies, with the font already loaded: a body wider than its pill leaves gaps between pieces.
  • Stop the physics when the box leaves the screen: otherwise the engine runs for nothing and the phone heats up.
  • Walls must rise well above the box: objects start from above and, thrown upwards, would otherwise leave sideways and never come back.
  • If the box changes size, rebuild the walls and bring back whoever ended up outside, or rotating the phone makes half the pills vanish.

Libraries

Matter.js 0.20.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 4.1 KB; the libraries: Matter.js 25 KB.

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