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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

            
              <div class="body">
<div class="box">
        <div class="front"><h1>我是大门</h1></div>
        <div class="back"><h1>我是后墙</h1></div>
        <div class="left"><h1>我是左侧</h1></div>
        <div class="right"><h1>我是右侧</h1></div>
        <div class="top"><h1>我是房顶</h1></div>
        <div class="bottom"><h1>我是地板</h1></div>

        <article class="front"><h1>我是大门</h1></article>
        <article class="back"><h1>我是后墙</h1></article>
        <article class="left"><h1>我是左侧</h1></article>
        <article class="right"><h1>我是右侧</h1></article>
        <article class="top"><h1>我是房顶</h1></article>
        <article class="bottom"><h1>我是地板</h1></article>
    </div>
</div>
            
          
!
            
              .body{
  -webkit-perspective: 1200px;
  -webkit-perspective-origin: center -300px;
  font-size: 14px;
}
h1{font-size:14px;}
.box{
  position: relative;
  width: 300px;
  height: 300px;
  margin: 200px auto;
  -webkit-transform-style: preserve-3d;
  -webkit-animation: animation 15s linear infinite;
  }
.box div, .box article{
  position: absolute;
  width: 300px;
  height: 300px;
  line-height: 300px;
  text-align: center;
  background: red;
  opacity: .8;
    border-radius: 50px;
    -webkit-transform-style: preserve-3d;
    -webkit-backface-visibility: visible;
    -webkit-transition: all .3s ease-in-out;
    }
  .box article{
    width: 100px;
    height: 100px;
    line-height: 100px;
    margin: auto;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    }
  .box:hover div.top{
    -webkit-transform: translateZ(-150px) rotateX(90deg) rotateY(45deg);
    }
  .box:hover article{
    top: -250px;
    }
  .box .front{
    background: red;
    -webkit-transform: translateZ(150px);
    }
  .box .top{
    -webkit-transform-origin: 100% 0%;
    background: #cc0000;
    -webkit-transform: translateZ(-150px) rotateX(90deg);
    }
  .box .back{
    background: gray;
    -webkit-transform: translateZ(-150px) rotateY(180deg);
    }
  .box .bottom{
    background: yellow;
    -webkit-transform: translateY(150px) rotateX(-90deg);
    }
  .box .left{
    background: blue;
    -webkit-transform: translateX(-150px) rotateY(-90deg);
    }
  .box .right{
    background: green;
    -webkit-transform: translateX(150px) rotateY(90deg);
    }

  .box article.front{
    background: red;
    -webkit-transform: translateZ(50px);
    }
  .box article.top{
    -webkit-transform-origin: 100% 0%;
    background: #cc0000;
    -webkit-transform: translateZ(-50px) rotateX(90deg);
    }
  .box article.back{
    background: gray;
    -webkit-transform: translateZ(-50px) rotateY(180deg);
    }
  .box article.bottom{
    background: yellow;
    -webkit-transform: translateY(50px) rotateX(-90deg);
    }
  .box article.left{
    background: blue;
    -webkit-transform: translateX(-50px) rotateY(-90deg);
    }
  .box article.right{
    background: green;
    -webkit-transform: translateX(50px) rotateY(90deg);
    }

  @-webkit-keyframes animation {
    0% {
    -webkit-transform: rotateY(0deg);
    }
  100% {
  -webkit-transform: rotateY(360deg);
  }
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console