PRO

Starry Night Flow

Van Gogh's Starry Night as a painting that sleeps until you wake it. At rest it hangs dim and desaturated, Floyd-Steinberg dithered into a WebGL point cloud pinned to its own pixels. Click any part (the cypress, the village, the swirls, the stars) and light spreads outward from the exact pixel you hit: color comes back, and as the front passes, those brushstrokes lift off and travel along the direction a structure tensor recovered from the paint. Click again to put that part back to sleep. Inspired by Joshua Garcia's Still Night.

Component

Click a part of the painting to wake it

Install
npx shadcn@latest add https://ui.aryank.space/r/starry-night-flow.json

Installs from ui.aryank.space. To add it by hand, copy the files in Usage below, or register the @compronents namespace via the docs.

Files

API
PropTypeDefaultDescription
srcstringhosted Starry Night webpCORS-readable image URL sampled into the particle field.
backgroundstring"#0b0b0d"Canvas clear color.
resolution / densitynumber640 / 1Sampling width in pixels and the fraction of dithered points kept.
cyclePeriod / driftFrac / maxDriftnumber6 / 0.9 / 0.02Drift lifecycle: seconds per cycle, drifting fraction of the cycle, and max UV displacement.
flowThresholdnumber0.25Minimum stroke coherence required for a particle to join the flow.
gustAmplitude / gustPeriodnumber0.75 / 10Wind surge intensity and cycle length in seconds.
colorBoost / pointScalenumber0.35 / 1Blend toward peak-normalized luminous color, and particle size multiplier.
regionMapstring | nullhosted region pngLossless map whose five flat colors mark the clickable parts. Pass null to treat the whole painting as one region.
dormantDim / wakeGainnumber0.5 / 1.18Brightness of a sleeping region and of a woken one, as fractions of the painted color.
revealDurationnumber1.1Seconds for the bloom to travel from the click to the far edge of its region.
hoverLift / interactivenumber / boolean0.09 / trueBrightness lift on the region under the cursor, and whether clicking and hovering are enabled.
hintstring | null"Click a part of the painting to wake it"Caption shown until the first region is woken. Pass null to hide it.
Customize
srcasset-url

The painting sampled into the particle field.

backgroundcolor

Canvas clear color behind the particles.

cyclePeriod / maxDrift / gustAmplitudetext

Motion energy: lifecycle length, drift distance, wind surge strength.

Dependencies
None.