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

              
                .wrapper
  ul.list
    li.list-item
      a.list-link(href="#")
        i.fas.fa-camera
        |Photo
    li.list-item
      a.list-link(href="#")
        i.fas.fa-file
        |Files
    li.list-item
      a.list-link(href="#")
        i.fas.fa-microphone
        |Record
    li.list-item
      a.list-link(href="#")
        i.fas.fa-comment-alt
        |New email
  button(type="button")
    i.fas.fa-paper-plane
    i.fas.fa-times
              
            
!

CSS

              
                $blue: #161722
$pink: #f04779

*
  box-sizing: border-box
  outline: none

html,
body
  width: 100%
  height: 100%
  margin: 0
  padding: 0
  
body
  display: flex
  justify-content: center
  align-items: center
  background-color: lighten($pink, 32%)
  
.wrapper
  max-width: 70px
  max-height: 70px
  position: relative
  background-color: $blue
  color: white
  border-radius: 35px
  transition: all .4s ease-out 0s
  
  &.active
    max-width: 500px
    max-height: 500px
    border-radius: 15px
    transition: all .7s ease-in 0s
    
    .list
      opacity: 1
      transform: scale(1)
      transition: all .3s ease-out .2s
        
      &-link
        opacity: 1
    
    button
      top: calc(100% + 10px)
      right: 0
      
      i.fa-paper-plane
        top: 0%
        left: 100%
        opacity: 0
        transition: all .5s ease-out 0s
        
      i.fa-times
        opacity: 1
        transform: translate(-50%, -50%) rotate(0)
        transition: all .3s ease-in .2s
  
.list
  list-style: none
  margin: 0
  padding: 15px 0
  overflow: hidden
  opacity: 0
  transform: scale(0)
  transition: all .5s ease-out 0s
    
  &-link
    display: block
    color: white
    text-decoration: none
    padding: 8px 30px
    opacity: 0
    transition: all .3s ease
    
    i
      position: relative
      left: 0
      margin-right: 10px
      transition: all .3s ease
    
    &:hover
      i
        left: -5px
        color: $pink
    
  
button
  width: 70px
  height: 70px
  position: absolute
  top: calc(50% - 35px)
  right: calc(50% - 35px)
  background-color: $pink
  color: white
  font-size: 22px
  border-radius: 35px
  border: none
  overflow: hidden
  cursor: pointer
  transition: all .5s ease
  
  &:hover
    background-color: darken($pink, 5%)
  
  i
    position: absolute
    top: 50%
    left: 50%
  
  i.fa-paper-plane
    transform: translate(-50%, -50%)
    transition: all .2s ease-in .2s
    
  i.fa-times
    opacity: 0
    transform: translate(-50%, -50%) rotate(-90deg)
    transition: all .3s ease-out 0s
    
              
            
!

JS

              
                const button = document.querySelector('button');

const onClickButton = e => {
  e.preventDefault();
  
  const wrapper = e.currentTarget.closest('.wrapper');

  if (wrapper.classList.contains('active')) {
    wrapper.classList.remove('active');
  } else {
    wrapper.classList.add('active');
  }
}

// Init
const init = () => {
  button.addEventListener('click', onClickButton, false);
};

document.addEventListener('DOMContentLoaded', init);
              
            
!
999px

Console