Last active
August 29, 2015 14:18
-
-
Save moladukes/e0a8bd0a5a9d2bd52ee0 to your computer and use it in GitHub Desktop.
Animated drawer icon
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
.hamburger { | |
position: relative; | |
width: 20px; | |
height: 40px; | |
.patty { | |
position: absolute; | |
display: block; | |
width: 20px; | |
height: 1px; | |
background: #fff; | |
@include transition(all .15s ease-in-out); | |
&:first-child { | |
top: 0; | |
} | |
&:nth-child(2) { | |
top: 5px; | |
} | |
&:last-child { | |
top: 10px; | |
} | |
} | |
} | |
.drawer-active { | |
.patty { | |
&:first-child { | |
top: 5px; | |
@include rotate(45deg); | |
} | |
&:nth-child(2) { | |
background: transparent !important; | |
} | |
&:last-child { | |
top: 5px; | |
@include rotate(-45deg); | |
} | |
} | |
} |
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
.drawer | |
= link_to "#", class: "hamburger drawer-toggle" do | |
.patty | |
.patty | |
.patty |
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
$('.drawer-toggle').click(function(){ | |
$('.drawer').toggleClass('.drawer-active'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment