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

              
                .main-ctr

  .screen-ctr
    // content
    .content
      .par-ctr
        .par
        .par.half
      .img
      .par-ctr
        .par.half

    // nav
    .nav
      .fab-ctr
        .fab.ion-android-share-alt
        
    // ripple
    .ripple

    // links
    ul.links
      li.ion-social-twitter
      li.ion-social-facebook
      li.ion-social-googleplus
      li.close.ion-android-close
              
            
!

CSS

              
                @import "bourbon";

$animDuration: .25s;

html,
body {
  width: 100%;
  height: 100%;
  display: table;
  background: white;
  overflow: hidden;
}

@include keyframes(ripple){
  to {
    @include transform(scale(1.8));
    opacity: 0;
  }
}

.main-ctr {
  display: table-cell;
  vertical-align: middle;
  text-align: center;
}

.screen-ctr {
  background: white;
  width: 360px;
  height: 500px;
  border: 1px solid #ddd;
  position: relative;
  margin: auto;
  text-align: center;
  padding: 20px 10px;
  box-sizing: border-box;
  
  .ripple {
    @include position(absolute, x 10px 10px x);
    @include transform-origin(center center);
    @include transform(scale(.9));
    @include animation(1.5s ripple ease infinite);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px solid #4285F4;
    box-sizing: border-box;
    
    &.off {
      opacity: 0;
    }
  }
  
  .par-ctr {
    margin-bottom: 30px;
  }
  
  .par {
    background: #eee;
    width: 100%;
    height: 20px;
    margin-bottom: 10px;
    
    &.half {
      width: 50%;
    }
  }
  
  .img {
    width: 100%;
    height: 200px;
    background: #eee;
    margin-bottom: 30px;
    
    &:last-child {
      margin-bottom: 0;
    }
  }
  
  .nav {
    @include position(absolute, x 0 0 0);
    height: 80px;
    
    &.active {
      overflow: hidden;
    }
  }
  
  .fab-ctr {
    z-index: 9;
    width: 100%;
    @include position(absolute, x 0 0 x);
    @include transform-origin(center center);
    @include transform(rotate(0) translateX(0) translateY(0));
    padding: 10px;
    will-change: transform;
    transition: $animDuration all ease-in-out;
    
    &.active {
      @include transform(rotate(-45deg) translateX(-142.5px) translateY(7px));
    }
    
    &.active .fab {
      color: transparent;
      box-shadow: none;
    }
  }
  
  .fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #4285F4;
    float: right;
    will-change: transform;
    transition: $animDuration all ease-in-out;
    cursor: pointer;
    z-index: 999;
    color: white;
    line-height: 60px;
    font-size: 20px;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.35);
    
    &:hover {
      background: lighten(#4285F4, 5%);
    }
    
    &.active {
      @include transform(scale(6.5));
      transition: $animDuration all ease-in-out;
      pointer-events: none;
    }
  }
  
  .links {
    @include position(absolute, x 0 0 0);
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    transition: .3s all ease;
    color: white;
    
    &.active {
      pointer-events: auto;
      opacity: 1;
    }
    
    li {
      width: 25%;
      height: 80px;
      float: left;
      background: transparent;
      text-align: center;
      line-height: 80px;
      font-size: 26px;
      
      &.close {
        cursor: pointer;
      }
    }
  }
}
              
            
!

JS

              
                # variables declaration
fab = document.querySelector ".fab"
fabCtr = document.querySelector ".fab-ctr"
nav = document.querySelector ".nav"
links = document.querySelector ".links"
close = document.querySelector ".close"
ripple = document.querySelector ".ripple"

# fab click
fab.addEventListener "click", ->
  fabCtr.classList.add "active"
  ripple.classList.add "off"
  setTimeout ( -> nav.classList.add "active"), 200
  setTimeout ( 
    -> 
      fab.classList.add "active"
      links.classList.add "active"
  ), 150

# close click
close.addEventListener "click", ->
  links.classList.remove "active"
  fab.classList.remove "active"
  setTimeout ( -> nav.classList.remove "active"), 200
  setTimeout ( 
    ->
      fabCtr.classList.remove "active"
      ripple.classList.remove "off"
  ), 150
              
            
!
999px

Console