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

              
                <link href='https://fonts.googleapis.com/css?family=Roboto:500' rel='stylesheet' type='text/css'>
<div class="main-wrapper">
  <nav class="top-nav">
    <div class="top-nav__burger">
      <div class="top-nav__burger__layer"></div>
      <div class="top-nav__burger__text">Menu</div>
    </div>
    <div class="top-nav__search">
      <div class="top-nav__search-icon"></div>
    </div>
  </nav>
  <nav class="main-nav">
    <ul>
      <li class="main-nav__element">
        <a class="main-nav__element__link" href="#">
          Home
        </a>
      </li>
      <li class="main-nav__element">
        <a class="main-nav__element__link" href="#">
          Home
        </a>
      </li>
      <li class="main-nav__element">
        <a class="main-nav__element__link" href="#">
          Home
        </a>
      </li>
      <li class="main-nav__element">
        <a class="main-nav__element__link" href="#">
          Home
        </a>
      </li>
      <li class="main-nav__element">
        <a class="main-nav__element__link" href="#">
          Home
        </a>
      </li>
      <li class="main-nav__element">
        <a class="main-nav__element__link" href="#">
          Home
        </a>
      </li>
      <li class="main-nav__element">
        <a class="main-nav__element__link" href="#">
          Home
        </a>
      </li>
      <li class="main-nav__element">
        <a class="main-nav__element__link" href="#">
          Home
        </a>
      </li>
      <li class="main-nav__element">
        <a class="main-nav__element__link" href="#">
          Home
        </a>
      </li>
      <li class="main-nav__element">
        <a class="main-nav__element__link" href="#">
          Home
        </a>
      </li>
    </ul>
  </nav>
  <aside class="search">
    <form>
      <input type="text" class="input--text" placeholder="Search..."/>
    </form>
  </aside>
  <div class="page">
    <div class="head" style="background-image:url(https://c1.staticflickr.com/9/8604/16733520202_a56b8cc967_h.jpg)">
  
      <div class="centerwrapper centerwrapper--wide">
        <h1 class="header header--one text--center light">Title of the post</h1>
        <ul class="post--details white">
          <li class="author">
            by Amando Filipe
          </li>
          <li class="author">
            on Wednesday 12, November, 2015
          </li>
        </ul>
      </div>
    </div>
    <div class="content">
      <div class="centerwrapper centerwrapper--medium">
        <div class="text--block text--justify">
  
          <p>Something fdshfg dshfg dsh gdfh gfd h gfd h g dfh g fd hg fhdhgfd hg fdhgf dhg dfh gdfh gsd f areg tghufids h  gudfhsg f gis giorts vfd sg fhz yg jfud s ugfo dhsuo ghfd shbl fdsl hgbfl d ugd shfl dsuh gfioud h gd  gfd hg x bnfgd hgfxngdfjnghfdSomething fdshfg dshfg dsh gdfh gfd h gfd h g dfh g fd hg fhdhgfd hg fdhgf dhg dfh gdfh gsd f areg tghufids h  gudfhsg f gis giorts vfd sg fhz yg jfud s ugfo dhsuo ghfd shbl fdsl hgbfl d ugd shfl dsuh gfioud h gd  gfd hg x</p>
          <blockquote class="quote quote--left">The quick brown fox jumped over the lazy dog</blockquote>
          <p>bnfgd hgfxngdfjnghfd Something fdshfg dshfg dsh gdfh gfd h gfd h g dfh g fd hg fhdhgfd hg fdhgf dhg dfh gdfh gsd f areg tghufids h  gudfhsg f gis giorts vfd sg fhz yg jfud s ugfo dhsuo ghfd shbl fdsl hgbfl d ugd shfl dsuh gfioud h gd  gfd hg x bnfgd hgfxngdfjnghfd Something fdshfg dshfg dsh gdfh gfd h gfd h g dfh g fd hg fhdhgfd hg fdhgf dhg dfh gdfh gsd f areg tghufids h  gudfhsg f gis giorts vfd sg fhz yg jfud s ugfo dhsuo ghfd shbl fdsl hgbfl d ugd shfl dsuh gfioud h gd  gfd hg x bnfgd hgfxngdfjnghfd Something fdshfg dshfg dsh gdfh gfd h gfd h g dfh g fd hg fhdhgfd hg fdhgf dhg dfh gdfh gsd f areg tghufids h 
    gudfhsg f gis giorts vfd sg fhz yg jfud s ugfo dhsuo ghfd shbl fdsl hgbfl d ugd shfl dsuh gfioud h gd  gfd hg x bnfgd hgfxngdfjnghfd</p>
        </div>
      </div>
    
      <div class="centerwrapper centerwrapper--screen">
        <img src="https://c2.staticflickr.com/8/7286/16817005875_a75e5e0be4_h.jpg" class="img img--100p" /> 
        <div class="img--caption italic left-padding top-padding bottom-padding ">
          Porto by Amando Filipe
        </div>
  </div>
    
    <div class="centerwrapper centerwrapper--medium">
      <div class="text--block">
  <p>Something fdshfg dshfg dsh gdfh gfd h gfd h g dfh g fd hg fhdhgfd hg fdhgf dhg dfh gdfh gsd f areg tghufids h  gudfhsg f gis giorts vfd sg fhz yg jfud s ugfo dhsuo ghfd shbl fdsl hgbfl d ugd shfl dsuh gfioud h gd  gfd hg x bn</p><blockquote class="quote quote--right">A quote about a thing or two, potatoes, carrots, brown, rainbow, snake, tetris, jump, saddle, horse, teeth</blockquote>
<p>hgfxngd fjngh fdSome thing fdshfg dshfg dsh gdfh gfd h gfd h g dfh g fd hg fhdhgfd hg fdhgf dhg dfh gdfh gsd f areg tghufids h  gudfhsg f gis giorts vfd sg fhz yg jfud s ugfo dhsuo ghfd shbl fdsl hgbfl d ugd shfl dsuh gfioud h gd  gfd hg x bnfgd hgfxngdfjnghfd Something fdshfg dshfg dsh gdfh gfd h gfd h g dfh g fd hg fhdhgfd hg fdhgf dhg dfh gdfh gsd f areg tghufids h  gudfhsg f gis giorts vfd sg fhz yg jfud s ugfo dhsuo ghfd shbl fdsl hgbfl d ugd shfl dsuh gfioud h gd  gfd hg x bnfgd hgfxngdfjnghfd Something fdshfg dshfg dsh gdfh gfd h gfd h g dfh g fd hg fhdhgfd hg fdhgf dhg dfh gdfh gsd f areg tghufids h  gudfhsg f gis giorts vfd sg fhz yg jfud s ugfo dhsuo ghfd shbl fdsl hgbfl d ugd shfl dsuh gfioud h gd  gfd hg x bnfgd hgfxngdfjnghfd Something fdshfg dshfg dsh gdfh gfd h gfd h g dfh g fd hg fhdhgfd hg fdhgf dhg dfh gdfh gsd f areg tghufids h  gudfhsg f gis giorts vfd sg fhz yg jfud s ugfo dhsuo ghfd shbl fdsl hgbfl d ugd shfl dsuh gfioud h gd  gfd hg x bnfgd hgfxngdfjnghfd</p>
      </div>
      </div>
    </div>
  </div>
  <footer class="footer">
    
  </footer>
</div>
              
            
!

CSS

              
                $nmargin-quote-tablet-view: -10%;
$max-wrapper-width: 1024px;
$min-wrapper-width: 320px;
$dark-grey: #111;
$medium-grey: #777;
$light-grey: #ebeced;
$head-height: 90vh;
$head-width: 100vw;
$gutter: 15px;
$half-gutter: $gutter / 2;
$double-gutter: $gutter * 2;
$top-nav-height-l: 60px;
$nav-width-l: 300px;
html,body{
  padding:0;
  margin:0;
}
.mouse-circle{
  width:50px;
  height:50px;
  border:1px solid black;
  background:black;
  position: fixed;
  z-index:999999;
}
html{  
  font-family: "Helvetica", sans-serif;
  color:$dark-grey;
}
ul{
  list-style-type:none;
  margin:0;
  padding:0;
}

.main-wrapper{
  padding: 40px 0 0 0;
  overflow-x:hidden;
  &--reading:not(&--burger-active):not(&--search-active){
    .top-nav{
      opacity: 0.1;
    }
  }
  &--search-active{
    .page{
      transform: translateX(- $nav-width-l);
    }
    .search{
      transform: translateX(0);
    }
  }
  &--burger-active{
    .page{
      transform: translateX($nav-width-l);
    }
    .main-nav{
      transform: translateX(0);
    }
    .top-nav{
      &__burger{
        &__layer{
          border:none;
          margin-top:1px;
        }
        &__layer:before{
          top:0;
          transform: rotate(45deg);
        }
        &__layer:after{
          top:0;
          transform: rotate(-45deg);
        }
      }
    }
  } 
}

.top-nav{
  transition: opacity 200ms ease-in-out;
  display:flex;
  height: $top-nav-height-l;
  box-shadow: 0px 0px 6px #999;
  background: white;
  position: fixed;
  width: 100%;
  top:0;
  z-index:9999;
  
  &__search{
    margin-left:auto;
    display:flex;
    align-items:center;
    justify-content: center;
    border-left: 1px solid #ebeced;
    height:60px;
    width:60px;
    cursor:pointer;
    cursor:hand;
  }
  
  &__search-icon{
    height:14px;
    width:14px;
    border:1px solid black;
    border-radius: 50%;
    &:before{
      content: " ";
      border-top:1px solid black;
      width:7px;
      position: absolute;
      transform: rotate(45deg);
      margin-top:14px;
      margin-left:11px;

    }
  }
    
  &__burger{
    width:60px;
    height:60px;
    border-right:1px solid #ebeced; 
    
    &__text{
      font-size: 12px;
      text-align: center;
      color: #37454d;
      padding-top:38px;
      user-select: none;
    }

    &__layer{
      width:14px;
      border-top: 1px solid #37454d;
      left:23px;
      top:20px;
      position:absolute;
    }

    &__layer:before{
      content:"";
      width:14px;
      border-top: 1px solid #37454d;
      top:4px;
      position:absolute;
      transition: transform 200ms;
    }

    &__layer:after{
      content:"";
      width:14px;
      border-top: 1px solid #37454d;
      top:-6px;
      position:absolute;
      transition: transform 200ms;
    }
  }
}

.main-nav{
  width: $nav-width-l;
  background: white;
  position: absolute;
  top:$top-nav-height-l;
  border-right: 1px solid #ebeced;
  border-top: 1px solid #ebeced;
  height:calc(100vh - 60px);
  position:fixed;
  z-index:10000;
  box-sizing: border-box;
  transform: translateX(- $nav-width-l );
  transition: transform 200ms ease-in-out;
  box-shadow: 0px 6px 6px #999; /* Adjust */
    &__element{
      padding: $half-gutter $gutter;
      border-bottom:1px solid #ebeced;
      pointer: cursor;
      &__link{
        text-decoration: none;
        color: black;
        display:block;
      }
    } 
}

.search{
  width: $nav-width-l;
  background: white;
  position: absolute;
  top:$top-nav-height-l;
  right:0;
  border-left: 1px solid #ebeced;
  border-top: 1px solid #ebeced;
  height:calc(100vh - 60px);
  position:fixed;
  z-index:10000;
  box-sizing: border-box;
  transform: translateX($nav-width-l);
  transition: transform 200ms ease-in-out;
  
}

.page{
  z-index: 1000;
  position: relative;
  transform: translateX(0);
  transition: transform 200ms ease-in-out;
}

.centerwrapper{
  box-sizing: border-box;
  margin:0 auto;
  padding:0 0;
  &--narrow{
    width: 33%;
    max-width: $max-wrapper-width;
    min-width: $min-wrapper-width;
  }
  &--medium{
    width:50%;
    max-width: $max-wrapper-width;
    min-width: $min-wrapper-width;
  }
  &--wide{
    width:84%;
    max-width: $max-wrapper-width;
    min-width: $min-wrapper-width;
  }
  &--screen{
    width:100vw;
    min-width: $min-wrapper-width;
  }
}

.img{
  &--100p{
    width:100%;
  } 
  &--caption{
    margin-top: -5px;
    background-color:#ebeced;
    font-size: 12px;
    box-shadow: 0px 0px 6px #999;
  }
}

.text{
  &--block{
    font-size:1.2em;
    padding: 15px;
  }
  &--justify{
    text-align:justify;
  }
  &--center{
    text-align:center;
  }
}

.post{
  &--details{
    position: absolute;
    bottom: 0;
    padding: 15px;
  }
}

.quote{
  width:50%;
  font-size:1.3em;
  padding: 20px;
  font-family: "Roboto";
  &--left{
    float:left;
    margin-left:-35%;  
    border-left: 5px solid $light-grey;
  }

  &--right{
    float:right;
    margin-right:-35%;  
    border-right: 5px solid $light-grey;
  }
}

.head{
  width:100%;
  height:auto;
  background-size:cover;
  background-image:none !important;
  z-index:10;
  margin-top:0;
  transform: traslateZ(0);
}

.content{
  width:100%;
  padding: 20px 0;
  position:relative;
  z-index:2;
  background-color:white;
}

.header{
  text-align:center;
  &--one{
    font-size:4.5em;
  }
}

.footer{
  min-height: 60px;
  border-top:1px solid $light-grey;
}



.white{
  color:white;
}

.italic{  
  font-style:italic;
}

.light{
  font-weight:200;
}

.left-padding{
  padding-left: $gutter;
}
.right-padding{
  padding-right: $gutter;
}
.top-padding{
  padding-top: $gutter;
}
.bottom-padding{
  padding-bottom: $gutter;
}

@media screen and (max-width: 1024px){
  .centerwrapper{
    margin:0 auto;
    &--narrow{
      width: 80%;
    }
    &--medium{
      width:80%;
    }
    &--wide{
      width:80%;
    }
  }
  .quote{
    width:50%;
    font-size:1.3em;
    font-family: "Roboto";
    &--left{
      float:left;
      margin-left:$nmargin-quote-tablet-view;  
    }

    &--right{
      float:right;
      margin-right:$nmargin-quote-tablet-view;  
    }
  }
}

@media screen and (max-width: 640px){
  .main-nav{
    width:100%;
    transform: translateX(- 100% );
  }
  .search{
    width:100%;
    transform: translateX( 100% );
  }
  
  .centerwrapper{
    margin:0 auto;
    &--narrow{
      width: 100%;
    }
    &--medium{
      width:100%;
    }
    &--wide{
      width:100%;
    }
  }
  .quote{
    width:100%;
    font-size:1.3em;
    box-sizing:border-box;
    padding: 5px 0 5px 10px;
    border-right: none;
    border-left: 5px solid $light-grey;
    margin: 0;
    &--left{
      float:none;
      margin-left:0;  
    }
    &--right{
      float:none;
      margin-right:0;  
    }
  }
}
              
            
!

JS

              
                ;(function(){
  var oldScroll = 0;
  /* TODO Only show menu when mouse leaves imaginary circle */
  $(window).scroll(function(e) {
    var newScroll = $(this).scrollTop();
    if(oldScroll < newScroll){
      $('.main-wrapper').addClass('main-wrapper--reading');
    } else {
      $('.main-wrapper').removeClass('main-wrapper--reading');
    }
    oldScroll = newScroll;
  });

  $('.main-wrapper').mousemove(function(e){
    if(window.lastX !== e.clientX || window.lastY !== e.clientY){
        $('.main-wrapper').removeClass('main-wrapper--reading');
      }   
      window.lastX = e.clientX;
      window.lastY = e.clientY;
  });

  $('.top-nav__burger').click(function(){
    $('.main-wrapper').removeClass('main-wrapper--search-active');
    $('.main-wrapper').toggleClass('main-wrapper--burger-active');
  });

  $('.top-nav__search').click(function(){
    $('.main-wrapper').removeClass('main-wrapper--burger-active');
    $('.main-wrapper').toggleClass('main-wrapper--search-active');
  });  
})();

              
            
!
999px

Console