Skip to content
animorio
IT
Back to the library

Storage card

Physics, HoverGSAP, CSS onlyAdvancedCompressed weight: Demo 9.6 KBGSAP 28 KBFreeDownload the zip

The storage card of a made-up file and backup app, Cubby, on a warm light ground: 48.2 of 64 GB used, and each group of files (photos, apps, messages, cache) is made of small bricks with weight inside a glass tray. On arrival they drop one after the other into the lowest gap, land with a slight squash and settle, with hand-written physics (Verlet steps of 1/120 s, never more than 1/30 s a frame, box collisions and friction). The pointer in the tray stirs them, a row of the legend makes its own bricks hop and dims the others, Clean up throws the hatched cache bricks out of the top with a line of light and the rest fall into the gaps while the numbers go down; then the cache builds up again.

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>
<!--
  "Storage card" 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>Cubby, Storage: the files stacked in the tray</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="stage">
    <!-- the storage card of a made-up phone and cloud app, Cubby. Every file is a small brick in a glass tray, a body
         with weight that falls, bumps and settles; the pointer stirs them, a row of the legend makes its files hop,
         Clean up throws the cache out and the rest drop into the gaps -->
    <section class="card" aria-label="Storage" data-card>
      <header class="head">
        <div class="brand">
          <svg class="brand__mark" viewBox="0 0 20 20" aria-hidden="true">
            <rect x="2.5" y="4.5" width="15" height="12" rx="3.5"/>
            <path d="M6.5 4.5V3.6a1.1 1.1 0 0 1 1.1-1.1h4.8a1.1 1.1 0 0 1 1.1 1.1v.9"/>
            <path d="M7 10.5h6"/>
          </svg>
          <span class="brand__name">Cubby</span>
        </div>
        <span class="device">Alba's phone</span>
      </header>

      <div class="title">
        <h1 class="title__h">Storage</h1>
        <p class="title__used"><b data-used>48.2</b> GB of 64 GB used</p>
      </div>

      <div class="cap" aria-hidden="true" data-cap>
        <i data-seg="photos"></i><i data-seg="apps"></i><i data-seg="messages"></i><i data-seg="cache"></i>
      </div>

      <div class="tray" data-tray aria-hidden="true">
        <div class="tray__glass"></div>
        <div class="tray__bricks" data-bricks></div>
        <div class="tray__sweep" data-sweep></div>
        <div class="tray__lip"></div>
      </div>

      <ul class="legend" data-legend>
        <li class="leg" data-cat="photos"><span class="leg__name">Photos</span><span class="leg__gb"><b data-gb>21.4</b> GB</span><span class="leg__bar"><i></i></span></li>
        <li class="leg" data-cat="apps"><span class="leg__name">Apps</span><span class="leg__gb"><b data-gb>12.8</b> GB</span><span class="leg__bar"><i></i></span></li>
        <li class="leg" data-cat="messages"><span class="leg__name">Messages</span><span class="leg__gb"><b data-gb>6.1</b> GB</span><span class="leg__bar"><i></i></span></li>
        <li class="leg" data-cat="cache"><span class="leg__name">Cache</span><span class="leg__gb"><b data-gb>7.9</b> GB</span><span class="leg__bar"><i></i></span></li>
      </ul>

      <footer class="foot">
        <p class="foot__note" data-note>Cache rebuilds as you use apps</p>
        <button class="btn" type="button" data-btn>
          <span class="btn__bg" aria-hidden="true"></span>
          <span class="btn__label" data-label>
            <span class="btn__a">Clean up</span>
            <span class="btn__b"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8.4l2.9 2.9 6.1-6.6"/></svg>Freed 7.9 GB</span>
          </span>
        </button>
      </footer>
    </section>
  </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.

42 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 “Storage card” 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

In the middle of a paper-coloured ground, a white card with a soft layered shadow: at the top the Cubby mark and the phone’s name, Storage with 48.2 GB of 64 GB used and a thin bar split into four colours. Below is a glass tray with faint lines and a reflection, and inside it the files are small bricks with light on their top edge: blue for photos, black for apps, grey for messages, hatched sand for the cache. On arrival they fall one at a time, each where it leaves the least gap below, squash a little on touching and come back up with a pixel of bounce; resting only on a corner they slide down into the hole. Moving the pointer in the tray pushes the nearby bricks away and they fall back; over a row of the legend (Photos, Apps, Messages, Cache) its bricks hop one after the other and the others dim. Clean up swells under the mouse and sinks when pressed; on click a line of light crosses the tray, the cache bricks fly out of the top spinning and fading, the others fall into the gaps and bump, the numbers drop to 40.3 GB and the button widens on a spring into Freed 7.9 GB with a tick that draws itself. Three seconds later the cache rebuilds: the hatched bricks drop back in from the top and the numbers climb. Left alone it shows the photos, the cache, stirs the stack and cleans up.

How it works

Files become bricks

Each group has its GB and the tray is nine units wide: each group is split into bricks one, two or three units wide with a fixed random (always the same stack), and the order they fall in is shuffled. Brick width and height are measured from the tray, so they fit the phone box too.

Fixed-step Verlet

Every brick keeps its position and the one before: the speed is their difference. A frame lasts at most 1/30 s and is split into steps of 1/120 s; each step adds gravity and the pointer’s push, then seven rounds of constraints: the walls, the floor and overlapping pairs, pushed apart along the side where they overlap least, in proportion to their width.

Friction, corners and landings

A brick resting on another keeps only part of its sideways speed (FRICTION), measured against the one below. Resting on less than 42% of its width it slides towards the open side and drops into the gap. When a fast fall stops, a spring squashes the body from the bottom and lets it come back with a pixel of bounce; the lean follows the sideways speed.

Where the next one falls

Before a brick drops the height of the stack under each column is measured and the place where it lands lowest, leaving the least gap underneath, is chosen with a little randomness: the stack stays compact like a tidy disk without losing its physical feel.

Clean and rebuild

Clean up takes the cache out of the physics world and carries it away with GSAP (up, spinning, fading, 0.035 s apart) while a line of light crosses the glass; the others, with nothing under them, fall by themselves. The numbers are an object GSAP takes from 48.2 to 40.3, and the button measures its width before and after the label changes and goes from one to the other on back.out.

Values to change

NameFileDefaultWhat it changes
GRAVITYscript.js2400Pixels per second squared pulling the bricks down.
FRICTIONscript.js0.4How much a resting brick stops sliding (0 slides, 1 sticks).
SQUASHscript.js1How much a brick squashes on landing (0 none).
STIRscript.js1How hard the pointer pushes the bricks (0 not at all).
STIR_RADIUSscript.js44Pixels around the pointer that push.
HOPscript.js260Speed of the hop when its legend row is under the pointer.
DROP_STAGGERscript.js0.045Seconds between one brick and the next dropping in.
CLEAN_STAGGERscript.js0.035Seconds between one cache brick and the next leaving.
REFILL_AFTERscript.js3.2Seconds before the cache builds up again.
MAX_TILTscript.js3Degrees a brick leans while sliding.
SPEEDscript.js1Speed of the pilot: 2 twice as fast, 0.5 half.
LOOPscript.jstrueLeft alone, the pilot plays again and again.

Try them in the Playground

When to use it

For the storage or settings page of a files, photos or backup app, the dashboard of a cloud service or the account area of a product with a storage limit: when an abstract number (GB used) should become something you see and touch, and freeing space should feel as satisfying as a physical gesture.

On phones

The same animation with adapted sizes: the tray takes its height from the screen (104 to 172 px) and the bricks are measured from it, even if the window changes halfway. A finger in the tray stirs the stack like the mouse, a tap on the legend turns a row on or off.

With reduced motion

No falling or pushing: the stack is worked out silently and appears already at rest; cleaning the cache its bricks fade and the settled stack fades back in, the numbers change at once, no hops.

Pitfalls

  • With a step that follows the frame the stack shakes and, after a background tab, explodes: time is cut to 1/30 s and split into fixed steps of 1/120 s.
  • Pushing two boxes apart along the wrong side makes them jump sideways instead of stacking: always the side where they overlap least.
  • A CSS transition on the bricks’ opacity fights the transform written every frame: the dimming is a variable GSAP tweens and the drawing reads.
  • A brick resting on just a corner hangs unnaturally: under 42% support it is nudged towards the open side and falls by itself.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 9.6 KB; the libraries: GSAP 28 KB.

Testing

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