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

              
                <button class="bin">๐Ÿ—‘</button>
<button class="overlay" disabled></button>
<div>
  <small>
    <i></i>
  </small>
</div>
              
            
!

CSS

              
                .overlay{
  width: 100%;
  height: 100%;
  background: transparent;
  border: 0;
  position: fixed;
  z-index: -1;
  pointer-events: none;
}

.bin{
  --black: #000000;
  --binbg: #e6e6e6;
  --width: 40px;
  --height: 50px;
  // bin stripe
  background-image: 
  repeating-linear-gradient(to right, 
  transparent, transparent 5px, 
  var(--black) 5px, 
  var(--black) 7px, transparent 7px);
  background-size: 11px calc(var(--height) / 2);
  background-position: 2px center;
  background-repeat: repeat-x;
  margin: auto;
  position: relative;
  background-color: var(--binbg);
  border: 0;
  color: transparent;
  width: var(--width);
  height: var(--height);
  border: 2px solid var(--black);
  border-radius: 0 0 6px 6px;
  // bin cap
  &::after,
  &::before{
    content: '';
    position: absolute;
    transform-origin: left bottom;
    transition: 200ms ease-in-out;
    border-width: 2px;
    border-style: solid;
    margin: auto;
    right: 0;
  }
  &::after{
    left: -4px;
    top: -5px;
    height: 7px;
    width: var(--width);
    border: 2px solid var(--black);
    background-color: var(--binbg);
    border-radius: 5px 5px 0 0;
  }
  &::before{
    top: -8px;
    height: 2px;
    width: 10px;
    border-color: var(--black) var(--black) transparent var(--black);
    left: 0;
  }
  // open bin
  &:focus,
  &:active{
    outline: none;
    cursor: none;
    &::before,
    &::after{
      transform-origin: left bottom;
      transform: rotate(-45deg);
    }
    &::before{
      top: -18px;
      left: -23px;
      right: 3px;
    }
    // hide cursor
    ~ div{
      cursor: none;
      z-index: 1;
      &:hover{
        cursor: none;
      }
    }
    ~ .overlay{
      pointer-events: inherit;
      z-index: 2;
      cursor: none;
    }
    ~ div{
      > small{
        opacity: 1;
        animation: throw 300ms 30ms cubic-bezier(0.215, 0.61, 0.355, .3) forwards
      }
    }
  }
}
// overlay
div{
  position: fixed;
  width: 100%; 
  height: 100%;
  z-index: -1;
  cursor: none;
  &:focus,
  &:active,
  &:hover{
    z-index: 1;
    cursor: none;
  }
  // cursor ui
  > small{
    position: absolute;
    width: 20px;
    height: 16px;
    left: 0;
    right: -58px;
    margin: auto;
    top: 27px;
    bottom: 0;
    border-left: 1px solid black;
    opacity: 0;
    &::before,
    &::after{
      content: '';
      position: absolute;
      width: 1px;
      border-right: 1px solid black;
    }
    &::before{
      height: 17px;
      transform: rotate(-42deg);
      top: -3px;
      right: 13px;
    }
    &::after{
      height: 4px;
      transform: rotate(-112deg);
      top: 18px;
      right: 11px;
    }
    > i{
      &::before,
      &::after{
        content: '';
        position: absolute;
        border-top: 1px solid black;
      }
      &::before{
        border-left: 1px solid black;
        width: 4px;
        bottom: -4px;
        height: 4px;
        transform: rotate(66deg);
      }
      &::after{
        border-right: 1px solid black;
        width: 5px;
        bottom: -2px;
        height: 5px;
        transform: rotate(-114deg);
        right: 6px;
      }
    }
  }
}

@keyframes throw{
  0%{
    transform: translate(0, 0);
  }
  50%{
    transform: translate(0, -30px) rotate(-10deg);
  }
  60%{
    transform: translate(0, -40px) rotate(-30deg);
  }
  70%{
    transform: translate(-5px, -50px) rotate(-40deg) scale(1);
    opacity: 1;
  }
  80%{ 
    transform: translate(-10px, -60px) rotate(-60deg) scale(.9);
    opacity: 1;
  }
  90%{
    transform: translate(-20px, -50px) rotate(-100deg) scale(.5);
    opacity: .8;
  }
  100%{
    transform: translate(-30px, -20px) rotate(-80deg) scale(.4);
    opacity: 0;
  }
}

              
            
!

JS

              
                // www.jerecho.com
              
            
!
999px

Console