Skip to content
The Design StackUpgrade1 free

How it behaves

Exactly what the prompt builds — every timing and easing is specified, so the result matches the demo.

Layout

  • The hero fills the width of its container and is at least as tall as the screen (100dvh). The cover is one flat colour (#d6d5d3, a warm light grey, in the demo) and the artwork fills the hero behind it like object-fit: cover, zoomed in 6% so its edges never show.
  • Whatever I put inside the component is laid on top of everything. Text in it ignores the pointer (so the cursor keeps painting as it crosses the headline), but links and buttons in it are clickable as normal.

The reveal (mouse and pen; see below for touch)

  • A soft brush follows the pointer, closing 14% of the distance to it every frame, so it trails a little behind a fast hand. Its radius is 9.7% of the hero's height.
  • The brush leaves "ink" in a hidden field at half the screen's resolution. Its shape is warped by moving noise, so it is never a clean circle, and fast strokes drag the ink along with them. The ink spreads a little, drifts on a slow swirling current and evaporates: a fully opened patch closes again in about four seconds.
  • The cover opens where the ink is, but not evenly: some areas open readily and others resist, so the hole breaks into lobes, inlets and wisps. Along its rim a thin, pale, slightly pearly fringe shows in streaks, like torn paper fibres.
  • The art in the open patches is raised: the brighter and darker parts of the image are used as a height map and lit by a light from the upper left that leans with the pointer, the raised area is magnified 3% around the cursor and brightened 5%, and it casts a soft shadow a few pixels down and to the right onto the cover.
  • When the pointer leaves the hero (or a finger lifts), the brush fades out over a few frames and the ink heals. The whole art layer also drifts slightly with the pointer's position for depth.
  • Touch: pressing on the hero opens the cover under your finger until you lift it. The page still scrolls normally, so a swipe scrolls the page rather than painting. Performance: the drawing loop runs only while the hero is on screen and for six seconds' worth of frames after the pointer was last over it (long enough for every hole to heal, even on a slow device that skips frames); then it stops until the pointer comes back. The canvas is drawn at no more than 1.5× pixel density and a huge image is scaled down to about the hero's size before it is uploaded to the GPU. If the browser drops the WebGL context, a fresh canvas is created. Fallbacks: without WebGL, the cover is a plain 2D canvas with a soft round hole that follows the cursor and heals, over the flat (un-lit) image, which drifts up to 12px against the pointer. With "reduce motion" on, the brush sits exactly on the pointer with no trailing, and the ink does not drift; the reveal itself still follows your hand. Until the first frame is drawn, only the cover colour shows.

More prompts