cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation


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.

Revolving 3D planet in CSS3 (WIP)

Tutorial link: http://kushagragour.in/blog/2012/09/rotating-earth-using-css/

Inspired from works of 
Jack Rugile (http://codepen.io/jackrugile/pen/sadvF)
Tim Holman (http://cssdeck.com/labs/animated-map-icon)

Still needs to be fixed for scaling
<div id="earth"></div>
              body { background-color: #111; }
#earth {
 background-image: url('https://encrypted-tbn3.google.com/images?q=tbn:ANd9GcTQqoB4xBnIkmUg5pxDyYW2h0Q1pRTsbQBOfhg-E-y4iLFicsyi');
  width: 70px;
  height: 70px;
  /* a black shadow from left and white from right */
  box-shadow: inset 16px 0 40px 3px rgba(0,0,0,0.9),
    inset -3px 0 5px 2px rgba(255,255,255,0.16);
  background-size: 190px;
  margin: 80px auto;
  border-radius: 50%;
  position: relative;
  animation-name: move,scale,rotate;
  animation-duration: 4s,4s,4s;
  animation-iteration-count: infinite,infinite,infinite;
  animation-timing-function: ease-in-out,linear,linear;

@keyframes move {
  0%   { left: 200px;  }  
  70%  { left: -200px; }
  100% { left: 200px;  }

@keyframes scale {
  0%  { transform: scale(1);   }
  32% { transform: scale(0.4); animation-timing-function:  ease-in; }
  70% { transform: scale(1); animation-timing-function:  ease-in;  }
  75% { transform: scale(1.2);  animation-timing-function:  ease-in-out; }
  86% { transform: scale(2);  }  
  98% { transform: scale(1.2); }
  100%{ transform: scale(1); }
@keyframes rotate {
  0% { background-position: 0px; }
  100% { background-position: 190px; }


Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.


Loading ..................