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 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="container">
  <button class="burgermenu">
    <span></span>
  </button>
</div>
              
            
!

CSS

              
                @import "nib"

body
  background: black

.container
  position: absolute
  top: 0
  left: 0
  width: 100%
  height: 100%

.burgermenu
  border: none
  background: none
  width: 65px
  height: 45px
  position: absolute
  top: 50%
  left: 50%
  margin-left: -25px
  margin-top: -25px
  padding: 0
  opacity: 0.5
  transition: opacity 0.5s ease
  outline: none
  &:hover
    opacity: 1
      
  span
    display: block
    width: 100%
    height: 1px
    position: absolute
    top: 0
    left: 0
    border-top: 1px solid white
    transform: translateY(22px)
    transition: transform 0.5s ease, border-color 0.5s ease 0.3s
    &:before
      content: ''
      position: absolute
      top: 0
      left: 0
      width: 100%
      height: 1px
      background: white  
      transform: translateY(-22px)
      animation-name: topLineBurger
      animation-duration: 0.6s
      animation-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1.000)
      animation-fill-mode: forwards
    &:after
      content: ''
      position: absolute
      top: 0
      left: 0
      width: 100%
      height: 1px
      background: white
      transform: translateY(22px)
      animation-name: bottomLineBurger
      animation-duration: 0.6s
      animation-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1.000)
      animation-fill-mode: forwards
   &.opened
    span
      border-color: transparent
      transition: border-color 0.3s ease
      &:before
        animation-name: topLineCross
        animation-duration: 0.6s
        animation-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1.000)
        animation-fill-mode: forwards
      &:after
        animation-name: bottomLineCross
        animation-duration: 0.6s
        animation-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1.000)
        animation-fill-mode: forwards


@keyframes topLineCross {
  0% {
    transform: translateY(-22px)
  }
  50% {
    transform: translateY(0px)
  }
  100% {
    transform: translateY(0px) rotate(45deg)
  }
}

@keyframes bottomLineCross {
  0% {
    transform: translateY(22px)
  }
  50% {
    transform: translateY(0px)
  }
  100% {
    transform: translateY(0px) rotate(-45deg)
  }
}

@keyframes topLineBurger {
  0% {
    transform: translateY(0px) rotate(45deg)
  }
  50% {
    transform: rotate(0deg)
  }
  100% {
    transform: translateY(-22px) rotate(0deg)
  }
}

@keyframes bottomLineBurger {
  0% {
    transform: translateY(0px) rotate(-45deg)
  }
  50% {
    transform: rotate(0deg)
  }
  100% {
    transform: translateY(22px) rotate(0deg)
  }
}
              
            
!

JS

              
                opened = false;
window.onload = function() {
  var btn = document.getElementsByTagName('button')[0];
  btn.addEventListener('click', onBtnClick)
}

function onBtnClick(e) {
  this.classList.toggle('opened');
}
              
            
!
999px

Console