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
Inside, each beam is a slice of light from one point just above the box: clear at its edges, brightest in the middle. Each one swings and brightens on its own slow beat.
Hard edges fills each beam with one flat color, so the light looks cut out of paper. Soft edges fades each beam to clear at both sides, so it reads as light in the air.
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.
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.
Your settings
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 GitHubWhat it is
The full explanation is in README.md.