GODRICH
#css-animation#button#loader#transition#scroll#dashboard#ui#design-trends

01The basic strike — one layer of midpoint displacement halving a segment

Halve the straight line between the two endpoints and nudge each midpoint sideways by a random amount, recursively, and the straight line turns into a jagged lightning stem.

Best forA momentary strike in a hero background, a flash on a loading screen

moveTolineTorequestAnimationFrame
The basic strike — one layer of midpoint displacement halving a segment
Open in a new tab

01 The basic strike — one layer of midpoint displacement halving a segment — Measured area 37.683% · moving frames 23/23Original by GODRICH · SCSS and React ship in the zip · 9 Lightning Effect Background Scenes, No WebGL

The post this demo lives in

9 Lightning Effect Background Scenes, No WebGL - preview of all 9 demos9 Lightning Effect Background Scenes, No WebGLNo library, no WebGL — a single recursive midpoint-displacement split makes lightning branches fork on their own, and th See all demos in this post

If you like this effect - similar demos