Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="row">
  <div class="col-xs-12 welcome">
    <h4>Welcome to SC's planetary animation.</h4>
    <p>The planetary orbit time has been taken <br /> from data found at <a target="_blank" href="http://www.windows2universe.org/our_solar_system/planets_table.html">WindowstoUniverse</a></p>
  </div>
</div>

  <div class="row solarSystem">
    
<!-- THE SUN -->
  <div id="sun" class="text-center">
  </div>

  <!-- MERCURY -->
  <div id="mercuryOrbit">
    <div id="mercuryPlanet">
    </div>
  </div>

<!--  VENUS -->
<div id="venusOrbit">
    <div id="venusPlanet">
    </div>
  </div>

<!--  EARTH -->
<div id="earthOrbit">
    <div id="earthPlanet">
    </div>
  </div>

<!--  MARS -->
<div id="marsOrbit">
    <div id="marsPlanet">
    </div>
  </div>

<!--  JUPITER -->
<div id="jupiterOrbit">
    <div id="jupiterPlanet">
    </div>
  </div>

<!--  SATURN -->
<div id="saturnOrbit">
    <div id="saturnPlanet">
    </div>
  </div>

<!--  URANUS -->
<div id="uranusOrbit">
    <div id="uranusPlanet">
    </div>
  </div>

<!--  NEPTUNE -->
<div id="neptuneOrbit">
    <div id="neptunePlanet">
    </div>
  </div>

    
  </div><!--close solarSystem class-->
              
            
!

CSS

              
                html,
body {
  width: 100%;
  height: 100%;
  background-color: black;
}

.welcome {
  color: #FFF;
  margin-bottom: 50px;
}

.solarSystem {
  padding-top: 100px;
}

#sun {
  position: absolute;
  /* Positions the top-left corner of the image to be */
  /* in the middle of the box */
  top: 50%;
  left: 50%;
  /* Play with these numbers to see what it does */
  height: 100px;
  width: 100px;
  /*margin-top: -100px;
  margin-left: -100px;*/
  background-color: yellow;
  border: 1px dashed orange;
  /*Make it a circle*/
  border-radius: 50%;
  box-shadow: 0 0 64px yellow;
}

#mercuryOrbit {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -50px;
  margin-left: -50px;
  width: 200px;
  height: 200px;
  border-width: 2px;
  border-style: dotted;
  border-color: gray;
  border-radius: 50%;
  -webkit-animation: spin-right 2.4s linear infinite;
  -moz-animation: spin-right 2.4s linear infinite;
  -ms-animation: spin-right 2.4s linear infinite;
  -o-animation: spin-right 2.4s linear infinite;
  animation: spin-right 2.4s linear infinite;
}

#mercuryPlanet {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -85px;
  margin-left: -85px;
  width: 30px;
  height: 30px;
  background-color: gray;
  border-radius: 50%;  
}

#venusOrbit {
  /* ... your other orbit styles ... */
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 300px;
  margin-top: -100px;
  margin-left: -100px;
  border-width: 2px;
  border-style: dotted;
  border-color: yellow;
  border-radius: 50%;
  -webkit-animation: spin-right 6.2s linear infinite;
  -moz-animation: spin-right 6.2s linear infinite;
  -ms-animation: spin-right 6.2s linear infinite;
  -o-animation: spin-right 6.2s linear infinite;
  animation: spin-right 6.2s linear infinite;
}

#venusPlanet {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -120px;
  margin-left: -120px;
  width: 30px;
  height: 30px;
  background-color: yellow;
  border-radius: 50%;  
}

#earthOrbit {
  /* ... your other orbit styles ... */
  position: absolute;
  top: 50%;
  left: 50%;
  width: 400px;
  height: 400px;
  margin-top: -150px;
  margin-left: -150px;
  border-width: 2px;
  border-style: dotted;
  border-color: blue;
  border-radius: 50%;
  -webkit-animation: spin-right 10s linear infinite;
  -moz-animation: spin-right 10s linear infinite;
  -ms-animation: spin-right 10s linear infinite;
  -o-animation: spin-right 10s linear infinite;
  animation: spin-right 10s linear infinite;
}

#earthPlanet {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -155px;
  margin-left: -155px;
  width: 30px;
  height: 30px;
  background-color: blue;
  border-radius: 50%;  
}

#marsOrbit {
  /* ... your other orbit styles ... */
  position: absolute;
  top: 50%;
  left: 50%;
  width: 500px;
  height: 500px;
  margin-top: -200px;
  margin-left: -200px;
  border-width: 2px;
  border-style: dotted;
  border-color: brown;
  border-radius: 50%;
  -webkit-animation: spin-right 18.8s linear infinite;
  -moz-animation: spin-right 18.8s linear infinite;
  -ms-animation: spin-right 18.8s linear infinite;
  -o-animation: spin-right 18.8s linear infinite;
  animation: spin-right 18.8s linear infinite;
}

#marsPlanet {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -190px;
  margin-left: -190px;
  width: 30px;
  height: 30px;
  background-color: brown;
  border-radius: 50%;  
}

#jupiterOrbit {
  /* ... your other orbit styles ... */
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  margin-top: -250px;
  margin-left: -250px;
  border-width: 2px;
  border-style: dotted;
  border-color: orange;
  border-radius: 50%;
  -webkit-animation: spin-right 118.6s linear infinite;
  -moz-animation: spin-right 118.6s linear infinite;
  -ms-animation: spin-right 118.6s linear infinite;
  -o-animation: spin-right 118.6s linear infinite;
  animation: spin-right 118.6s linear infinite;
}

#jupiterPlanet {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -225px;
  margin-left: -225px;
  width: 30px;
  height: 30px;
  background-color: orange;
  border-radius: 50%;  
}

#saturnOrbit {
  /* ... your other orbit styles ... */
  position: absolute;
  top: 50%;
  left: 50%;
  width: 700px;
  height: 700px;
  margin-top: -300px;
  margin-left: -300px;
  border-width: 2px;
  border-style: dotted;
  border-color: gold;
  border-radius: 50%;
  -webkit-animation: spin-right 294.6s linear infinite;
  -moz-animation: spin-right 294.6s linear infinite;
  -ms-animation: spin-right 294.6s linear infinite;
  -o-animation: spin-right 294.6s linear infinite;
  animation: spin-right 294.6s linear infinite;
}

#saturnPlanet {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -260px;
  margin-left: -260px;
  width: 30px;
  height: 30px;
  background-color: gold;
  border-radius: 50%;  
}

#uranusOrbit {
  /* ... your other orbit styles ... */
  position: absolute;
  top: 50%;
  left: 50%;
  width: 800px;
  height: 800px;
  margin-top: -350px;
  margin-left: -350px;
  border-width: 2px;
  border-style: dotted;
  border-color: blue;
  border-radius: 50%;
  -webkit-animation: spin-right 840.1s linear infinite;
  -moz-animation: spin-right 840.1s linear infinite;
  -ms-animation: spin-right 840.1s linear infinite;
  -o-animation: spin-right 840.1s linear infinite;
  animation: spin-right 840.1s linear infinite;
}

#uranusPlanet {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -295px;
  margin-left: -295px;
  width: 30px;
  height: 30px;
  background-color: blue;
  border-radius: 50%;  
}

#neptuneOrbit {
  /* ... your other orbit styles ... */
  position: absolute;
  top: 50%;
  left: 50%;
  width: 900px;
  height: 900px;
  margin-top: -400px;
  margin-left: -400px;
  border-width: 2px;
  border-style: dotted;
  border-color: blue;
  border-radius: 50%;
  -webkit-animation: spin-right 1648s linear infinite;
  -moz-animation: spin-right 1648s linear infinite;
  -ms-animation: spin-right 1648s linear infinite;
  -o-animation: spin-right 1648s linear infinite;
  animation: spin-right 1648s linear infinite;
}

#neptunePlanet {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -330px;
  margin-left: -330px;
  width: 30px;
  height: 30px;
  background-color: blue;
  border-radius: 50%;  
}

@-webkit-keyframes spin-right {
  100% {
    -webkit-transform: rotate(360deg);
    -o-transform: rotate(360deg);
  }
}

@keyframes spin-right {
  100% {
    -webkit-transform: rotate(360deg);
    -moz-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
    -o-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console