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. 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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                .container
  input#handle.checkbox(type="checkbox")
  label.handle(for="handle")
  .wrapper
    .board.item1
      each digit, i in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
        .digit #{digit}
    .board.item2
      each digit, i in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
        .digit #{digit}
    .board.item3
      each digit, i in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
        .digit #{digit}
              
            
!

CSS

              
                $font: 5rem
$w: 1 * $font
$h: 1.4 * $font
$pd: 2.5rem

@keyframes shuffle
  0%
    transform: translate3d(0, 0, 0)
  100%
    transform: translate3d(0, #{-$h * 10}, 0)
  
body
  color: #fff
  background: MediumAquaMarine
  font-size: 100%

.container
  position: fixed
  top: 50%
  left: 50%
  margin-top: - ($h + $pd * 2) / 2
  margin-left: - ($w * 3 + $pd * 2) / 2
  padding: $pd
  border-radius: 10px
  background: linear-gradient(to bottom, #666, #444)
  box-shadow: 0 2px 10px rgba(#000, 0.4)
  &:before
    content: ""
    position: absolute
    top: 17%
    left: 10%
    height: 66%
    width: 80%
    border-radius: 10px
    box-shadow: 0 0 5px rgba(#000, 0.1), 0 -1px 0 1px rgba(#fff, 0.1)
    background: linear-gradient(to bottom, #444, #666)
  
.wrapper
  position: relative
  display: flex
  width: $w * 3
  height: $h
  overflow: hidden
  background: #333
  box-shadow: inset 0 0px 8px #000, 0 1px 0px  1px rgba(#fff, 0.4)
  border-radius: 10px
  text-align: center
  color: #fff
  text-shadow: -2px -2px 0 #aaa
  font: #{$font}/1.4 monaco, monospace

.board
  flex-grow: 1

.checkbox
  display: none
  ~ .wrapper
    > .board
      animation-play-state: paused !important
      @for $i from 1 through 3
        &.item#{$i}
          animation: shuffle #{1.5s - $i * 0.2s} steps(10) infinite
  &:checked 
    ~ .handle
      &:before
        transform: rotateX(180deg)
      &:after
        transform: translateY(140px)
    ~ .wrapper > .board
      animation-play-state: running !important

.handle
  position: absolute
  right: 0
  top: 50%
  $transition: transform 0.2s ease
  &:before
    content: ""
    position: absolute
    bottom: 0
    width: 20px
    height: 60px
    background: linear-gradient(to right, #bbb 0%, #eee 30%, #bbb 100%)
    border-radius: 0 0 10px 0
    transform-origin: bottom center
    transition: $transition
  &:after
    content: ""
    position: absolute
    bottom: 55px
    left: -5px
    width: 30px
    height: 30px
    border-radius: 50%
    background: radial-gradient(circle farthest-corner at 25% 25%, LightSalmon 0%, tomato 100%)
    transform-origin: bottom center
    transition: $transition
              
            
!

JS

              
                
              
            
!
999px

Console