Weking Demo - Menu

In this example below you will see how to do a Weking Demo - Menu 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 - Menu</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 id="menus" class="main">
  <h2 class="typo_h2">Menu with all features: responsive, heading, dropdown</h2>

  <!-- MENU -->
  <h3 class="typo_h3">Default</h3>
  <nav class="menu">
    <div class="menu_header">
      <a href="#" class="menu_a menu_brand">Brand</a>
      <label class="btn menu_burger" for="menu_trigger1">Show menu</label>
    </div>

    <input type="checkbox" id="menu_trigger1" class="menu_trigger">

    <ul class="menu_ul">
      <li class="menu_li menu_active"><a class="menu_a" href="#">Home</a></li>
      <li class="menu_li menu_parent">
        <a class="menu_a">Services</a>
        <ul class="menu_ul-dropdown">
          <li class="menu_li"><a class="menu_a" href="#">Service 1</a></li>
          <li class="menu_li menu_parent">
            <a class="menu_a">Service 2</a>
            <ul class="menu_ul-dropdown">
              <li class="menu_li"><a class="menu_a" href="#">Service 2.1</a></li>
              <li class="menu_li"><a class="menu_a" href="#">Service 2.2</a></li>
              <li class="menu_li"><a class="menu_a" href="#">Service 2.3</a></li>
            </ul>
          </li>
          <li class="menu_li"><a class="menu_a" href="#">Service 3</a></li>
        </ul>
      </li>
      <li class="menu_li"><a class="menu_a" href="#">Blog</a></li>
      <li class="menu_li"><a class="menu_a" href="#">About Us</a></li>
      <li class="menu_li"><a class="menu_a" href="#">Contact Us</a></li>
    </ul>
  </nav>

  &nbsp;
  
  <h3 class="typo_h3">Primary</h3>
  <nav class="menu menu-primary">
    <div class="menu_header">
      <a href="#" class="menu_a menu_brand">Brand</a>
      <label class="btn btn--primary menu_burger" for="menu_trigger-2">Show menu</label>
    </div>

    <input type="checkbox" id="menu_trigger-2" class="menu_trigger">

    <ul class="menu_ul">
      <li class="menu_li menu_active"><a class="menu_a" href="#">Home</a></li>
      <li class="menu_li menu_parent">
        <a class="menu_a">Services</a>
        <ul class="menu_ul-dropdown">
          <li class="menu_li"><a class="menu_a" href="#">Service 1</a></li>
          <li class="menu_li menu_parent">
            <a class="menu_a">Service 2</a>
            <ul class="menu_ul-dropdown">
              <li class="menu_li"><a class="menu_a" href="#">Service 2.1</a></li>
              <li class="menu_li"><a class="menu_a" href="#">Service 2.2</a></li>
              <li class="menu_li"><a class="menu_a" href="#">Service 2.3</a></li>
            </ul>
          </li>
          <li class="menu_li"><a class="menu_a" href="#">Service 3</a></li>
        </ul>
      </li>
      <li class="menu_li"><a class="menu_a" href="#">Blog</a></li>
      <li class="menu_li"><a class="menu_a" href="#">About Us</a></li>
      <li class="menu_li"><a class="menu_a" href="#">Contact Us</a></li>
    </ul>
  </nav>

  &nbsp;

  <h3 class="typo_h3">Secondary</h3>
  <nav class="menu menu-secondary">
    <div class="menu_header">
      <a href="#" class="menu_a menu_brand">Brand</a>
      <label class="btn btn--secondary menu_burger" for="menu_trigger-3">Show menu</label>
    </div>

    <input type="checkbox" id="menu_trigger-3" class="menu_trigger">

    <ul class="menu_ul">
      <li class="menu_li menu_active"><a class="menu_a" href="#">Home</a></li>
      <li class="menu_li menu_parent">
        <a class="menu_a">Services</a>
        <ul class="menu_ul-dropdown">
          <li class="menu_li"><a class="menu_a" href="#">Service 1</a></li>
          <li class="menu_li menu_parent">
            <a class="menu_a">Service 2</a>
            <ul class="menu_ul-dropdown">
              <li class="menu_li"><a class="menu_a" href="#">Service 2.1</a></li>
              <li class="menu_li"><a class="menu_a" href="#">Service 2.2</a></li>
              <li class="menu_li"><a class="menu_a" href="#">Service 2.3</a></li>
            </ul>
          </li>
          <li class="menu_li"><a class="menu_a" href="#">Service 3</a></li>
        </ul>
      </li>
      <li class="menu_li"><a class="menu_a" href="#">Blog</a></li>
      <li class="menu_li"><a class="menu_a" href="#">About Us</a></li>
      <li class="menu_li"><a class="menu_a" href="#">Contact Us</a></li>
    </ul>
  </nav>

  &nbsp;
  
  <h3 class="typo_h3">Black</h3>
  <nav class="menu menu-black">
    <div class="menu_header">
      <a href="#" class="menu_a menu_brand">Brand</a>
      <label class="btn btn--black menu_burger" for="menu_trigger-4">Show menu</label>
    </div>

    <input type="checkbox" id="menu_trigger-4" class="menu_trigger">

    <ul class="menu_ul">
      <li class="menu_li menu_active"><a class="menu_a" href="#">Home</a></li>
      <li class="menu_li menu_parent">
        <a class="menu_a">Services</a>
        <ul class="menu_ul-dropdown">
          <li class="menu_li"><a class="menu_a" href="#">Service 1</a></li>
          <li class="menu_li menu_parent">
            <a class="menu_a">Service 2</a>
            <ul class="menu_ul-dropdown">
              <li class="menu_li"><a class="menu_a" href="#">Service 2.1</a></li>
              <li class="menu_li"><a class="menu_a" href="#">Service 2.2</a></li>
              <li class="menu_li"><a class="menu_a" href="#">Service 2.3</a></li>
            </ul>
          </li>
          <li class="menu_li"><a class="menu_a" href="#">Service 3</a></li>
        </ul>
      </li>
      <li class="menu_li"><a class="menu_a" href="#">Blog</a></li>
      <li class="menu_li"><a class="menu_a" href="#">About Us</a></li>
      <li class="menu_li"><a class="menu_a" href="#">Contact Us</a></li>
    </ul>
  </nav>

  &nbsp;
  
  <h3 class="typo_h3">Flat</h3>
  <nav class="menu menu-primary-flat">
    <div class="menu_header">
      <a href="#" class="menu_a menu_brand">Brand</a>
      <label class="btn btn-primary-flat menu_burger" for="menu_trigger-6">Show menu</label>
    </div>

    <input type="checkbox" id="menu_trigger-6" class="menu_trigger">

    <ul class="menu_ul">
      <li class="menu_li menu_active"><a class="menu_a" href="#">Home</a></li>
      <li class="menu_li menu_parent">
        <a class="menu_a">Services</a>
        <ul class="menu_ul-dropdown">
          <li class="menu_li"><a class="menu_a" href="#">Service 1</a></li>
          <li class="menu_li menu_parent">
            <a class="menu_a">Service 2</a>
            <ul class="menu_ul-dropdown">
              <li class="menu_li"><a class="menu_a" href="#">Service 2.1</a></li>
              <li class="menu_li"><a class="menu_a" href="#">Service 2.2</a></li>
              <li class="menu_li"><a class="menu_a" href="#">Service 2.3</a></li>
            </ul>
          </li>
          <li class="menu_li"><a class="menu_a" href="#">Service 3</a></li>
        </ul>
      </li>
      <li class="menu_li"><a class="menu_a" href="#">Blog</a></li>
      <li class="menu_li"><a class="menu_a" href="#">About Us</a></li>
      <li class="menu_li"><a class="menu_a" href="#">Contact Us</a></li>
    </ul>
  </nav>
  &nbsp;
  <h3 class="typo_h3">Vertical</h3>
  <nav class="menu menu-primary-vert col col-md3">
    <div class="menu_header">
      <label class="menu_a menu_brand" for="menu_trigger-7"><i class="icon icon__menu"></i> Brand</label>
    </div>

    <input type="checkbox" id="menu_trigger-7" class="menu_trigger">

    <ul class="menu_ul">
      <li class="menu_li menu_active"><a class="menu_a" href="#">Home</a></li>
      <li class="menu_li menu_parent">
        <a class="menu_a">Services</a>
        <ul class="menu_ul-dropdown">
          <li class="menu_li"><a class="menu_a" href="#">Service 1</a></li>
          <li class="menu_li menu_parent">
            <a class="menu_a">Service 2</a>
            <ul class="menu_ul-dropdown">
              <li class="menu_li"><a class="menu_a" href="#">Service 2.1</a></li>
              <li class="menu_li"><a class="menu_a" href="#">Service 2.2</a></li>
              <li class="menu_li"><a class="menu_a" href="#">Service 2.3</a></li>
            </ul>
          </li>
          <li class="menu_li"><a class="menu_a" href="#">Service 3</a></li>
        </ul>
      </li>
      <li class="menu_li"><a class="menu_a" href="#">Blog</a></li>
      <li class="menu_li"><a class="menu_a" href="#">About Us</a></li>
      <li class="menu_li"><a class="menu_a" href="#">Contact Us</a></li>
    </ul>
  </nav>
  
  <nav class="menu menu-primary-fixedTop">
    <div class="menu_header">
      <a href="#" class="menu_a menu_brand">Fixed Top</a>
      <label class="btn btn-primary menu_burger" for="menu_trigger-5">Show menu</label>
    </div>

    <input type="checkbox" id="menu_trigger-5" class="menu_trigger">

    <ul class="menu_ul">
      <li class="menu_li menu_active"><a class="menu_a" href="#">Home</a></li>
      <li class="menu_li menu_parent">
        <a class="menu_a">Services</a>
        <ul class="menu_ul-dropdown">
          <li class="menu_li"><a class="menu_a" href="#">Service 1</a></li>
          <li class="menu_li menu_parent">
            <a class="menu_a">Service 2</a>
            <ul class="menu_ul-dropdown">
              <li class="menu_li"><a class="menu_a" href="#">Service 2.1</a></li>
              <li class="menu_li"><a class="menu_a" href="#">Service 2.2</a></li>
              <li class="menu_li"><a class="menu_a" href="#">Service 2.3</a></li>
            </ul>
          </li>
          <li class="menu_li"><a class="menu_a" href="#">Service 3</a></li>
        </ul>
      </li>
      <li class="menu_li"><a class="menu_a" href="#">Blog</a></li>
      <li class="menu_li"><a class="menu_a" href="#">About Us</a></li>
      <li class="menu_li"><a class="menu_a" href="#">Contact Us</a></li>
    </ul>
  </nav>
  
  <nav class="menu menu-secondary-fixedBottom">
    <div class="menu_header">
      <a href="#" class="menu_a menu_brand">Fixed Bottom</a>
      <label class="btn btn-secondary menu_burger" for="menu_trigger-8">Show menu</label>
    </div>

    <input type="checkbox" id="menu_trigger-8" class="menu_trigger">

    <ul class="menu_ul">
      <li class="menu_li menu_active"><a class="menu_a" href="#">Home</a></li>
      <li class="menu_li menu_parent">
        <a class="menu_a">Services</a>
        <ul class="menu_ul-dropdown">
          <li class="menu_li"><a class="menu_a" href="#">Service 1</a></li>
          <li class="menu_li menu_parent">
            <a class="menu_a">Service 2</a>
            <ul class="menu_ul-dropdown">
              <li class="menu_li"><a class="menu_a" href="#">Service 2.1</a></li>
              <li class="menu_li"><a class="menu_a" href="#">Service 2.2</a></li>
              <li class="menu_li"><a class="menu_a" href="#">Service 2.3</a></li>
            </ul>
          </li>
          <li class="menu_li"><a class="menu_a" href="#">Service 3</a></li>
        </ul>
      </li>
      <li class="menu_li"><a class="menu_a" href="#">Blog</a></li>
      <li class="menu_li"><a class="menu_a" href="#">About Us</a></li>
      <li class="menu_li"><a class="menu_a" href="#">Contact Us</a></li>
    </ul>
  </nav>
</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-menu-YPBQNL */
.main {
  padding: 72px 24px;
}
.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-menu-YPBQNL */
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