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="scale">
    <div class="wrapper">
  <div class="cube">
    <h class="front">front</h>
    <h class="back">back</h>
    <h class="top">top</h>
    <h class="bottom">bottom</h>
    <h class="left">left</h>
    <h class="right">right</h>
    <k class="front"></k>
    <k class="back"></k>
    <k class="top"></k>
    <k class="bottom"></k>
    <k class="left"></k>
    <k class="right"></k>
  </div>
</div>
    
    </div>
<div class="logo">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
 width="200.000000pt" height="137.000000pt" viewBox="0 0 100.000000 499.000000"
 preserveAspectRatio="xMidYMid meet">
<g transform="translate(0,200) scale(0.100000,-0.100000)"
fill="#c00" stroke="none">
<g class="all">
<g class="over">
<path d="M1412 1018 c-8 -8 -12 -47 -12 -108 0 -61 4 -100 12 -108 7 -7 44
-12 97 -12 l86 0 72 -72 c71 -71 73 -74 73 -123 0 -50 -1 -52 -78 -128 l-77
-77 -81 0 c-49 0 -85 -5 -92 -12 -16 -16 -16 -200 0 -216 16 -16 200 -16 216
0 7 7 12 35 12 63 l0 50 108 108 107 107 51 0 c27 0 55 5 62 12 16 16 16 200
0 216 -7 7 -40 12 -78 12 l-65 0 -93 93 c-89 89 -92 94 -92 138 0 25 -5 50
-12 57 -16 16 -200 16 -216 0z"/>
</g>
<g class="less">
<path d="M200 813 l-180 -178 0 -45 c0 -44 1 -46 158 -202 148 -147 161 -158
196 -158 48 0 86 36 86 81 0 28 -17 49 -122 156 l-122 123 142 143 c125 125
142 146 142 175 0 45 -38 82 -84 82 -32 0 -51 -16 -216 -177z"/>
</g>
<g class="pen">
<path  d="M1171 1285 l-115 -73 -1 -90 -1 -90 53 -26 54 -26 49 39 c28 22 59
43 70 46 19 6 20 15 20 151 0 79 -3 144 -7 143 -5 0 -59 -34 -122 -74z"/>
<path  d="M976 974 c-9 -20 -16 -37 -14 -39 2 -1 38 -20 80 -43 l77 -41 21 33
c11 18 20 36 20 39 0 6 -150 87 -161 87 -3 0 -13 -16 -23 -36z"/>
<path d="M932 888 c-21 -26 -222 -426 -307 -612 -58 -127 -84 -197 -81 -211 7
-26 56 -50 84 -41 25 8 428 683 465 778 5 14 -7 25 -56 52 -82 46 -92 49 -105
34z"/>
</g>
</g>
</g>
</svg>
</div>
              
            
!

CSS

              
                body{
background: lightgoldenrodyellow;
}
.logo{
   margin: 1em;
   position: fixed;
   bottom: -72px;
   z-index: 99999999999;
   right: 0;
}
.scale{
perspective:400px;
transform-style:preserve-3d;
transform: rotateX(-22deg);
}
      /* keyframes for rotating animation */
@-webkit-keyframes spin {
  from { transform: rotateY(0); }
  to   { transform: rotateY(360deg); }
}

/* scene wrapper */
.wrapper{
  height: 300px;
  margin-top:120px;
  position:relative;
  perspective: 800px;
  perspective-origin: 50% 100px;
}

/* cube wrapper */
.cube{
  position: relative;
  margin: 0 auto;
  width: 200px;
  transform-style: preserve-3d;
  animation: spin 4s infinite linear;
  transition: all 1s linear;
  top:150px;
}

/* outer cube */
h{
  position:absolute;
  width:200px;
  height:200px;
  display:block;
  background:rgba(255,255,255,0.1);
  box-shadow:inset 0 0 30px rgba(0,0,0,0.2);
  font-size:20px;
  text-align:center;
  line-height:200px;
  color:rgba(0,0,0,0.5);
  font-family:sans-serif;
  text-transform:uppercase;
  transition: all 1s linear;
}
h.back{
  transform: translateZ(-100px) rotateY(180deg);
}
h.right{
  transform:rotateY(-270deg) translateX(100px);
  transform-origin: top right;
}
h.left{
  transform:rotateY(270deg) translateX(-100px);
  transform-origin: center left;
}
h.top{
 transform:rotateX(90deg)translateZ(100px);
  
}
h.bottom{
  transform:rotateX(90deg) translateY(100px);
  transform-origin: bottom center;
}
h.front{
  transform: translateZ(100px);
}

/* inner cube */
k{
  position:absolute;
  top:50px;
  left:50px;
  width:100px;
  height:100px;
  display:block;
  background:darkred;
  transition: all 1s linear;
}
k.front{
  transform: translateZ(50px); 
}
k.back{
  transform: translateZ(-50px) rotateY(180deg);
}
k.bottom{
  transform:rotateX(-90deg) translateY(50px);
  transform-origin: left bottom;
}
k.left{
  transform:rotateY(270deg) translateX(-50px);
  transform-origin: center left;
}
k.right{
  transform:rotateY(-270deg) translateX(50px);
  transform-origin: top right;
}
k.top{
  transform:rotateX(-270deg) translateY(-50px);
  transform-origin: right top;
}

/* hover transformations */
.cube:hover{
  top:150px;
}
.cube:hover h.top{
  transform: translateZ(-100px) rotateX(175deg);
  transform-origin: top ;
}
.cube:hover k{
  top:-200px;
}

svg{

 

}
.pen{
  fill:black;
 animation:rotateInDownLeft 3s forwards;
}
.all{
  animation:rotateOut 3s forwards;
}
@keyframes rotateInDownLeft {
  from {
    transform-origin: left bottom;
    transform: rotate3d(0,0,0, 0deg);
    opacity: 1;
  }

  to {
    -webkit-transform-origin: left bottom;
    transform-origin: left bottom;
 transform: ;
 transform:translateX(850px) translateY(-83px) rotate3d(0,0,1, -60deg);
    opacity: 1;
  }
}
@keyframes rotateOut {
  from {
    -webkit-transform-origin: center;
    transform-origin: center;
    opacity: 1;
  }

  to {
    -webkit-transform-origin: center;
    transform-origin: center;
    -webkit-transform: rotate3d(0, 0, 1, 90deg);
    transform: rotate3d(0, 0, 1, 90deg);
    opacity: 1;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console