VOOZH about

URL: https://www.geeksforgeeks.org/css/how-to-create-shooting-star-animation-effect-using-css/

⇱ How to create Shooting Star Animation Effect using CSS ? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to create Shooting Star Animation Effect using CSS ?

Last Updated : 9 May, 2023

The Shooting Star effect is one of the coolest background effects that is used for dark-themed websites. Shooting Stars Animation is an extraordinary illustration of a loading screen that grabs your eye for a considerable length of time for the remainder of the content to load on the website. This effect can be used in page loader, UI.

Approach: The methodology is to make little roundabouts and align their motion in 45 degrees using CSS properties like webkit-transform and transform and afterward adding animations for the tail of star and head of the star(shining part) using @keyframes and @-webkit-keyframes property and now add delays for shooting effects. Essential information on these three properties is essential for going any further in this article.

Example: In this example, we are using the above-explained approach, first we create a basic design of the web page.

CSS Code: For CSS, follow the given below steps:

  • Align the division components as per your requirement.
  • Give them a circular shape using the border-radius property.
  • Use keyframes to animate the balls by increasing the scale. There is no fixed way of doing this you can change the scale on different frames as you like.
  • Use n-th child property to apply some delay between the animation of each element.

After combining the above two sections of code i.e. HTML and CSS code to get the desired output.

Output: 

👁 Image

Comment
Article Tags: