Created
August 31, 2018 14:31
-
-
Save veritstudio/e99c8fcd43699c9268f236fec679c03e to your computer and use it in GitHub Desktop.
Animated hamburger icon for mobile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<header> | |
<div class="nav-toggle"> | |
<span></span> | |
<span></span> | |
<span></span> | |
<span></span> | |
</div> | |
</header> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#nav-icon3 { | |
left: 15px; | |
position: absolute; | |
z-index: 14; | |
width: 19px; | |
height: 23px; | |
margin: 16px auto 0; | |
.lib-rotate(0deg); | |
-webkit-transition: transfrom .5s ease-in-out; | |
-moz-transition: transfrom .5s ease-in-out; | |
-o-transition: transfrom .5s ease-in-out; | |
transition: transfrom .5s ease-in-out; | |
cursor: pointer; | |
} | |
#nav-icon3 span { | |
display: block; | |
position: absolute; | |
height: 1px; | |
width: 100%; | |
border-bottom: 1px solid; | |
border-color: inherit; | |
opacity: 1; | |
left: 0; | |
.lib-rotate(0deg); | |
-webkit-transition: .25s transform ease-in-out; | |
-moz-transition: .25s transform ease-in-out; | |
-o-transition: .25s transform ease-in-out; | |
transition: .25s transform ease-in-out; | |
} | |
#nav-icon3 span:nth-child(1) { | |
top: 0px; | |
} | |
#nav-icon3 span:nth-child(2),#nav-icon3 span:nth-child(3) { | |
top: 8px; | |
} | |
#nav-icon3 span:nth-child(4) { | |
top: 16px; | |
} | |
.nav-open { #nav-icon3 span:nth-child(1) { | |
top: 8px; | |
width: 0%; | |
left: 50%; | |
}} | |
.nav-open { #nav-icon3 span:nth-child(2) { | |
.lib-rotate(45deg); | |
}} | |
.nav-open { | |
#nav-icon3 span:nth-child(3) { | |
.lib-rotate(-45deg); | |
} | |
} | |
.nav-open { | |
#nav-icon3 span:nth-child(4) { | |
top: 8px; | |
width: 0%; | |
left: 50%; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment