Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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="playground">
  <div class="cube">
    <div class="face left"></div>
    <div class="face front"></div>
    <div class="face right"></div>
    <div class="face rear"></div>
    <div class="face top"></div>
    <div class="face bottom"></div>
  </div>
</div>
              
            
!

CSS

              
                .playground{
  perspective: 800px;
}

body{
  background: #333;
}

.cube{
  -webkit-transform-style: preserve-3d;
  position: relative;
  margin: 0 auto;
  width: 150px;
  height: 150px;
  /* Uncomment to make it spin */
  animation: spin 16s infinite linear;
  margin: 20px auto;
  top:100px;
  -webkit-transform-origin: 100% 50%;
}

@-webkit-keyframes spin{
  from { 
    -webkit-transform: rotateX(-45deg) rotateY(0deg); 
  }
  to { 
    -webkit-transform: rotateX(-45deg) rotateY(360deg);
  }
}

@-webkit-keyframes pulsate{
  from{
    opacity: 1;
  }
  50%{
    opacity: 0.25;
  }
  to{
    opacity: 1;
  }
}

.face{
  width: 300px;
  height: 300px;
  border: 6px outset #ccc;
  text-align: center;
  font-size: 60pt;
  position: absolute;
  //-webkit-animation: pulsate 8s infinite linear;  
  background-color: #2653ad;
  -webkit-transition: -webkit-transform 1s ease-out, opacity 1s linear;
  box-sizing: border-box;
  -webkit-transform-origin: 50% 300px;
}

.cube:hover .left{
  -webkit-transform: rotateY(90deg) translateZ(150px) rotateX(-90deg);
}

.left{
  -webkit-transform: rotateY(90deg) translateZ(150px) rotateX(0deg);
  background: url("http://www.djibnet.com/photo/2851026377-landscape-green-view-halla.jpg");
  background-size: 150%;
}

.cube:hover .right{
  -webkit-transform: rotateY(-90deg) translateZ(150px) rotateX(-90deg);
}

.right{
   -webkit-transform: rotateY(-90deg) translateZ(150px);
  background: url("https://i.telegraph.co.uk/multimedia/archive/01842/landscape-rainbow_1842437i.jpg");
  background-size: 150%;
}

.cube:hover .front{
  -webkit-transform: translateZ(150px) rotateX(-90deg);
}

.front{
  -webkit-transform: translateZ(150px);
   background: url("http://walls.themespsp.fr/wp-content/uploads/2011/02/Landscape%20-%20Italy_16.jpg");
  background-size: 180%;
}

.cube:hover .rear{
  -webkit-transform: translateZ(-150px) rotateX(90deg);
}

.rear{
  -webkit-transform: translateZ(-150px);
  background: url("http://enchantingkerala.org/digital-photography-school/photos/landscape-photography-graduated-neutral-density-nd-filter.jpg");
  background-size: 150%;
}

.cube:hover .top{
  opacity: 0;
}

.top{
   -webkit-transform: rotateX(90deg) translateZ(150px);
  background: url("http://www.repro-tableaux.com/kunst/ludwig_munthe/winter_landscape.jpg");
  background-size: 150%;
  -webkit-transform-origin: 50% 50%;
}



.bottom{
  -webkit-transform: rotateX(90deg) translateZ(-150px);
  background: url("http://www.kaplaninternational.com/fr/images/27-ireland-landscape_tcm10-14949.jpg");
  background-size: 150%;
  -webkit-transform-origin: 50% 50%;
}

              
            
!

JS

              
                
              
            
!
999px

Console