07.22 · Ambient & Background

Light Rays

Soft beams of light fall from above and slowly sweep across. Best for hero intros.

Watch it

It moves by itself. Pause it to look closely, or turn on slow motion to see each part of the movement.

Light rays

A soft, slow start for your page

Try it

Change a setting and see the difference as it moves.

Light color

Warm is late sunshine; cool is moonlight.

Speed

How fast the beams sway and the dust drifts.

Specks of dust drift and glint where the light falls.

More optionsFewer options

Number of rays

More rays overlap into a fuller, brighter light.

Light comes from

Where the beams start.

Copy the prompt

Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.

Add soft light rays to [the dark section you want them in]. From one point just above the top edge, draw a fan of long, narrow beams on a canvas, made soft by gradients rather than blur filters: clear at the edges, brightest near the source and fading out farther away. Let each beam sway and brighten and dim on its own slow cycle, paced by elapsed time, so the light seems to sweep across the scene, and add overlapping beams together. When the settings include dust, float tiny specks that glint only where a beam crosses them, with fewer specks on phones. Keep the content above the light. If the visitor has reduced motion turned on, show the rays still. Match the settings listed below.

Replace the words in brackets with your own element. Your settings are added at the end.

Free and open source. If this helped, a star on GitHub helps other people find it.

Star on GitHub

What it is

The full explanation is in README.md.

Good for

  • Hero sections
  • Page intros
  • Nature and wellness sites
  • Product launches

Avoid on

  • Light pages
  • Busy layouts