Basic animation
One element, two ranges and a seed. Its own CSS transform, a scale and a skew, is kept: PerlinDOM only adds a translate.
Examples
Every demo on this page is live and runs the code beside it. Copy a snippet and you get the same motion.
One element, two ranges and a seed. Its own CSS transform, a scale and a skew, is kept: PerlinDOM only adds a translate.
Set an axis to null and it stays put: this one only slides sideways along its track.
The same options in a loop, with a seed per element, give five paths that never move in step.
Large blurred shapes at a very low speed add depth behind real content without pulling the eye.
Subtle background motion
Depth for any surface, at almost no cost.
Hover the stage to play, leave it to pause. The motion eases out and back in; lerpSpeed sets how softly.
Ranges and speed are writable properties, so they change while it runs. The snippet follows the sliders.
Four glow circles start drifting on hover or keyboard focus and ease to a stop when you leave.
With element: null an instance only computes lastX and lastY. Here they move one vertex of an SVG clip path.
Pixels keep the same distance at any size. Percentages are a share of the parent, so resize the window and only the right one adapts.
Drag the corner, or use the slider: the range is ±25% of the box and follows it on the very next frame.
Each axis picks its own unit: one adapts to the parent, the other keeps a fixed distance.
Every dot has a target on a ring. Slide amplitude to 0 and the drift settles into the shape.