<input type="checkbox" id="toggle"/>
<label for="toggle" class="fa fa-bars"></label>
<nav>
<menu>
<li><a href="#">home</a></li>
<li><a href="#">about</a></li>
<li><a href="#">places</a></li>
<li><a href="#">apps</a></li>
<li><a href="#">contact</a></li>
<li><a href="#">shopping</a></li>
</menu>
</nav>
@import url('https://fonts.googleapis.com/css?family=Source+Code+Pro');
body {
background-image: url('https://images.unsplash.com/photo-1472190649224-495422e1b602?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1951&q=80');
background-size : cover;
}
nav {
width : 240px;
float : left;
-webkit-transition : 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all;
-moz-transition : 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all;
}
input {
display: none;
}
label {
display : inline-block;
margin-left : auto;
width : 60px;
padding : 18px 0;
background-color: rgba(100,100,100,.3);
color : #fff;
text-align : center;
cursor : pointer;
}
li {
list-style-type : none;
border-top : 1px solid #FFF;
border-bottom : 1px solid #ddd;
background-color: #f4f5f6;
background-size : 200% 100%;
background-position : 90% 0px;
-webkit-transition : 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all;
-moz-transition : 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all;
}
a {
display : block;
padding : 25px 0;
color : #454545;
text-align : center;
font-family: 'Source Code Pro', sans-serif;
text-decoration: none;
-webkit-transition : color .1s;
-moz-transition : color .1s;
}
a:hover {
color : #fff;
-webkit-transition : color .1s;
-moz-transition : color .1s;
}
li:nth-child(1) {
border-top : none;
background-image : -webkit-linear-gradient(left, #78cdce 0%, #78cdce 50%, #f4f5f6 0%);
background-image : -moz-linear-gradient(left, #78cdce 0%, #78cdce 50%, #f4f5f6 0%);
}
li:nth-child(2) {
background-image : -webkit-linear-gradient(left, #f16767 0%, #f16767 50%, #f4f5f6 0%);
background-image : -moz-linear-gradient(left, #f16767 0%, #f16767 50%, #f4f5f6 0%);
}
li:nth-child(3) {
background-image : -webkit-linear-gradient(left, #f5ee32 0%, #f5ee32 50%, #f4f5f6 0%);
background-image : -moz-linear-gradient(left, #f5ee32 0%, #f5ee32 50%, #f4f5f6 0%);
}
li:nth-child(4) {
background-image : -webkit-linear-gradient(left, #97cc69 0%, #97cc69 50%, #f4f5f6 0%);
background-image : -moz-linear-gradient(left, #97cc69 0%, #97cc69 50%, #f4f5f6 0%);
}
li:nth-child(5) {
background-image : -webkit-linear-gradient(left, #507abd 0%, #507abd 50%, #f4f5f6 0%);
background-image : -moz-linear-gradient(left, #507abd 0%, #507abd 50%, #f4f5f6 0%);
}
li:nth-child(6) {
background-image : -webkit-linear-gradient(left, #6b408e 0%, #6b408e 50%, #f4f5f6 0%);
background-image : -moz-linear-gradient(left, #6b408e 0%, #6b408e 50%, #f4f5f6 0%);
border-bottom : none;
}
li:hover {
-webkit-transition : 0.3s cubic-bezier(0.175, 0.285, 0.32,1.0) all;
-moz-transition : 0.3s cubic-bezier(0.175, 0.285, 0.32,1.0) all;
background-position : 0% 0%;
}
#toggle:checked ~ nav {
margin-left: -240px;
-webkit-transition : 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all;
-moz-transition : 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all;
}
This Pen doesn't use any external JavaScript resources.