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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                
<header class="header">
  <button id="nav-toggle" class="fab fab-primary nav-toggle">
    <i class="fa fa-bars"></i>
    <i class="fa fa-close"></i>
  </button>
</header>
<nav class="nav" id="nav">
  <ul class="nav-list">
    <li><a href="#">Blog</a></li>
    <li><a href="#">About Us</a></li>
    <li><a href="#">The Podcast</a></li>
    <li><a href="#">Contact</a></li>
  </ul>
<!--   <button class="fab fab-close">
    <i class="fa fa-close"></i>
  </button> -->
</nav>
<div class="nav-circle" id="nav-circle"></div>
<div class="ripple inner-ripple" id="inner-ripple"></div>
<div class="ripple middle-ripple" id="middle-ripple"></div>
<div class="ripple outer-ripple" id="outer-ripple"></div>
  
              
            
!

CSS

              
                $red:           #E71322;
$tan:           #F3F8D8;
$light_blue:    #A6DDED;
$blue:          #2679ED;

html {
  overflow: hidden;
}

body {
  background-color: $tan;
  position: relative;
  font-family: 'Open Sans', sans-serif;
}

a {
  text-decoration: none;
  color: $blue;
  border: 1px solid transparent;
  transition: all 0.15s ease-out;
  &:hover {
    color: $light_blue;
    border-bottom: 1px solid $blue;
  }
}

.header {
  // display: flex;
  // align-items: center;
  // justify-content: center;
  height: 100vh;
  position: relative;
}

.nav {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  z-index: 8;
  // opacity: 0;
  pointer-events: none;
  // min-width: 10em;
  width: 25em;
  text-align: center;
}

.nav-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
  line-height: 3.5em;
  li {
    opacity: 0;
    transform: translateX(-100px);
  }
}

.nav-circle {
  width: 10px;
  height: 10px;
  position: absolute;
  background-color: darken($red, 25%);
  background-image: radial-gradient(darken($red, 10%), darken($red, 25%));
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  border-radius: 50%;
  z-index: 5;
}

.nav a {
  color: white;
  font-size: 2em;
  font-weight: 100;
  text-shadow: 1px 1px 2px rgba(black, 0.2);
  box-sizing: border-box;
  position: relative;
  border: none;
  &:after {
    left: 50%;
    bottom: 0%;
    transform: translateX(-50%);
    content: '';
    display: block;
    // width: 100%;
    height: 2px;
    background-color: white;
    position: absolute;
    width: 0;
    transition: all 0.15s ease-out;
  }
  &:hover {
    border: none;
  }
  &:hover:after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background-color: white;
    position: absolute;
  }
}

.fab {
  z-index: 10;
  border-radius: 50%;
  outline: 0;
  border: 0;
  padding: 1em;
  width: 3em;
  height: 3em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 5px rgba(black, 0.5), 0 0 2px rgba(black, 0.25);
  transition: all 0.15s ease-out;
  &:hover {
    box-shadow: 0 4px 8px rgba(black, 0.65);
  }
  &:active {
    transform: translateX(-50%) translateY(-50%) scale(0.9);
    box-shadow: 0 1px 2px rgba(black, 0.35);
  }
  &:focus {
    outline: none;
  }
}

.fab.fab-primary {
  background-color: $blue;
  color: $light_blue;
  &:hover {
    color: darken($blue, 20%);
  }
  &:active {
    background-color: darken($blue, 10%);
  }
}

.fab.fab-close {
  background-color: $red;
  color: white;
  &:hover {
    color: white;
  }
}

.nav-toggle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  display: flex;
  flex-wrap: wrap;
  overflow: hidden;
  transition: all 0.25s ease-out;
  i {
    width: 3em;
    height: 3em;
    transition: all 0.25s ease-out; 
  }
  &.open {
    background-color: white;
    color: $blue;
    top: 75%;
    transform: translateY(100%) translateX(-50%);
    // bottom: 10vh;
    i {
      transform: translateY(-3em);
    }
    &:active {
      transform: translateX(-50%) translateY(100%) scale(0.9);
      background-color: $light_blue;
    }
  }
}

.ripple {
  width: 0;
  height: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%) scale(1);
  border-radius: 50%;
  z-index: 4;
  // transition: all 0.15
  // transform-origin: 50% 50%;
  animation: pulse 4s infinite;
  transition-timing-function: cubic-bezier(0.250, 0.460, 0.450, 0.940);
}

.inner-ripple {
  background-color: rgba($blue, 0.5);
  // opacity: 0.5;
  width: 100px;
  height: 100px;
  // animation-duration: 3s;
}

.middle-ripple {
  background-color: rgba($blue, 0.25);
  // opacity: 0.25;
  width: 200px;
  height: 200px;
  animation-delay: 0.35s;
  // animation-duration: 4s;
}

.outer-ripple {
  background-color: rgba($blue, 0.15);
  // opacity: 0.15;
  width: 350px;
  height: 350px;
  animation-delay: 0.75s;
}

@keyframes pulse {
  0% {
    opacity: 0;
    transform: scale(1) translateX(-50%) translateY(-50%);
  }
  30% {
    opacity: 0.5;
  }
  100% {
    transform: scale(1.5) translateX(-33.3%) translateY(-33.3%);
    opacity: 0;
  }
}

              
            
!

JS

              
                $(document).ready(function() {
  var $nav_toggle = $('#nav-toggle');
  // var $nav_toggle_after = $('#nav-toggle::after');
  var $nav_circle = $('#nav-circle');
  var $nav = $('#nav');
  var $nav_list_items = $nav.find('li');
  // var $nav_links = $
  var $ripples = $('.ripple');
  
  TweenMax.set($nav_list_items, {
    transformOrigin: 'center center',
  });
  
  // TweenMax.set($ripples, {
  //   transformOrigin: 'center center',
  // });
  
  

  
  
  $nav_toggle.click(function() {
    if($(this).hasClass('open')) {
      // NAV CLOSES
      TweenMax.to($nav_circle, 1, {
        width: '10px',
        height: '10px',
        ease: Power4.easeOut,
      });
      TweenMax.set($nav, {
        pointerEvents: 'none',
      });
      TweenMax.to($nav_list_items, 0.5, {
        opacity: '0',
        // x: '-100px',
      });
      TweenMax.set($nav_list_items, {
        x: '-100px',
        delay: 0.5,
      });
    } else {
      // NAV OPENS
      TweenMax.to($nav_circle, 1, {
        width: '400vw',
        height: '400vw',
        ease: Power4.easeOut,
      });
      TweenMax.set($nav, {
        pointerEvents: 'auto',
      });
      TweenMax.staggerTo($nav_list_items, 0.5, {
        opacity: '100',
        x: 0,
        ease: Power4.easeOut,
      }, 0.15);
      TweenMax.to($ripples, 0.5, {
        opacity: '0',
      });
    }
    $(this).toggleClass('open');
  });
});
              
            
!
999px

Console