Overlays · Component Template
Metaball Cursor
One liquid cursor for the whole page. It stretches when you move fast and melts around the link, button, or card under the pointer.
Live demo
Move across the links and buttons, then switch the cursor from Ink to Mercury.
The Prompt
Build a one-page studio site whose cursor is a single liquid. It is one metaball, a head that stretches in the direction of travel, five drops trailing behind it, and a rounded rectangle it can melt into. Point at a link or a button and the liquid wraps that control. Point at a large card and it swells into a blob labeled Open. The system cursor is hidden while this is running. The studio is fictional, Molten, a product studio. Match my project's existing stack, conventions, and design tokens. If there are none, output a single HTML file with inline CSS and JavaScript and zero dependencies. LOOK Page #e8eaed, ink #0d0e10, dim ink at about 65% opacity, hairline at 14% opacity. System sans. A fixed canvas covers the viewport, ignores pointer events, and sits above the page. Nav, brand Molten linking to #top, then Work, Services, About and Contact. Hero h1, "Interfaces that feel poured, not placed.", size clamp(46px, 8.4vw, 132px), line-height 0.9, letter-spacing -0.055em, very heavy, max-width 12ch. Under it, "Molten is a product studio for teams who sweat the last ten percent: the hover, the hand-off, the moment a page answers you." Two pills, 54px tall, "Start a project" filled ink with page-colored type, and "See our work" with a 2px ink ring. Three cards in a row, one column below 760px, min-height 220px, radius 22px, surface #f6f7f8, hairline inset. Strategy, "Find the one thing your product does better than anyone, and build the story around it." Design, "Systems, flows and the small motions that make an interface feel considered." Engineering, "Front ends that ship fast, stay fast and survive the next redesign." Each card is a link with data-cursor="grow". A closing note, "The cursor is one liquid. It stretches when you move fast, wraps any link or button you point at, and moves to whatever has keyboard focus." A fixed switcher at the bottom right, white at about 78% with a 14px blur, two buttons, Ink pressed and Mercury. Hide the nav links below 760px. Anchors all resolve. The main element is #top. The card section is #services. The note is #about and the sentence inside it is #contact. Work, See our work, and the three cards point at #services. Start a project and Contact point at #contact. About points at #about. On load the headline rises word by word out of a clip, each word delayed about 60ms, over 1100ms. The paragraph and the buttons rise 26px and unblur over about 900ms, delayed by their order. Add a ready class two frames after load so the first paint is the hidden state. With prefers-reduced-motion, show everything settled and skip those transitions. Build the word wraps with elements and text nodes, never with an HTML string. THE CURSOR Run it only when the pointer is fine and the device can hover. Otherwise leave the system cursor, do not start WebGL, and replace the note with "This cursor needs a fine pointer, so on touch it stays the system one." WebGL1, GLSL ES 1.00, alpha and premultiplied alpha on, no antialias. Check compile and link. On failure, remove the live state and set the note to "WebGL is off in this browser, so the cursor stays the system one." The field is the head, five smaller drops, and a rounded box, merged with a smooth minimum. Squash and stretch the head along its velocity, up to about 55% longer, keeping the area. A morph value blends the head into the target rectangle. Ink mode draws opaque white as vec4 of the coverage four times, and the canvas uses mix-blend-mode difference, so the liquid reads as ink on any surface. Mercury mode draws a thin ring instead of a fill, shades it like reflective metal from a simple environment, and the canvas does not use difference. The word Open is a fixed label, white in difference blend, shown only while a card is swelled. In mercury, that label uses normal blend and ink color. Hide the system cursor, and the focus outline, for the whole page while the liquid is running. The liquid is the focus ring. MOTION The head follows its target on a stiff spring. Each drop follows the one ahead of it, looser and slower, so a fast move pulls out a tail. Reduced motion snaps every drop to the lead and hides the tail. Track only mouse movement. The first time the pointer enters, place every drop on it so nothing flies in from off screen. A press shrinks the head by about 30%. Over a card with data-cursor="grow", and only when the pointer got there rather than the keyboard, grow the radius from 13px toward about 47px and show Open. Anything else morphs into that element's box with 8px of padding, a corner radius taken from the element, and a 12% pull back toward the pointer so it feels magnetic. Keyboard focus that is visibly focused moves the liquid to the center of that control and wraps it. Focus leaving the page clears the target. The pointer leaving the document hides the liquid. Scissor the draw to the bounds of the drops plus the wrapped box, so the shader only runs where the liquid can be. Resize the drawing buffer when either width or height changes, capped at 2x. Keep the loop running while something is moving, a target is held, or a value is still easing, and stop it when the tab is hidden. BEHAVIOR Ink and Mercury set aria-pressed on the pair and toggle an ink or mercury class on the root. Mercury turns difference blending off. ACCESSIBILITY One h1. The nav has an accessible name. The switcher is a group named Cursor style, and its buttons are real buttons. The canvas and the Open label are hidden from assistive tech. Every control is a real link or button, and every href points at an id on the page. Reduced motion keeps the wrap and the switch, without the trailing drops. NEVER - Never show the liquid and the system cursor at the same time. - Never start it for a coarse or touch pointer. - Never build text by joining HTML strings. Create elements and set textContent. - Never use a library, an image, or a font from the network.
- CopyThe full prompt, one click.
- PasteInto Cursor, Claude Code, or any agent.
- CompareAgainst the live demo above.