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

              
                <!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" type="text/css" href="css/main.css">
  </head>
  <body>
  <div class="btn-e js-show-shadow">show shadow</div>
  <div class="btn-e js-show-nums">show-nums</div>
  <div class="uncomment-e">(uncomment js in this pen to use buttons)</div>
    <div class="cube-l">
      <div class="facet-b is-zero">0
        <div class="reflection-be"></div>
      </div>
      <div class="facet-b is-1">1
        <div class="reflection-be"></div>
      </div>
      <div class="facet-b is-2">2
        <div class="reflection-be"></div>
      </div>
      <div class="facet-b is-3">3
        <div class="reflection-be"></div>
      </div>
      <div class="facet-b is-4">4
      </div>
      <div class="facet-b is-5">5
        <div class="reflection-be"></div>
      </div>
    </div>
  </body>
</html>
              
            
!

CSS

              
                body {
  background-color: #ccc;
  -webkit-perspective: 1000px;
  padding-bottom: 600px;
  color:black;
  font-family:monospace;
  font-weight:bold;

}
* {
  margin: 0;
  padding: 0;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
@-webkit-keyframes cube-animation {
  0% {
    -webkit-transform: translateZ(-150px) rotateX(60deg) rotateY(60deg);
  }

  33.33% {
    -webkit-transform: translateZ(-150px) rotateX(-20deg) rotateY(-50deg);
  }

  66.66% {
    -webkit-transform: translateZ(-150px) rotateX(40deg) rotateY(-50deg);
  }

  100% {
    -webkit-transform: translateZ(-150px) rotateX(10deg) rotateY(-100deg);
  }
}
@-webkit-keyframes reflection-animation {
  0% {
    -webkit-transform: translateX(-50%);
  }

  33.33% {
    -webkit-transform: translateX(33.33333333333%);
  }

  66.66% {
    -webkit-transform: translateX(-16.666666667%);
  }

  100% {
    -webkit-transform: translateX(83.333%);
  }
}
@-webkit-keyframes reflection-animation2 {
  0% {
    -webkit-transform: translateX(-100%);
  }

  33.33% {
    -webkit-transform: translateX(0%);
  }

  66.66% {
    -webkit-transform: translateX(-50%);
  }

  100% {
    -webkit-transform: translateX(50%);
  }
}
@-webkit-keyframes reflection-animation3 {
  0% {
    -webkit-transform: translateX(-100%);
  }

  33.33% {
    -webkit-transform: translateX(0%);
  }

  66.66% {
    -webkit-transform: translateX(-50%);
  }

  100% {
    -webkit-transform: translateX(-50%);
  }
}
@-webkit-keyframes reflection-animation4 {
  0% {
    -webkit-transform: translateX(-16.666666667%);
  }

  33.33% {
    -webkit-transform: translateX(66.666666667%);
  }

  66.66% {
    -webkit-transform: translateX(50%);
  }

  100% {
    -webkit-transform: translateX(0%);
  }
}
@-webkit-keyframes reflection-animation5 {
  0% {
    -webkit-transform: translateX(-16.666666667%);
  }

  33.33% {
    -webkit-transform: translateX(66.666666667%);
  }

  66.66% {
    -webkit-transform: translateX(-5%);
  }

  100% {
    -webkit-transform: translateX(-50%);
  }
}
@-webkit-keyframes reflection-animation6 {
  0% {
    -webkit-transform: translateX(0%);
  }

  33.33% {
    -webkit-transform: translateX(-100%);
  }

  66.66% {
    -webkit-transform: translateX(-150%);
  }

  100% {
    -webkit-transform: translateX(33.3333333%);
  }
}
.cube-l {
  width: 500px;
  height: 500px;
  position: absolute;
  left: 50%;
  top: 50%;
  margin-top:  -50px;
  margin-left: -150px;
  -webkit-transform-style: preserve-3d;
  -webkit-transform: translateZ(-150px) rotateX(0deg) rotateY(-40deg);
  -webkit-animation: cube-animation 6s ease-in-out infinite alternate;
}
.cube-l .facet-b {
  width: 300px;
  height: 300px;
  background-color: #111;
  border: 4px solid #eee;
  border-radius: 5px;
  position: absolute;
  color: #fff;
  color: #111;
  font-size: 100px;
  font-family: monospace;
  text-align: center;
  line-height: 300px;
  overflow: hidden;
  -webkit-filter: opacity(0.99999);
}
.cube-l .facet-b.is-zero .reflection-be {
  -webkit-animation: reflection-animation 6s ease-in-out infinite alternate;
}
.cube-l .facet-b.is-1 {
  -webkit-transform: rotate3d(0, 1, 0, 90deg) translate3d(150px, 0px, 150px);
}
.cube-l .facet-b.is-1 .reflection-be {
  -webkit-animation: reflection-animation2 6s ease-in-out infinite alternate;
}
.cube-l .facet-b.is-2 {
  -webkit-transform: rotate3d(1, 0, 0, 90deg) translate3d(0px, -150px, 150px);
}
.cube-l .facet-b.is-2 .reflection-be {
  -webkit-animation: reflection-animation3 6s ease-in-out infinite alternate;
}
.cube-l .facet-b.is-3 {
  -webkit-transform: rotate3d(0, 1, 0, -90deg) translate3d(-150px, 0px, 150px);
}
.cube-l .facet-b.is-3 .reflection-be {
  -webkit-animation: reflection-animation4 6s ease-in-out infinite alternate;
}
.cube-l .facet-b.is-4 {
  -webkit-transform: rotate3d(1, 0, 0, -90deg) translate3d(0px, 150px, 150px);
}
.cube-l .facet-b.is-4 .reflection-be {
  -webkit-animation: reflection-animation5 6s ease-in-out infinite alternate;
}
.cube-l .facet-b.is-5 {
  -webkit-transform: rotateY(180deg) translate3d(0px, 0px, 300px);
}
.cube-l .facet-b.is-5 .reflection-be {
  -webkit-animation: reflection-animation6 6s ease-in-out infinite alternate;
}
.reflection-be {
  width: 300%;
  height: 300%;
  position: absolute;
  top: 0;
  background: -webkit-gradient(linear, 100% 0%, 0% 100%, color-stop(0, rgba(255,255,255,0.5)), color-stop(0.5, rgba(255,255,255,0.1)), color-stop(0.5, rgba(255,255,255,0)), color-stop(1, rgba(255,255,255,0)));
}
.box-b {
  width: 500px;
  height: 500px;
  background-color: #111;
  overflow: hidden;
  margin: 200px auto;
  -webkit-animation: box-animation 6s ease infinite alternate;
}
@-webkit-keyframes box-animation {
  0% {
    -webkit-transform: rotateY(60deg);
    -webkit-transform: rotateX(60deg);
  }

  25% {
    -webkit-transform: rotateY(0deg);
  }

  50% {
    -webkit-transform: rotateY(-60deg);
  }

  75% {
    -webkit-transform: rotateY(0deg);
  }

  100% {
    -webkit-transform: rotateY(60deg);
  }
}



/* system */
.btn-e{
  background: #507eb3;
  box-shadow:none;
  display:inline-block;
  padding: 4px 12px;
  border-radius:3px;
  cursor:pointer;
}

.btn-e:hover{
  background: #73b4ff;
}

.btn-e:active{
  background: #6ca9f0;
}

.btn-e.is-check{
  background-color: #6ca9f0;
}

.uncomment-e{
  font-size: 10px;
}
              
            
!

JS

              
                ###UNCOMMENT TO MAKE BUTTONS WORK
TUTORIAL IS HERE http://www.ryancollins.me/###


###isShadow = false
$('.js-show-shadow').on 'click', ->
  $(@).toggleClass('is-check')
  isShadow = !isShadow
  overflow = if !isShadow then 'hidden' else 'visible'
  $('.facet-b').css
              'overflow': overflow
    
    
isNums = false
$('.js-show-nums').on 'click', ->
  $(@).toggleClass('is-check')
  isNums = !isNums
  overflow = if !isNums then '#111' else 'white'
  $('.facet-b').css
              'color': overflow###
              
            
!
999px

Console