DEV Community

Cover image for Random Stars Animation with JavaScript and CSS
Simon Köhler
Simon Köhler

Posted on

Random Stars Animation with JavaScript and CSS

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 ;-)

Top comments (2)

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)

typo3freelancer profile image
Simon Köhler

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