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 id="byebyecube"></div>
              
            
!

CSS

              
                black(alpha)
  rgba(0,0,0,alpha)

@keyframes cube-drop
  20%
    transform: translateY(0) translateZ(-1px)
  80%,
  100%
    transform: translateY(153px) translateZ(-1px)

@keyframes cube-shadow
  0%,
  20%
    transform: translateY(0) rotate(-30deg) skew(30deg)
    box-shadow: -50px 45px 10px -10px black(.3)
  37%
    box-shadow: -2px 2px 2px black(.5)
  37%,
  100%
    transform: translateY(42px) rotate(-30deg) skew(30deg)
  39%,
  100%
    box-shadow: -2px 2px 1px black(0)

#byebyecube
  width: 300px
  height: 400px
  position: relative
  left: 50%
  top: 0
  margin-left: -(@width/2)
  background-image: linear-gradient( 30deg, #aaa 30%, rgba(170, 170, 170,0) 30.1%),
                    linear-gradient(-30deg, #aaa 30%, rgba(170, 170, 170,0) 30.1%)
  transform-style: preserve-3d

  &:before, &:after
    display: block
    content: ''
    position: absolute

  &:before
    width: 200px
    height: 280px
    left: 50px
    top: -8px
    background-repeat: no-repeat
    background-image: linear-gradient( 30deg, transparent 26%, #ccc 26.3%, #ccc 74%, transparent 74.3%),
                      linear-gradient(150deg, transparent 26%, #999 26.3%, #999 74%, transparent 74.3%),
                      linear-gradient(150deg, transparent 26%, #eee 26.3%, #eee 73%, transparent 73%),
                      linear-gradient( 30deg, transparent 27%, #eee 27%, #eee 74%, transparent 74.3%),
                      radial-gradient(circle at center, #eee 20%, transparent 20%)
    background-size: 50% 60%
    background-position: 0 100%,
                         100% 100%,
                         0 48.5%,
                         100% 48.5%,
                         50% 60%
    animation: cube-drop 6000ms infinite alternate linear
    z-index: -1

  &:after
    width: 113px
    height: 100px
    left: 92px
    top: 164px
    z-index: 0
    animation: cube-shadow 6000ms infinite alternate linear

html
  height: 100vh
  display: flex
  align-items: center
  justify-content: center
  overflow: auto
  background-color: #aaa
    
body
  width: 100%
  z-index: 1
  overflow: hidden
  height: 400px
  background-color: #aaa
              
            
!

JS

              
                
              
            
!
999px

Console