DEV Community

Daniel Enesi
Daniel Enesi

Posted on

RandomSparkles

This pen uses JavaScript to draw random spots by setting the "d" attribute of the SVG path element to a set of random points, switching the M and L options to create space between the lines.

It also engages the SVG circle element, animating created circles to move to random positions, grow and shrink repeatedly, and eventually disappear after ten seconds.

Top comments (6)

Collapse
 
dasheck0 profile image
Stefan Neidig

Would be great if you'd explain your code, so that we can better learn from it. I like the result but I wouldn't be able to use it in one of my projects without understanding what's going on. Or maybe I am too lazy to get into your code without any jumpstart :)

Collapse
 
danielx17 profile image
Daniel Enesi

I will do so. Thank you

Collapse
 
jonrandy profile image
Jon Randy πŸŽ–οΈ

Doesn't do anything - just sits there like this:

Random sparkles

Collapse
 
danielx17 profile image
Daniel Enesi

Sorry, maybe the browser you use does not support JavaScript

Collapse
 
jonrandy profile image
Jon Randy πŸŽ–οΈ

Believe me, it does. A quick check seems to reveal at least one problem with CSS. I'm using Firefox. Maybe you should do cross-browser testing

Collapse
 
respect17 profile image
Kudzai Murimi

Well Explained hey !