More CSS random() Learning Through Experiments
Briefly

More CSS random() Learning Through Experiments
"My idea for attempting to reproduce it was to make a big stack of <div> containers where the top center of them are all in the exact center of the screen. Then apply: Then if I put the "star" at the end (bottom center) of each <div>, I'll have a random star field where I can later rotate the container around the center of the screen to get the look I was after."
"If I chuck a low-opacity white border on each container so you can see how it works, we've got a star field going! Then if we apply some animated rotation to those containers like: We get the inside stars rotating one way and the outside stars going the other way: I don't think I got it nearly as cool as the BALL x PIT design, but perhaps the foundation is there."
The CSS random() function enables procedural generation of randomized visual effects; Safari Technical Preview currently supports it. A rotating star field can be created by stacking centered div containers and placing star elements at each container's bottom center, producing radial distributions when randomized. Applying staggered animated rotations to containers produces rings with alternating rotation directions. Large numbers of elements can be generated programmatically (for example via Pug) and styled with low-opacity borders to visualize structure. Switching CSS properties like colors, shadows, sizes, and transitions yields varied aesthetics. Attaching star groups to scroll-driven animations produces parallax depth by moving groups at different rates.
Read at Frontendmasters
Unable to calculate read time
[
|
]