Starfield Simulation

Scroll down the page for instructions to install...










































Instructions:
  • Copy and paste the sections of code (found below) where needed.

  • There are two settings in the script that you can adjust:
    1. starnum - Number of stars to display. Less increases performance.
    2. starcolors - Array of arbitrary colors to use for the stars.
      When the stars are "created", the script randomly chooses a color from this list.
      You can use Hex color codes (ex: #FFFFFF) or the HTML color name.
      There must be at least one entry in the array. Seperate multiple entries with a comma.
      Example array list: var starcolors=[ '#dddddd' , '#000099' , 'forestgreen' , '#2222aa' , 'darkyellow' ];






Copy and paste the following style declaration in the HEAD section of your page:
Select all...






Copy and paste the following javascript in the BODY section of your page just before the </BODY> tag.:
Select all...