Pen Settings

HTML

CSS

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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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.

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="scene">
  <div class="floor"></div>
  <div class="cube">
    <div class="front"><div class="front-text">Code</div></div>
    <div class="back"><div class="back-text">Code</div></div>
    <div class="left"><div class="left-text">PRO</div></div>
    <div class="right"><div class="right-text">PRO</div></div>
    <div class="top">
      <div class="ballShadow"></div>
    </div>
    <div class="bottom"></div>
  </div>
  <div class="ball"></div>
</div>
              
            
!

CSS

              
                :root {
  --boxColor: #89a02c70; /*#0ff7;*/
  --rotateSpeed: 30s;
  --bounceSpeed: 1.3s;
}

body {
  background-color: #000;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content:center;
  align-items: center;
  font-size: 75px;
  perspective: 10em;
  perspective-origin: 50% calc(50% - 2em);
}
.scene{
  position: relative;
  transform-style: preserve-3d;
  animation: sceneRotate var(--rotateSpeed) infinite linear;
  @keyframes sceneRotate {
    to { transform: rotateY(360deg); }
  }
}
.ball {
  width: 1em;
  height: 1em;
  border-radius: 50%;
  background-color: #b3df00;
  position: absolute;
  left: -.5em;
  bottom: 1em;
  background-image: radial-gradient(
    circle at top,
    #b3df00, 50%,#000
  );
  animation: 
    ballBounce var(--bounceSpeed) infinite ease-out,
    sceneRotate var(--rotateSpeed) infinite linear reverse;
  @keyframes ballBounce {
    0%, 100% { bottom: 0.5em; }
    50% {bottom: 3em;  animation-timing-function: ease-in; }
  }
}
.ballShadow{
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(#0007, #0000 50%);
  animation: ballShadow var(--bounceSpeed) infinite ease-out;
  @keyframes ballShadow {
    0%, 7%, 95%, 100% { transform: scale(1); }
    50% { transform: scale(2); opacity: 0.5; animation-timing-function: ease-in;}
  }
}
.cube {
  width: 2em;
  height: 2em;
  transform-style: preserve-3d;
  position: absolute;
  bottom: -1em;
  left: -1em;
  animation: cubeCollision var(--bounceSpeed) infinite linear;
  //
  @keyframes cubeCollision {
    0%, 100% { height: 1.5em; }
    7%, 95% { height: 2em; }
  }
  // */
  
  .left, .right, .front, .back{
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--boxColor);
    box-shadow: 0 0 0.5em #000a inset;
  }
    
  .front{
    transform: translateZ(1em);
    
    .front-text {
      font-family: 'Source Code Pro', monospace;
      font-size: 0.7em;
      text-align: right;
      margin: 0;
      padding: 0;
      color: rgba(0,0,0,0.6);
      text-shadow: 2px 2px 0 rgba(255,255,255,0.15);
    }
  }
  
  .right{
    transform: 
      rotateY(90deg) 
      translateZ(1em);
    
    .right-text{
      font-family: 'Archivo Black', sans-serif;
      font-size: 0.75em;
      margin: 0;
      padding: 0;
      color: rgba(0,0,0,0.6);
      text-shadow: 2px 2px 0 rgba(255,255,255,0.15);
    }
  }
  .back{
    transform: rotateY(180deg) translateZ(1em);
    .back-text{
      position: absolute;
      bottom: 0;
      right: 0;
      font-family: 'Source Code Pro', monospace;
      font-size: 0.7em;
      margin: 0;
      padding: 0;
      color: rgba(0,0,0,0.6);
      text-shadow: 2px 2px 0 rgba(255,255,255,0.15);
      animation: textSquash var(--bounceSpeed) infinite linear;
      @keyframes textSquash {
        0%, 100% { bottom: 0 }
        7%, 95% { bottom: 5px; }
      }
    }
  }
  .left{
    transform: rotateY(270deg) translateZ(1em);
    .left-text{
      position: absolute;
      left: 0;
      bottom: -8px;
      font-family: 'Archivo Black', sans-serif;
      font-size: 0.75em;
      margin: 0;
      padding: 0;
      color: rgba(0,0,0,0.6);
      text-shadow: 2px 2px 0 rgba(255,255,255,0.15);
      animation: textSquash1 var(--bounceSpeed) infinite linear;
      @keyframes textSquash1 {
        0%, 100% { bottom: -8px; }
        7%, 95% { bottom: -3px; }
      }
    }
  }
  .top{
    position: absolute;
    width: 2em;
    height: 2em;
    background: var(--boxColor);
    transform: translateY(-50%) rotateX(90deg);
    box-shadow: 0 0 0.5em #000a inset;
  }
  .bottom{
    position: absolute;
    width: 2em;
    height: 2em;
    bottom: 0;
    background: #0007;
    transform: translateY(50%) rotateX(90deg);
    box-shadow: 0 0 0.5em #000;
  }
}
.floor {
  width: 15em;
  height: 15em;
  background-image: 
    radial-gradient(#0000, #000 75%),
    repeating-conic-gradient(
      from 45deg, 
      #111 0deg 90deg, 
      #222 90deg 180deg);
  background-size: 100%, 1em 1em;
  position: absolute;
  top: 1em;
  transform: 
    translate(-50%, -50%)
    rotateX(90deg);
}


              
            
!

JS

              
                
              
            
!
999px

Console