228

Depth Parallax

Three layers of shapes move opposite the cursor by different amounts for depth

BackgroundHover & clickHeadline & heroBackground decorCSSJS parallax

Hannah's Motion Library
Web motion effects × AI prompts

AI prompt

A hero background made of three layers of decorative shapes: blurred large circles at the back, rounded squares in the middle and outlined rings in front, with the headline between the middle and front layers. As the cursor moves in the area, each layer moves opposite the cursor, nearer layers moving more (e.g. back 15%, middle 45%, front 100%), while the headline moves only slightly, creating a 3D sense of depth with smooth, lagging follow. (JS: on mousemove compute the cursor's position relative to the center as -0.5 to 0.5, each layer translate = -ratio × its factor, smoothed with a CSS transition or lerp)

When you copy it, a note to “match the site’s existing theme colors” is added automatically, so you don’t need to specify colors.

How to use it

  1. Tap “Copy AI prompt”.
  2. Paste it into an AI such as ChatGPT or Claude, and tell it which element on your site to apply it to (for example, the homepage headline or a buy button).
  3. The AI writes code that matches your site’s colors. Paste it into your project, then fine-tune the timing and distances.

More background effects

346 more motion effectsText, buttons, cards, backgrounds, cursors… preview them all and copy AI prompts

Browse all effects →