# Fluid Image

**Group:** Cursor and hover effects  
**Recording:** [https://s4xw77gvirailb62.public.blob.vercel-storage.com/lab/fluid-image.mp4](https://s4xw77gvirailb62.public.blob.vercel-storage.com/lab/fluid-image.mp4)  
**Source:** [https://ui.aryank.space/components/fluid-image](https://ui.aryank.space/components/fluid-image)  
**Human:** https://blankinterfaces.com/lab/fluid-image

---

## What it is

A photograph with a liquid gradient welded onto the cursor. One WebGL pass samples the image through UVs displaced by a curl-noise flow field, so the picture itself smears rather than a scrim sliding over it. Twelve trail points follow the pointer, each contributing a vortex spin perpendicular to its own travel direction plus a directional smudge, which is why a fast drag rips a spiral and a slow one only breathes. Inside the influence radius the image is hue-rotated in HSL and cross-faded into a four-stop gradient warped by the same field, while the four stops drift around the hue wheel on their own detuned periods. Pressing fires an expanding burst that runs independently of hover. The canvas is oversized past the frame so the swirl spills into the margin, and the loop parks itself entirely once the trail has decayed.

## Behaviour

### The image is the fluid, not a layer over it

Nothing is composited on top. The shader samples the photograph through UVs offset by the accumulated swirl, so the picture's own pixels smear. A scrim sliding over a static image reads as a filter; displacing the sample coordinates reads as liquid.

### Twelve trail points, each spinning around its own axis

The pointer leaves a 12-slot history. Every slot adds a vortex tangent perpendicular to the vector from itself to the pixel, scaled by that point's recorded velocity, plus a smaller linear smudge along its direction of travel. That velocity term is why a fast drag tears a spiral and a slow pass only breathes.

### Curl noise, so the turbulence is divergence-free

The flow field is the curl of a gradient-noise field rather than two independent noise channels. Divergence-free means the warp swirls without sources or sinks, so the image never appears to pool or drain. Low quality drops to two raw noise channels, which is visibly cheaper and slightly soapier.

### The palette drifts on detuned periods

All four gradient stops cycle their hue over time, but at 1.0, 0.73, 1.17, and 0.53 times the rate. Shared timing would make the gradient pump as one block; the mismatch keeps the stops sliding past each other so the blend never repeats on a short loop.

### It parks itself when nothing is moving

The loop checks pointer fade, burst value, and all twelve trail strengths, then stops requesting frames outright once every one has decayed. A permanent RAF on an idle hero is a real battery cost, and a ResizeObserver plus pointer handlers restart it.

### The canvas is bigger than the frame

It is inset by negative overflowPadding on all sides and the shader is told the padding as a uniform, so the swirl and glow spill past the image edge instead of being cut off at it. The boundary mask is warped by the same swirl, so the edge of the photo distorts too.

---

[View all content](https://blankinterfaces.com/sitemap.md)
