Overview
Layered background gradient drift behind a static foreground. Foreground content stays put; only the background layers move via transform + opacity (never layout properties like left or top) so the motion stays GPU-cheap.
When to use it
Reach for moving-background reveals on hero sections, page intros, and dashboard headers that want a sense of motion without committing to a full animation. Skip them on text-heavy reading surfaces — ambient peripheral motion is fatiguing during long sessions.
How it works
Stack two or three absolutely-positioned background layers behind the foreground content. Each layer holds a radial or conic gradient and animates transform: translate3d(x, y, 0) on a long loop (15–30 seconds). The translate3d form is critical — it forces compositor layer promotion so the animation runs on the GPU rather than the main thread. Use different durations and easing curves per layer so the layers never align at the same phase, which would produce a visible repeat. The foreground sits above with position: relative + a high z-index.
Production gotchas
Animating background-position instead of transform drops the animation to the CPU and causes jank under load. Don’t apply will-change: transform to every layer permanently — it pins them in GPU memory; add only when the animation is actively running, and remove on unmount or off-screen. Backgrounds with backdrop-filter stacked above the moving layers can produce ghosting on Safari iOS — either bake the blur into the layer image or accept the artifact below the iOS 17 floor.
Accessibility
Background drift in peripheral vision is exactly the kind of motion the prefers-reduced-motion: reduce media query targets. Pin all background layers at their starting positions (drop the animation) under reduced motion. The moving layers should remain decorative — do not rely on motion to communicate state. Verify foreground text contrast against the worst-case (darkest / lightest) frame of the background animation, not just the rest position.
References
Implementation depth
Moving backgrounds should animate transform on layers, not layout or gradient stops. The foreground content stays still while large background layers drift slowly enough to create atmosphere without stealing focus.
The worst frame matters more than the rest frame. Test foreground contrast when the brightest and darkest layers overlap, and turn the motion off under reduced motion while preserving the designed color field.