123

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div id="page-wrapper">
  <div id="menu-toggle">
    <div id="menu-icon">
      <span></span>
      <span></span>
      <span></span>
      <span></span>
      <span></span>
      <span></span>
    </div>
    Menu
  </div>
  <div id="menu-overlay"></div>
  <ul id="menu">
    <li><a href="http://www.designcouch.com" target="_blank">Visit My Site</a></li>
    <li><a href="#">No children...</a></li>
    <li><a href="#">Hey - this one has some kids!</a>
      <ul>
        <li><a href="#">I'm a kid!</a></li>
        <li><a href="#">I'm a kid!</a></li>
        <li><a href="#">Got kids of my own...</a>
          <ul>
            <li><a href="#">I'm a grandkid!</a></li>
            <li><a href="#">I'm a grandkid!</a></li>
            <li><a href="#">I'm a grandkid!</a></li>
          </ul>
        </li>
      </ul>
    </li>
    <li><a href="#">I've got kids too.</a>
      <ul>
        <li><a href="#">I'm a kid!</a></li>
        <li><a href="#">I'm a kid!</a></li>
        <li><a href="#">I'm a kid!</a></li>
        <li><a href="#">I'm a kid!</a></li>
      </ul>
    </li>
  </ul>
  <div id="page-content">
    <h1>Here's some hip page content.</h1>
  <p>Put a bird on it Blue Bottle ennui direct trade  sustainable, literally vinyl kale chips plaid biodiesel occupy Tumblr Pitchfork.  Actually crucifix VHS, single-origin coffee mumblecore American Apparel vegan small batch chia Tumblr cliche.  Church-key Cosby sweater umami, slow-carb leggings lo-fi 90's.  Craft beer keffiyeh hashtag, deep v meggings four loko twee kitsch mumblecore Vice next level forage Echo Park.  Cray swag gentrify skateboard polaroid whatever Williamsburg, leggings art party.  Bespoke biodiesel you probably haven't heard of them, PBR raw denim normcore Tumblr skateboard fanny pack iPhone cred aesthetic.  Next level viral cliche, forage leggings mumblecore flexitarian synth hashtag mustache literally.</p><p>Godard squid stumptown artisan Vice, flannel ennui ugh biodiesel PBR&amp;B 8-bit.  Trust fund messenger bag banh mi Kickstarter, drinking vinegar iPhone butcher crucifix Thundercats.  Deep v drinking vinegar mlkshk, selvage Brooklyn Pitchfork banjo +1 Carles slow-carb synth mixtape Tonx.  Pop-up you probably haven't heard of them fingerstache blog, crucifix hella whatever Cosby sweater bitters.  PBR&amp;B sustainable gluten-free cornhole banh mi messenger bag 90's crucifix chia, next level Carles.  Meggings artisan messenger bag Brooklyn keytar American Apparel.  Helvetica meh Etsy biodiesel normcore Godard.</p><p>Farm-to-table art party mixtape Schlitz.  Squid Vice single-origin coffee, iPhone semiotics tattooed keytar locavore.  Hoodie asymmetrical Schlitz wayfarers, deep v paleo readymade single-origin coffee fixie dreamcatcher PBR&amp;B.  Wes Anderson small batch fixie, retro sriracha Thundercats narwhal put a bird on it.  Whatever chillwave Carles, semiotics Marfa kogi synth typewriter Wes Anderson biodiesel normcore.  Bushwick Pinterest gentrify narwhal.  Carles artisan flexitarian mlkshk.</p><p>Keytar letterpress artisan pug.  Lo-fi kitsch Marfa, cornhole sriracha fashion axe Echo Park shabby chic iPhone.  Cardigan try-hard seitan Cosby sweater biodiesel kitsch.  Plaid pour-over selfies ethical, kale chips iPhone wolf 3 wolf moon Neutra Bushwick.  Sustainable kale chips four loko fixie American Apparel.  Butcher hella swag before they sold out, ethnic messenger bag pork belly disrupt Brooklyn Portland.  Kickstarter artisan Intelligentsia fashion axe, flexitarian Neutra crucifix art party readymade.</p>
  </div>
</div>
            
          
!
            
              * {
  -webkit-box-sizing:border-box;
  -moz-box-sizing:border-box;
  -ms-box-sizing:border-box;
  -o-box-sizing:border-box;
  box-sizing:border-box;
  font-family:Helvetica,Arial,sans-serif;
  font-size:15px;
  line-height:15px;
  -webkit-transition: .5s ease-in-out;
  -moz-transition: .5s ease-in-out;
  -o-transition: .5s ease-in-out;
  transition: .5s ease-in-out;
  padding:0;
  margin:0;
}

body {
  background-color:#f8f8f8;
  padding:55px 0 0 0;
  overflow-x:hidden;
  overflow-y:scroll;
}

#page-wrapper {
  width:calc(100% + 400px);
  padding-left:400px;
  position:relative;
  left:-400px;
}

#page-wrapper.open {
  left:0;
}

/* MENU TOGGLE STYLES */

#menu-toggle {
  position:fixed;
  padding:20px 20px 20px 65px;
  width:100%;
  left:0;
  top:0;
  background:rgba(255,255,255,.9);
  color:#444444;
  z-index:5;
}

.open #menu-toggle {
  left:400px;
}

#menu-icon {
  width: 45px;
  height: 35px;
  position: absolute;
  left:10px;
  top:10px;
  -webkit-transform: rotate(0deg);
  -moz-transform: rotate(0deg);
  -o-transform: rotate(0deg);
  transform: rotate(0deg);
  -webkit-transition: .5s ease-in-out;
  -moz-transition: .5s ease-in-out;
  -o-transition: .5s ease-in-out;
  transition: .5s ease-in-out;
  cursor: pointer;
}

#menu-icon span {
  display: block;
  position: absolute;
  height: 5px;
  width: 50%;
  background: #00aeef;
  opacity: 1;
  -webkit-transform: rotate(0deg);
  -moz-transform: rotate(0deg);
  -o-transform: rotate(0deg);
  transform: rotate(0deg);
  -webkit-transition: .25s ease-in-out;
  -moz-transition: .25s ease-in-out;
  -o-transition: .25s ease-in-out;
  transition: .25s ease-in-out;
}

#menu-icon span:nth-child(even) {
  left: 50%;
}

#menu-icon span:nth-child(odd) {
  left:0px;
}

#menu-icon span:nth-child(1), #menu-icon span:nth-child(2) {
  top: 5px;
}

#menu-icon span:nth-child(3), #menu-icon span:nth-child(4) {
  top: 15px;
}

#menu-icon span:nth-child(5), #menu-icon span:nth-child(6) {
  top: 25px;
}

.open #menu-icon span:nth-child(1),.open #menu-icon span:nth-child(6) {
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  transform: rotate(45deg);
}

.open #menu-icon span:nth-child(2),.open #menu-icon span:nth-child(5) {
  -webkit-transform: rotate(-45deg);
  -moz-transform: rotate(-45deg);
  -o-transform: rotate(-45deg);
  transform: rotate(-45deg);
}

.open #menu-icon span:nth-child(1) {
  left: 5px;
  top: 8px;
}

.open #menu-icon span:nth-child(2) {
  left: calc(50% - 5px);
  top: 8px;
}

.open #menu-icon span:nth-child(3) {
  left: -50%;
  opacity: 0;
}

.open #menu-icon span:nth-child(4) {
  left: 100%;
  opacity: 0;
}

.open #menu-icon span:nth-child(5) {
  left: 5px;
  top: 21px;
}

.open #menu-icon span:nth-child(6) {
  left: calc(50% - 5px);
  top: 21px;
}

/* MENU STYLES */
ul#menu, #menu ul {
  list-style-type:none;
  padding:0;
  margin:0;
}

#menu {
  width:400px;
  max-width:calc(100% - 40px);
  background:#333333;
  position:fixed;
  left:-400px;
  bottom:0;
  top:0px;
  overflow:hidden;
}

#menu a {
  text-decoration:none;
  color:#999999;
  display:block;
  padding:20px;
  font-size:16px;
  line-height:16px;
}

.open #menu {
  left:0px;
}

#menu ul {
  position:absolute;
  top:0;
  bottom:0;
  right:-100%;
}

#menu ul.submenu-open {
  right:0%;
}

#menu ul.on {
  background:red;
}

#menu > li > ul {
  width:calc(100% - 45px);
  background:#444444;
  z-index:1;
}

#menu > li > ul > li > ul {
  width:calc(100% - 45px);
  background:#555555;
  z-index:5000;
}

#menu-overlay {
  position:fixed;
  width:100%;
  top:55px;
  bottom:0;
  left:0;
  z-index:0;
  background:rgba(255,255,255,.0);
}

.open #menu-overlay {
  z-index:3;
  left:400px;
  background:rgba(255,255,255,.9);
}

.submenu-toggle {
  position:absolute;
  padding:28px;
  right:0;
  background:rgba(0,0,0,.0);
  z-index:1;
  overflow:hidden;
}

.submenu-arrow {
  position:absolute;
  padding:28px;
  right:0;
  z-index:0;
}

.submenu-arrow:before {
  content:'';
  display:block;
  position:absolute;
  height:16px;
  width:16px;
  top:15px;
  right:19px;
  border-top:5px solid #929292;
  border-right:5px solid #929292;
  -webkit-transform:rotate(45deg);
}

.submenu-toggle.on {
  width:100%;
  height:auto;
  top:0;
  bottom:0;
  left:0;
  background:rgba(0,0,0,.6);
}

.submenu-toggle:before {
  content:'\2715';
  display:block;
  position:absolute;
  left:7px;
  top:-90px;
  height:31px;
  width:30px;
  border-radius:100%;
  line-height:31px;
  font-size:18px;
  color:#00aeef;
  text-align:center;
  cursor:pointer;
  -webkit-transition: .5s ease-in-out;
  -moz-transition: .5s ease-in-out;
  -o-transition: .5s ease-in-out;
  transition: .5s ease-in-out;
}

.submenu-toggle.on:before {
  top:7px;
}

/* CONTENT AREA STYLES */

#page-content {
  padding:20px;
  max-width:960px;
  margin:0 auto;
  position:relative;
  left:0;
  z-index:1;
}

#page-content.open {
  left:400px;
}

#page-content h1 {
  font-size:30px;
  font-weight:100;
  padding-bottom:20px;
  padding:50px 0;
}

#page-content p {
  font-size:14px;
  line-height:22px;
  padding-bottom:20px;
}
            
          
!
            
              $(document).ready(function(){
  $('#menu-icon').click(function(){
    $('#page-wrapper').toggleClass('open');
  });
  $('#menu-overlay').click(function(){
    $('#page-wrapper').removeClass('open');
  })
  $('#menu li').has('ul').addClass('parent').prepend('<div class="submenu-toggle"></div>','<div class="submenu-arrow"></div>');
  $('.submenu-toggle').click(function(){
    $(this).toggleClass('on');
    $(this).siblings('ul').toggleClass('submenu-open');
    $(this).siblings('ul').children('li').children('.submenu-toggle').removeClass('on');
    $(this).siblings('ul').children('li').children('ul').removeClass('submenu-open');
  });
  
});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console