Weking Demo - Navigation Drawer

In this example below you will see how to do a Weking Demo - Navigation Drawer with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by hustlahusky, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright hustlahusky ©
  • HTML
  • CSS
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>Weking Demo - Navigation Drawer</title>
  
  
  <link rel='stylesheet prefetch' href='https://rawgit.com/weking/weking-frontend/master/dist/css/weking.min.css'>
<link rel='stylesheet prefetch' href='https://rawgit.com/weking/weking-frontend/master/dist/css/weking-theme.min.css'>

      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <div class="main">
<nav class="navbar menu">
    <div class="menu_header">
      <label class="menu_a menu_brand" for="navbarTrigger">
        <i class="icon icon_menu"></i> Show offcanvas
      </label>
    </div>
  </nav>

  <input type="checkbox" id="navbarTrigger" class="navDrawer_trigger">
  <section class="navDrawer">
    <label for="navbarTrigger" class="navDrawer_overlay"></label>

    <section class="navDrawer_content menu col col-xs8-sm6-md4-lg2-vert">
      <input checked class="menu_trigger" type="checkbox">
      <ul class="menu_ul">
        <li class="menu_li"><a class="menu_a" href="#">Offcanvas Link #1</a></li>
        <li class="menu_li"><a class="menu_a" href="#">Offcanvas Link #2</a></li>
        <li class="menu_li"><a class="menu_a" href="#">Offcanvas Link #3</a></li>
        <li class="menu_li"><a class="menu_a" href="#">Offcanvas Link #4</a></li>
      </ul>
    </section>
  </section>
</div>

<div class="fab">
  <span class="tooltip tooltip-left" data-tooltip="Show grid">
    <a class="fab_btn btn btn-default-radius">
      <i class="icon icon_grid-on"></i>
    </a>
  </span>
</div>
  
  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/hustlahusky/weking-demo-navigation-drawer-zxeWQP */
.main {
  min-height: 100vh;
}
.paint {
  background: #E0E0E0;
  outline: 1px solid #BDBDBD;
}
.paint:hover {
  background-color: #EEEEEE;
}
.fab {
  padding-right: 16px;
  padding-bottom: 60px;
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: 10000;
}
@media (min-width: 768px) {
  .fab {
    padding-right: 24px;
  }
}
.fab_btn {
  width: 56px;
  height: 56px;
  padding: 14px;
}
.fab .icon {
  position: relative;
  width: 24px;
  height: 24px;
}
.fab .icon:before {
  position: absolute;
  top: 0;
  left: 0;
  line-height: 24px;
}
body[class*=-showGrid]:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background-image: -moz-linear-gradient(bottom, rgba(240, 162, 196, 0.5) 5%, rgba(240, 162, 196, 0) 5%);
  background-image: -webkit-linear-gradient(bottom, rgba(240, 162, 196, 0.5) 5%, rgba(240, 162, 196, 0) 5%);
  background-image: linear-gradient(to top, rgba(240, 162, 196, 0.5) 5%, rgba(240, 162, 196, 0) 5%);
  -moz-background-size: 100% 24px;
  -o-background-size: 100% 24px;
  -webkit-background-size: 100% 24px;
  background-size: 100% 24px;
  background-position: left top;
}


/*Downloaded from https://www.codeseek.co/hustlahusky/weking-demo-navigation-drawer-zxeWQP */
var fab = document.querySelector('.fab_btn'),
    fab_icon = document.querySelector('.fab_btn .icon'),
    body = document.getElementsByTagName('body')[0];

fab.addEventListener('click', function () {
  if (body.className == '' && fab_icon.className == 'icon icon_grid-on') {
    body.className += '-showGrid';
    fab_icon.className = fab_icon.className.replace(/-on/gi, '-off');
  } else {
    body.className = body.className.replace('-showGrid', '');
    fab_icon.className = fab_icon.className.replace(/-off/gi, '-on');
  }
})

Comments