! function(e) {
var t = {};
function n(o) {
if (t[o]) return t[o].exports;
var r = t[o] = {
i: o,
l: !1,
exports: {}
};
return e[o].call(r.exports, r, r.exports, n), r.l = !0, r.exports
}
n.m = e, n.c = t, n.d = function(e, t, o) {
n.o(e, t) || Object.defineProperty(e, t, {
enumerable: !0,
get: o
})
}, n.r = function(e) {
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
value: "Module"
}), Object.defineProperty(e, "__esModule", {
value: !0
})
}, n.t = function(e, t) {
if (1 & t && (e = n(e)), 8 & t) return e;
if (4 & t && "object" == typeof e && e && e.__esModule) return e;
var o = Object.create(null);
if (n.r(o), Object.defineProperty(o, "default", {
enumerable: !0,
value: e
}), 2 & t && "string" != typeof e)
for (var r in e) n.d(o, r, function(t) {
return e[t]
}.bind(null, r));
return o
}, n.n = function(e) {
var t = e && e.__esModule ? function() {
return e.default
} : function() {
return e
};
return n.d(t, "a", t), t
}, n.o = function(e, t) {
return Object.prototype.hasOwnProperty.call(e, t)
}, n.p = "", n(n.s = 0)
}([function(e, t, n) {
"use strict";
n.r(t);
var o;
n(1);
window.addEventListener("resize", (function() {
document.body.classList.add("resize-animation-stopper"), clearTimeout(o), o = setTimeout((function() {
document.body.classList.remove("resize-animation-stopper")
}), 400)
}));
var r = document.querySelector(".nav-toggle"),
i = document.querySelector(".menu-toggle");
r.addEventListener("click", (function(e) {
this.classList.toggle("open"), i.classList.toggle("active"), e.stopPropagation()
})), document.querySelector(".dropdown a").addEventListener("click", (function(e) {
this.nextElementSibling.classList.toggle("show"), this.parentNode.classList.toggle("active"), e.stopPropagation()
})), document.querySelector(".second-level a").addEventListener("click", (function(e) {
this.nextElementSibling.classList.toggle("show"), this.parentNode.classList.toggle("active"), e.stopPropagation()
}))
}, function(e, t, n) {}]);
* {
margin: 0;
padding: 0;
}
html {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
*,
:after,
:before {
-webkit-box-sizing: inherit;
box-sizing: inherit;
}
body {
width: 100%;
background-color: #eee;
color: #222;
}
header {
padding: 0;
margin: 0;
}
.nav__container, header {
width: 100%;
background-color: #fafafa;
}
.nav__container {
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
-webkit-box-align: stretch;
-ms-flex-align: stretch;
align-items: stretch;
padding: 0 1px;
}
.nav__mobile .nav__btn {
display: block;
margin: 4px 6px 4px 0;
}
.nav__mobile {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
background: #0a499014;
}
.nav__logo {
font-size: 15px;
font-weight: 700;
color: #555;
z-index: 99;
width: 76%;
background: #e6ebf1;
}
.nav__menu {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
overflow: hidden;
border-top: 1px solid #fff;
}
.showing {
max-height: 37rem;
-webkit-transition: all 0.5s;
transition: all 0.5s;
}
.nav__menu li {
list-style: none;
position: relative;
white-space: nowrap;
padding: 1rem 0 0;
}
.nav__menu li a {
display: block;
font-size: 18px;
padding-left: 26px;
color: #fff;
text-decoration: none;
}
.nav__menu .dropdown ul a {
margin-left: 10px;
}
.nav__menu .dropdown .second-level ul {
margin-left: 15px;
}
.nav-toggle {
display: block;
background-color: #1abc9b;
width: 52px;
height: 51px;
cursor: pointer;
padding: 11px 6px;
border-radius: 3px;
}
.nav-toggle span {
position: relative;
display: block;
height: 6px;
border-radius: 17px;
width: 100%;
margin-top: 0;
background-color: #fff;
-webkit-transition: all 0.25s;
transition: all 0.25s;
}
.nav-toggle span.mrg {
margin-top: 5px;
}
.nav-toggle.open span:first-child {
-webkit-transform: rotate(45deg) translate(7.2px, 7.2px);
transform: rotate(45deg) translate(7.2px, 7.2px);
}
.nav-toggle.open span:nth-child(2) {
width: 0;
opacity: 0;
}
.nav-toggle.open span:last-child {
-webkit-transform: rotate(-45deg) translate(7.2px, -7.2px);
transform: rotate(-45deg) translate(7.2px, -7.2px);
}
.nav__menu .dropdown ul {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
position: static;
padding: 0;
max-height: 0;
overflow: hidden;
-webkit-transition: all 0.4s;
transition: all 0.4s;
}
.nav__menu .dropdown ul.show {
max-height: 20rem;
-webkit-transition: all 0.4s;
transition: all 0.4s;
}
.nav__menu .dropdown li a {
display: block;
font-size: 0.875rem;
text-transform: capitalize;
color: #fff;
}
.nav__menu li a:hover {
color: #0062a3;
}
.nav__menu .dropdown ul a:before {
content: "\0272A";
padding-right: 4px;
font-size: 15px;
}
.nav__menu .dropdown > a:after {
content: "\276F";
font-weight: 900;
font-size: 0.875rem;
padding-left: 5px;
color: #1abc9b;
}
.nav__menu .active.dropdown > a:after {
content: "\02C5";
}
.nav__menu .dropdown .dropdown > a:after {
content: "\276F";
font-weight: 900;
font-size: 0.875rem;
padding-left: 5px;
color: #1abc9b;
}
.nav__menu .dropdown .active.dropdown > a:after {
content: "\02C5";
}
.menu-toggle {
max-height: 0;
overflow: scroll;
position: fixed;
width: 80%;
z-index: 15;
height: 100%;
top: 0;
left: 0;
background-color: #883442;
transform: translateX(-100%);
}
nav.menu-toggle.active {
transform: translateX(0);
}
.menu-toggle,
.menu-toggle.active {
transition: transform 0.2s ease-in-out;
}
.menu-toggle.active {
max-height: 100vh;
padding: 50px 0 0 0;
}
.resize-animation-stopper * {
transition: none !important;
-webkit-transition: none !important;
animation: none !important;
-webkit-animation: none !important;
}
<header>
<div class="nav__container">
<div class="nav__mobile">
<div class="nav__logo">
<a href="#"><img src="https://www.examsbook.com/img/home/examsbook_logo.png" alt="Exam"></a>
</div>
<div class="nav__btn">
<a aria-label="Mobile menu" class="nav-toggle fade"><span></span><span class="mrg"></span><span class="mrg"></span></a>
</div>
</div>
<nav class="menu-toggle">
<ul class="nav__menu">
<li><a href="">Menu item 1</a></li>
<li><a href="">Menu item 2 </a></li>
<li><a href="">Menu item 3 </a></li>
<li class="dropdown"><a href="#">Dropdown</a>
<ul>
<li><a href="">Dropdown item 1</a></li>
<li><a href="">Dropdown item 2</a></li>
<li><a href="">Dropdown item 3</a></li>
<li class="dropdown second-level"><a href="#">2nd level dropdown</a>
<ul>
<li><a href="">Dropdown item 1</a></li>
<li><a href="">Dropdown item 2</a></li>
<li><a href="">Dropdown item 3</a></li>
</ul>
</li>
<li><a href="">Dropdown item 3</a></li>
<li><a href="">Dropdown item 4</a></li>
</ul>
</li>
<li><a href="">Menu item</a></li>
<li><a href="">Menu item</a></li>
<li><a href="">Menu item</a></li>
</ul>
</nav>
</div>
</header>