Sand AISand AI MAGI-2MAGI-2 est maintenant sur SandBase : vidéo 1080p avec audio natifEssayer maintenant

Magnet Ink Bench

A pool of black magnetic fluid on a glossy bench that mirrors the studio lights, where holding switches on a magnet under the top and raises a crown of sharp, glossy spikes; drag to lead the pool across the bench, let go and it flattens, add drops that bead and get pulled in.

Exemple

Magnet Ink Bench scene
Ouvrir dans un nouvel onglet

Magnet Ink Bench scene

L’exemple s’exécute dans un cadre sandbox sans accès à cette page.

Exécuter en ligne

Exécutez-le dans un sandbox SandBase et consultez vos résultats dans Lab.

Ouvrir dans Lab ↗

Ce que vous obtenez

Bring the set, lights, pool size, colours and copy for your bench. The Skill returns a downloadable Skill and a runnable magnetic-fluid scene.

Fonctionnement

  1. 01

    Write the bench briefs

    Each brief in assets/briefs/ holds the copy, the four state names, the readout format, the palette, the camera, the pool (radius, spike height and spacing, how tall the rim spikes stand) and the set: a studio with two softboxes, or a desk with a window, a hanging lamp and a copper dish the pool stays inside. A separate list of light boxes is what the fluid reflects, so keep it where the set draws its lights. A new brief needs no code change. You might tell your Agent: "Use magnet-ink-bench to make a lab bench under one strip light with a blue pool."

  2. 02

    Build one offline page

    npm run build inlines src/bench.js and both briefs into dist/index.html, about 70 KB. ?lang=en or ?lang=zh-CN picks the brief. The set is painted once. Each frame the pool and up to 547 spikes on a hexagonal lattice are drawn back to front, every surface coloured from the brief's light boxes with a Fresnel share, then drawn again flipped and faded as the reflection on the bench. There are no images or network requests, no API key and no model calls.

  3. 03

    Check the bench before you ship

    npm install brings in playwright-core, then npm run shoot drives the page frame by frame in headless Chrome with the network blocked. It runs 50 checks: the ghost hand raises a crown whose lit edges stripe a row of pixels through the pool, a real hover only bulges it, a hold raises the crown, a drag leads the pool and leans the spikes, letting go flattens it, drops land or bead and are pulled in, a weaker magnet makes fewer spikes, the lock holds the crown, reduced motion opens on a still crown, and at 360, 390 and 768 px wide in both languages no two controls overlap.

FAQ

Does Magnet Ink Bench need an API key?

No. Magnet Ink Bench is a single offline HTML page drawn with Canvas 2D, so it needs no API key and makes no model or network calls, before or after it is built. Node.js is only needed to run the build script, and playwright-core with a local Chrome only for the bundled browser checks.

Is the fluid really simulated?

Not as a liquid. Magnet Ink Bench treats the pool as one body on a spring toward the magnet, and each spike as a spring on a fixed hexagonal lattice whose height follows the local field. The rules are chosen so the crown rises above a critical field, peaks over the middle, leans after the magnet and sinks when it lets go, but no field equations are solved.

Can I change the set and the lights?

Yes. The brief chooses a studio with two softboxes or a desk with a window, a hanging lamp and a copper dish, and sets their positions and colours. The fluid's reflections come from a separate list of light boxes in the same brief, so move those with the painted lights. Copy one of the two bundled briefs, edit it and pass its name to scripts/build.mjs.

Does Magnet Ink Bench work on a phone?

Yes. Press and hold on the pool to raise the crown and drag a finger to lead it. Because a finger hides the pool, the lock switch keeps the magnet on with no finger down. Portrait phones get a taller stage that crops the bench at the sides, and the bar wraps under it. The checks ran at 360, 390 and 768 px wide under emulation, not on real devices.

What does reduced motion change?

With reduced motion set in the system, Magnet Ink Bench opens with the ghost hand off and the magnet locked on, on a crown that already stands and does not breathe. Holding, dragging, drops and the controls still work, so a viewer can explore it at their own pace. The checks confirm the spike count and the pool position stay the same over four seconds.

Skill Lab · Interactive scenes

Resin Diorama

Live 3D resin-block dioramas in your browser: send a little tram across a clear turquoise sea, or ripple the bay of a cliff island. Synthesized sound, and every scene can be tuned.

Skill Lab · Interactive scenes

3D Vehicle Worlds

Explore interactive 3D vehicle worlds in your browser, with varied terrain, camera controls and driving effects. Choose a playable example to begin.

Skill Lab · Interactive scenes

3D Firefly Terrariums

Turn a thick glass miniature, scatter glowing fireflies and open its brass lid. Actual particles leave through the neck and return before it seals. A moonlit cabin, forest and real local lights in one offline HTML.

Skill Lab · Interactive scenes

Jelly Candy: Fruit Bears

Six translucent fruit gummies on a white table. Grab any part and pull, lift a head until the neck stretches thin, press one flat until it springs back, flick one across the pile or pour in more. Fixed-step soft-body physics and a marching-cubes skin in one offline HTML.

Skill Lab · Interactive scenes

WebGPU Soft-Body Gummy Bears

Four translucent gummy bears on an ivory floor, rendered with native WebGPU. A deterministic 36-second choreography stretches, presses, flips and tumbles them before they settle back to the exact rest pose. Drag any bear to stretch, squish or toss it. A fixed-step tetrahedral XPBD solver in one offline HTML.

Skill Lab · Interactive scenes

Stone Stars: 3D Miniature Landmark City

Turn a city into a storybook 3D island around one landmark, with chapters, a daylight-to-starlight slider, street life and a matching scored 24-second film. Sample: a Gaudí-style basilica.