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.

            
              <div class="container">
  <div class="scene">
    <div class="sides">
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
					    </div>
  </div>
  <img class="eye" src="https://askd.github.io/codepen/eye.png" width="64" height="40" alt="">
</div>
            
          
!
            
              .container {
  position: relative;
  width: 420px;
  height: 360px;
  margin: 20px auto 0;
}

.scene {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  perspective: 400px;
  perspective-origin: 50% 50%;
  animation: example-scene 20s linear infinite;
}

.sides {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  display: flex;
  flex-wrap: wrap;
}

.sides div {
  width: 120px;
  height: 100px;
  margin: 10px;
  background: #6988BE;
}

.sides div:first-child,
.sides div:last-child {
  margin: 10px 150px;
}

.sides div:first-child {
  transform: rotateX(-30deg);
}
.sides div:nth-child(2) {
  transform: rotateY(30deg);
}
.sides div:nth-child(4) {
  transform: rotateY(-30deg);
}
.sides div:last-child {
  transform: rotateX(30deg);
}

@keyframes example-scene {
  0% { perspective-origin: 50% 50%; }
	10% { perspective-origin: 0 50%; }
	20% { perspective-origin: 0 0; }
	30% { perspective-origin: 50% 0; }
	40% { perspective-origin: 100% 0; }
	50% { perspective-origin: 100% 50%; }
	60% { perspective-origin: 100% 100%; }
	70% { perspective-origin: 50% 100%; }
	80% { perspective-origin: 0 100%; }
	90% { perspective-origin: 0 50%; }
	100% { perspective-origin: 50 50%; }
}

.eye {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -22px 0 0 -32px;
  animation: example-eye 20s linear infinite;
}

@keyframes example-eye {
  0% { left: 50%; top: 50%; }
	10% { left: 0; top: 50%; }
	20% { left: 0; top: 0; }
	40% { left: 100%; top: 0; }
	60% { left: 100%; top: 100%; }
	80% { left: 0; top: 100%; }
	90% { left: 0; top: 50%; }
	100% { left: 50%; top: 50%; }
}
            
          
!
999px
Loading ..................

Console