cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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.

Quick-add: + add another resource

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.

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.

            
              #cube
  .face-bottom
    .content
    .face-back
    .face-left
    .face-right
    .face-front 
      .face-top
            
          
!
            
              #cube
  position: relative
  top: 100px
  left: 50%
  transform-style: preserve-3d
  transition: transform 2s 
  transform: rotateX(60deg) rotateZ(20deg)
  transform-origin: center top
  width: 100px
  height: 100px
div[class^='face']
  width: 100px
  height: 100px
  background: rgba(220,220,220,0.8)
  border: solid 1px #777
  position: absolute
  box-sizing: border-box
  transform-style: preserve-3d
  transition: transform 2s 
  
  
.face-back
  top: -100%
  left: -1px
  transform-origin: center bottom
  &.is-folded
    transform: rotateX(-90deg)
.face-front, .face-top
  top: 100%
  left: -1px
  transform-origin: center top
  &.is-folded
    transform: rotateX(90deg)
.face-left
  top: -1px
  left: 100%
  transform-origin: left center
  &.is-folded
    transform: rotateY(-90deg)
.face-right
  top: -1px
  right: 100%
  transform-origin: right center
  &.is-folded
    transform: rotateY(90deg)
    
@keyframes rotation
  from
    transform: translateZ(50px) rotateX(90deg) rotateY(0deg)
  to
    transform: translateZ(50px) rotateX(90deg) rotateY(360deg)
    
.content
  animation: rotation 5s linear 2s infinite
  width: 30px
  height: 30px
  background: blue
  position: absolute
  top: 35px
  left: 35px
  transform-style: preserve-3d
  transform: translateZ(50px) rotateX(90deg)
  &::before, &::after
    content: ""
    display: block
    width: 100%
    height: 100%
    position: absolute
    top: 0
    left: 0
    transform-style: preserve-3d
  &::before
    transform-origin: left center
    transform: rotateY(60deg)
    background: red
  &::after
    transform-origin: right center
    transform: rotateY(-60deg)
    background: green
  

            
          
!
            
              $("div[class^='face']").click(function(e){
  $(this).toggleClass("is-folded")
  e.stopPropagation();
})
            
          
!
999px
Loading ..................

Console