DEV Community

loading...
Cover image for Random Stars Animation with JavaScript and CSS

Random Stars Animation with JavaScript and CSS

typo3freelancer profile image Simon Köhler ・1 min read

I created this pen a long time ago when a client wanted this type of animation for a project. Maybe someone can use the code to make the animation smoother.

Things you could add

  • more randomness
  • performance optimization

Any ideas?

Write a comment ;-)

Discussion (2)

pic
Editor guide
Collapse
afif profile image
Temani Afif

Note that when using position:absolute you don't need to set the display property (the element will get blockified by default) unless you will have content inside where you need a particular container (flexbox, css grid, table, etc)

Collapse
typo3freelancer profile image
Simon Köhler Author

Thanks for the hint, you're right ;-)