07.26 · Ambient & Background
Lightning
Jagged bolts strike from the clouds and light up the sky. Best for dramatic intros.
Watch it
It moves by itself. Click or tap the sky to make a bolt strike there.
Inside, each bolt is drawn round by round: a straight line, split again and again with each middle pushed aside by less, then forks and a soft glow.
On the left, Even zigzag bends in equal steps, so it looks drawn. On the right, Random splits pushes each new middle aside by less each time, so it has big bends and fine jitter.
Try it
Change a setting and see the difference as it moves.
How often
Rarely keeps it calm behind text.
Branches
How many thinner forks split off.
Bolt color
The bolt and its glow.
Copy the prompt
Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.
Add lightning to [the dark section or storm scene you want it in]. Every so often, draw a jagged bolt from the clouds to the ground on a canvas: start from a straight line, split it again and again, pushing each new midpoint sideways at random by less each time, and let thinner forks branch off. Draw a wide, faint stroke under a thin bright one for the glow; the bolt flickers once and fades within half a second. When the settings include it, light the sky softly, never more than twice a second. A click or tap strikes where the visitor points. If the visitor has reduced motion turned on, show a still bolt with no flash. 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.