Last active
August 29, 2015 14:16
-
-
Save maxxscho/b983984867df49cca69a to your computer and use it in GitHub Desktop.
Animated Burger Icon for usage with bourbon.
This file contains 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
.mobile-nav-toggler { | |
@include prefixer(transform, rotate(0deg), webkit moz ms o spec); | |
@include transition(all 0.5s ease-in-out); | |
cursor: pointer; | |
height: 21px; | |
position: absolute; | |
right: 0; | |
top: 22px; | |
width: 30px; | |
span { | |
@include prefixer(transform, rotate(0deg), webkit moz ms o spec); | |
@include transition(all 0.25s ease-in-out); | |
background: red; | |
border-radius: 3px; | |
display: block; | |
height: 3px; | |
left: 0; | |
opacity: 1; | |
position: absolute; | |
width: 100%; | |
&:nth-child(1) { | |
top: 0; | |
} | |
&:nth-child(2) { | |
top: 9px; | |
} | |
&:nth-child(3) { | |
top: 18px; | |
} | |
} | |
&.is-open { | |
span { | |
&:nth-child(1) { | |
@include prefixer(transform, rotate(135deg), webkit moz ms o spec); | |
top: 9px; | |
} | |
&:nth-child(2) { | |
left: -60px; | |
opacity: 0; | |
} | |
&:nth-child(3) { | |
@include prefixer(transform, rotate(-135deg), webkit moz ms o spec); | |
top: 9px; | |
} | |
} | |
} | |
} |
This file contains 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
<div class="mobile-nav-toggler js-mobile-nav-toggler"> | |
<span></span> | |
<span></span> | |
<span></span> | |
</div> |
This file contains 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
$(document).ready(function(){ | |
$('.js-mobile-nav-toggler').on('click', function() { | |
$(this).toggleClass('is-open'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment