Skip to content

Instantly share code, notes, and snippets.

@moladukes
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moladukes/e0a8bd0a5a9d2bd52ee0 to your computer and use it in GitHub Desktop.
Save moladukes/e0a8bd0a5a9d2bd52ee0 to your computer and use it in GitHub Desktop.
Animated drawer icon
.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);
}
}
}
.drawer
= link_to "#", class: "hamburger drawer-toggle" do
.patty
.patty
.patty
$('.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