Skip to content

LupineVault/stars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stars.js

LupineVault star background taken from Shadow Tunnel

Demo at GitHub Pages

Easy stars background with html, js, and css

Instructions

To easily put a star background on any site, follow these instructions:

  1. Right after the first <body> tag, paste <canvas id="canvas"></canvas>

  2. Right before the last </body> tag, paste <script src="stars.js"></script>

  3. In your CSS file, paste the following at the end:

/* Stars */
#canvas {
    display: block;
    position: fixed;  /* Cover the viewport */
    top: 0;
    left: 0;
    width: 100vw;  /* 100% of the viewport width */
    height: 100vh; /* 100% of the viewport height */
    
    pointer-events: none; /* Prevents canvas from interfering with interactions */
}
  1. Put the stars.js file in the same directory as the HTML file with the stars

  2. Enjoy!

About

easy stars background with html, js, and css

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published