Skip to content
animorio
IT
Back to the library

Mercury file drop

WebGL, HoverWebGL, GSAP, CSS onlyAdvancedCompressed weight: Demo 12 KBGSAP 28 KBFreeDownload the zip

The panel where you give files to an AI assistant, on black: the drop zone is a shallow pool of mercury drawn by a WebGL shader, reflecting the two long lights of a studio. Under the pointer the metal dips with a small raised lip and leaves a wake of ripples; a file held over it makes it rise towards it and lights the rim lilac; let go, the file sinks with a splash and in the list below it is read page by page until Indexed.

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>
<!--
  "Mercury file drop" 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>The assistant's file drop zone with the mercury pool</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>
  <!-- the knowledge panel of an invented AI assistant, Halden: the drop zone is a shallow pool of liquid mercury drawn
       by a WebGL shader. It dips under the pointer, ripples behind it, rises towards a file held over it and swallows
       the file with a splash; the file then gets read page by page in the list below -->
  <main class="stage" data-stage>
    <section class="panel" data-panel aria-labelledby="panel-title">
      <header class="panel__head" data-in>
        <svg class="mark" viewBox="0 0 24 24" aria-hidden="true">
          <path d="M5 18.5C5 11 8.2 5.5 12 5.5s7 5.5 7 13"></path>
          <path d="M9 18.5c0-4.6 1.3-8 3-8s3 3.4 3 8"></path>
        </svg>
        <div class="panel__titles">
          <h1 class="panel__title" id="panel-title">Teach Halden your files</h1>
          <p class="panel__sub">PDF, Docs and Sheets, up to 50 MB</p>
        </div>
        <span class="panel__scope">Research</span>
      </header>

      <label class="pool" data-pool data-in>
        <canvas class="pool__metal" data-metal aria-hidden="true"></canvas>
        <span class="pool__flat" aria-hidden="true"></span>
        <span class="pool__rim" aria-hidden="true"></span>
        <input class="pool__input" type="file" multiple data-input aria-label="Add files to Halden">
        <span class="pool__hint" data-hint>
          <svg class="pool__icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M10 13.6V4.4M6.2 8 10 4.2 13.8 8M4.5 12.8v1.6c0 .9.7 1.6 1.6 1.6h7.8c.9 0 1.6-.7 1.6-1.6v-1.6"></path></svg>
          <span class="pool__words">
            <span class="pool__word" data-word="idle">Drop files, or <em>browse</em></span>
            <span class="pool__word" data-word="hold" aria-hidden="true">Release to add</span>
          </span>
        </span>
      </label>

      <ul class="files" data-files data-in aria-live="polite">
        <li class="file file--new" data-row-new>
          <span class="file__body">
            <svg class="file__doc" viewBox="0 0 20 20" aria-hidden="true"><path d="M5.5 2.8h6l3 3v10.6c0 .5-.4.8-.8.8H5.5c-.5 0-.8-.3-.8-.8V3.6c0-.5.3-.8.8-.8Z"></path><path d="M11.4 2.9v3h3"></path><path class="file__lines" d="M7.2 10h5.6M7.2 12.6h4"></path></svg>
            <span class="file__name" data-new-name>Board deck, Q3.pdf</span>
            <span class="file__size" data-new-size>4.2 MB</span>
            <span class="file__state">
              <span class="file__status" data-new-status>Reading</span>
              <svg class="file__tick" viewBox="0 0 16 16" aria-hidden="true"><path data-new-tick stroke-dasharray="14" stroke-dashoffset="14" d="M3.4 8.3 6.5 11.3 12.6 4.9"></path></svg>
            </span>
          </span>
          <span class="file__bar" aria-hidden="true"><span class="file__fill" data-new-fill></span></span>
        </li>
        <li class="file" data-row-a>
          <span class="file__body">
            <svg class="file__doc" viewBox="0 0 20 20" aria-hidden="true"><path d="M5.5 2.8h6l3 3v10.6c0 .5-.4.8-.8.8H5.5c-.5 0-.8-.3-.8-.8V3.6c0-.5.3-.8.8-.8Z"></path><path d="M11.4 2.9v3h3"></path><path class="file__lines" d="M7.2 10h5.6M7.2 12.6h4"></path></svg>
            <span class="file__name">Customer calls, Q3.pdf</span>
            <span class="file__size">8.4 MB</span>
            <span class="file__state is-done">
              <span class="file__status">Indexed</span>
              <svg class="file__tick" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.4 8.3 6.5 11.3 12.6 4.9"></path></svg>
            </span>
          </span>
        </li>
        <li class="file" data-row-b>
          <span class="file__body">
            <svg class="file__doc" viewBox="0 0 20 20" aria-hidden="true"><path d="M5.5 2.8h6l3 3v10.6c0 .5-.4.8-.8.8H5.5c-.5 0-.8-.3-.8-.8V3.6c0-.5.3-.8.8-.8Z"></path><path d="M11.4 2.9v3h3"></path><path class="file__lines" d="M7.2 10h5.6M7.2 12.6h4"></path></svg>
            <span class="file__name">Pricing notes.docx</span>
            <span class="file__size">1.2 MB</span>
            <span class="file__state is-done">
              <span class="file__status">Indexed</span>
              <svg class="file__tick" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.4 8.3 6.5 11.3 12.6 4.9"></path></svg>
            </span>
          </span>
        </li>
      </ul>

      <footer class="panel__foot" data-in>
        <span><b data-count-src>2</b> sources, <b data-count-pages>61</b> pages</span>
        <span class="panel__private">
          <svg viewBox="0 0 16 16" aria-hidden="true"><rect x="3.6" y="7" width="8.8" height="6.4" rx="1.6"></rect><path d="M5.6 7V5.4a2.4 2.4 0 0 1 4.8 0V7"></path></svg>
          Stays in this workspace
        </span>
      </footer>
    </section>

    <!-- the file the drawn pointer carries in -->
    <div class="chip" data-chip aria-hidden="true">
      <svg class="chip__doc" viewBox="0 0 20 20"><path d="M5.5 2.8h6l3 3v10.6c0 .5-.4.8-.8.8H5.5c-.5 0-.8-.3-.8-.8V3.6c0-.5.3-.8.8-.8Z"></path><path d="M11.4 2.9v3h3"></path></svg>
      <span class="chip__name">Board deck, Q3.pdf</span>
    </div>
    <svg class="ghost" data-ghost viewBox="0 0 20 20" aria-hidden="true"><path d="M4 2.5v13.2l3.5-3.3 2.4 5.3 2.3-1-2.4-5.2 4.8-.2z"></path></svg>
  </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.

39 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 “Mercury file drop” 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 an almost black background, with a faint lilac haze, sits the panel of Halden, an invented AI assistant: a graphite card with grain, a one pixel border catching light at the top and three soft shadows. At the top the Halden mark, two lilac arches on a tile, ‘Teach Halden your files’, the line of formats and the Research pill. In the middle, set into the card, a pool of mercury: the metal reflects a dark room with a long softbox above and a weaker one below, a lilac bounce on one side, and it darkens where it curls against the wall of the basin, with a thread of light just inside the edge. The surface is never fully still: two slow swells make it breathe. In the middle, a dark glass pill says ‘Drop files, or browse’. When the page opens the room light comes on and a first drop starts a ring. The drawn pointer crosses the pool: under it the metal dips, with a small raised lip around it as surface tension does, the reflection of the lights bends round the hollow and behind it rings remain that cross and fade; the pill's arrow rises two pixels. Then it goes to the corner of the panel and picks up a file, Board deck, Q3.pdf, which comes away on a spring and tilts. Carried over the pool, the metal rises towards the file, the rim of the basin lights up lilac, the metal takes on a lilac sheen and the label becomes ‘Release to add’ while the arrow drops towards the metal. Let go, the file shrinks and sinks: the metal first drops sharply and then springs back elastically, while three rings run out to the edges. In the list below a new row comes in on a spring and the oldest closes; the thin bar fills while the label counts Page 1 of 24 up to 24, then the check draws itself, Indexed appears and at the bottom the total rises to 3 sources, 85 pages. The pointer crosses the pool again and leaves; then the list goes back as it was and the loop starts again. With a real pointer the pool dips where you touch it, a click makes a ring and opens the file picker, and a real file dragged over it makes it rise, lights it and is read in the list with its own name and size.

How it works

A height field

For every pixel the shader works out the height of the metal: two slow swells always on, the hollow under the pointer (a downward gaussian plus an upward ring half as wide, the lip of surface tension), the bulge towards the file held above and up to ten rings, each a packet of waves running away from its centre and fading with time and distance. The normal comes from three height readings a pixel and a half apart.

Mercury is what it reflects

The colour is not a grey: it is the room reflected. From the eye, high above the centre, the reflected ray is worked out with reflect, and an env function draws the studio: the dark, a long softbox, a narrower weaker one, a lilac bounce. On the flat surface the softboxes become two bands; every slope bends them, and that is where the liquid metal comes from. Fresnel strengthens the reflections on the slopes, a light above the pointer makes the sides of the hollow shine.

The wall of the basin

With the distance from a rounded rectangle (sdBox) as big as the canvas, the shader darkens the metal in the last pixels before the wall and adds a thread of light, stronger on the top side; when a file is above, that thread turns lilac. The canvas has the same radius as the basin in CSS, so a corner never shows.

States are numbers

Hollow, bulge, accent and light are fields of one object that GSAP moves from value to value: the hollow comes in with back.out, the released file takes the bulge below zero in 0.12 seconds and brings it back with elastic.out. The hollow follows the pointer on a spring, and every time it has travelled a stretch it leaves a ring, stronger the faster it goes.

A real panel

The pool is a label holding a file input: a click opens the file picker, dragging a real file (dragover, drop) does the same as the autopilot and the new row takes the file's name and size. The list is aria-live. Without WebGL a pool of chrome in CSS remains, with a radial gradient hollow that follows the pointer.

Values to change

NameFileDefaultWhat it changes
DIPscript.js1How deep the metal dips under the pointer (0 not at all).
WAKEscript.js1How strong the wake of ripples behind the pointer is.
SPLASHscript.js1How strong the splash is when the file sinks.
RIPPLE_SPEEDscript.js0.55How fast the waves run, in pool widths per second.
SHINEscript.js1How strong the two lights reflected in the metal are.
TINTscript.js0.55How much the metal takes the accent colour when a file is above it.
PAGESscript.js24How many pages of the new file it reads.
AUTO_PILOTscript.js5After how many seconds without a pointer the drawn one starts again (0 never).

Try them in the Playground

When to use it

For the area where files are uploaded in an AI app (an assistant's knowledge base, a project's sources, documents to summarise), or for the upload of an app or a dashboard that wants a moment of material and light where there is usually a dashed rectangle.

On phones

The same pool with adapted sizes: the panel takes almost the whole width, the pool is at most 27 % of the screen tall and the canvas is worked out again on its real size; the Research pill, the file sizes and the workspace line go away. A tap makes a ring and opens the file picker; the hollow that follows the pointer happens with a mouse and with the autopilot.

With reduced motion

The metal stays still, drawn only once with the light on; no hollow, no waves and no autopilot. A real file dropped on the pool lights it and dims it with a fade, and the new row appears already read.

Pitfalls

  • Mercury painted grey looks like plastic: the metal lives entirely in the reflection. The two softbox bands on the flat surface are what every slope bends, and without them the waves do not show.
  • Rings that are too strong or too dense cross and make a foam of bubbles: the wake's amplitude is tied to speed with a cap, the wavelength is wide and every ring fades with distance too, not only with time.
  • The check drawn with stroke-dashoffset must be animated as an attribute: with the same value written in the CSS the attribute loses and the check never appears.
  • The pill in the middle is centred with a CSS translate: GSAP moves only the arrow and the words inside, never the pill, which would otherwise lose its centring.
  • The canvas lives inside the pool, not full screen: the shader only pays for the basin's pixels, and the hollow and rings are measured in units of the short side, so the phone's low pool ripples like the wide one.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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