<div class="text">Simple jQuery Slide Nav</div>
<div class="menu-tab">
<div id="one"></div>
<div id="two"></div>
<div id="three"></div>
</div>
<div class="menu-hide">
<nav>
<ul>
<li><a href="#">Link One</a></li>
<li><a href="#">Link Two</a></li>
<li><a href="#">Link Three</a></li>
<li><a href="#">Link Four</a></li>
</ul>
</nav>
</div>
$black: #2d2d2d;
$white: #f1f1f1;
$red: #e74c3c;
$green: #2ecc71;
*{
box-sizing: border-box;
}
body{
background-color: coral;
font-family: "Open Sans", sans-serif;
}
.text{
width: 100%;
text-align: center;
margin-top: 10%;
font-size: 3em;
color: $white;
font-weight: 800;
}
.menu-tab{
width: 90px;
height: 70px;
position: fixed;
z-index: 100;
top: 0px;
left: 0px;
cursor: pointer;
transition: all .6s ease-in-out;
div{
width: 33px;
height: 4px;
background-color: $black;
display: block;
margin: 5px 28px;
transition: all .6s ease-in-out;
&:nth-child(1){
margin-top: 20px;
}
}/*end of div*/
}/*end of menu-tab*/
.menu-tab.active{
left: 345px;
transition: all 600ms ease-in-out;
background-color: rgba(255,255,255,0.2);
#one{
transform: translateY(9px) rotate(-135deg);
transition: all .6s ease-in-out;
background-color: $red;
}
#two{
opacity: 0;
transition: .4s ease;
}
#three{
transform: translateY(-9px) rotate(-45deg);
transition: all .6s ease-in-out;
background-color: $red;
}
}
.menu-hide{
width: 345px;
left: -345px;
height: 100vh;
position: fixed;
z-index: 10;
top: 0px;
transition: all .6s ease-in-out;
nav{
ul{
li{
height: 70px;
list-style-type: none;
text-align: center;
line-height: 70px;
transition: all .5s ease;
&:hover{
background-color: $red;
transition: all .5s ease;
}
a{
padding: 30px 25px;
text-decoration: none;
color: $white;
font-weight: 800;
}
}/*end of li*/
}/*end of ul*/
}/*end of nav*/
}/*end of menu-hide*/
.menu-hide.show{
left: 0px;
background-color: rgba(255,255,255,0.2);
transition: all .6s ease-in-out;
}
View Compiled
$(document).ready(function(){
$('.menu-tab').click(function(){
$('.menu-hide').toggleClass('show');
$('.menu-tab').toggleClass('active');
});
$('a').click(function(){
$('.menu-hide').removeClass('show');
$('.menu-tab').removeClass('active');
});
});
This Pen doesn't use any external CSS resources.