css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

            
              <ul id="contenu_mobile">
    <li><a href="#">Qui est Robert ?</a></li>
    <li><a href="#">Qui est Patrick ?</a></li>
    <li><a href="#">Patrick, encore lui</a></li>
    <li><a href="#">Patrick ne meurt jamais</a></li>
  </ul>

  <div id="icone_hamburger"></div>

  <div id="contenu_site">
    <h1>Un peu de latin ?</h1>
    <div>
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla viverra ultrices varius. Cras nulla tellus, iaculis et lorem id, vulputate fermentum nisl. Duis mollis, augue quis blandit facilisis, mauris dui fringilla ante, ut maximus mi metus vitae magna. Nam porttitor, dolor id tristique efficitur, leo lacus sodales arcu, a rhoncus lacus ante sed tellus. Etiam velit enim, viverra quis mi id, viverra porta magna. Maecenas erat arcu, iaculis nec velit vel, porttitor consectetur quam. Donec suscipit vitae erat ut iaculis. Integer euismod nisl neque, at accumsan odio vulputate eget. Proin elementum, enim vitae lobortis pharetra, ipsum mi malesuada ex, id venenatis elit erat eu tortor. Donec quis ipsum velit. Pellentesque venenatis venenatis interdum.
    </div>
    <div>
      Sed sed orci ut urna tincidunt accumsan. Aliquam posuere congue velit sed laoreet. Sed eget commodo lectus. Phasellus consectetur volutpat augue ac vestibulum. Vivamus dapibus at dolor quis gravida. Phasellus eget pharetra ligula, ut scelerisque purus. Etiam interdum, odio laoreet pellentesque euismod, ipsum odio ullamcorper lorem, sollicitudin consequat quam nulla eu felis. Integer non dictum purus. Quisque commodo quam vulputate nisi tristique dignissim. Nulla at massa in nibh venenatis facilisis. Nullam vehicula cursus orci in consequat. Duis porta nulla ac neque egestas lacinia.
    </div>
    <div>
      Integer dapibus sapien lorem, nec gravida purus aliquam sed. Duis vel nulla euismod, ultricies urna in, eleifend odio. Mauris viverra lorem id elit sodales, sit amet scelerisque orci scelerisque. Donec at euismod quam. Nullam luctus ligula sed leo consectetur blandit. Curabitur purus augue, laoreet eu tristique ac, tincidunt eget velit. Nulla ut dui sit amet dui bibendum consectetur. Vivamus pulvinar viverra vehicula. Aliquam dignissim nulla nunc, quis pellentesque lacus condimentum et. Integer vel convallis libero. Sed nec tortor sed tellus porta luctus. Pellentesque volutpat placerat egestas.
    </div>
  </div>
            
          
!
            
              *,*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;}
    
html, body { height: 100%; width: 100%; font-family: Helvetica, Arial, sans-serif; }

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

div {
  margin-bottom: 10px;
}

#contenu_mobile {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  list-style: none;
  background: #006579;
}

#contenu_mobile li {
  width: 200px;
  border-top: 1px solid #006579;
  border-bottom: 1px solid #006579;
}

#contenu_mobile li a {
  display: block;
  padding: 1em;
  color: white;
  font-size: 1.2em;
  text-decoration: none;
  cursor: pointer;
}

#contenu_site {
  min-height: 100%;
  min-width: 100%;
  background-color: white;
  position: relative;
  top: 0;
  bottom: 100%;
  left: 0;
  z-index: 1;
  padding: 5em;
  color: #000;
}

#icone_hamburger {
  position: fixed;
  left: 20px; top: 20px;
  z-index: 2;
  width: 40px;
  height: 30px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' x='0px' y='0px' width='30px' height='30px' viewBox='0 0 30 30' enable-background='new 0 0 30 30' xml:space='preserve'><rect width='30' height='6'/><rect y='24' width='30' height='6'/><rect y='12' width='30' height='6'/></svg>");
  background-size: contain;
}

#contenu_site, #icone_hamburger {
  transition: left 0.2s;
}

#contenu_site.open {
  left: 200px;
  box-shadow: 0 0 5px 5px rgba(2, 87, 104, 1);
}

#icone_hamburger.open {
  left: 215px;
}

h1 {
  margin-bottom: 20px;
}
            
          
!
            
              $(function() {
  $("#icone_hamburger").click(function() {
    console.log("test");
    $("#contenu_site").toggleClass('open');
    $("#icone_hamburger").toggleClass('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.
Loading ..................

Console