DEV Community

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

Posted on

10 6

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)

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

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

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay