A Pen by Captain Anonymous on CodePen.
Created
December 13, 2014 22:43
-
-
Save c-mac/608617efe52c25db52d2 to your computer and use it in GitHub Desktop.
jEqzzw
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
<a href="#" class="menu-icon"> | |
<div class="line"></div> | |
</a> |
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
$('.menu-icon').click(function() { | |
$(this).toggleClass('toggle'); | |
}); |
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
@import "bourbon"; | |
.menu-icon { | |
padding:1rem; | |
display:block; | |
&.toggle { | |
&:before, &:after { | |
opacity:0; | |
} | |
.line { | |
@include transform(rotate(45deg)); | |
&:before { | |
@include transform(rotate(-90deg)); | |
} | |
} | |
} | |
.line { | |
width:2rem; | |
height:2px; | |
background:#000; | |
@include transition(all 0.3s ease); | |
&:before { | |
content:""; | |
width:2rem; | |
height:2px; | |
background:#000; | |
display:block; | |
@include transition(all 0.3s ease); | |
} | |
} | |
&:before, &:after { | |
content:""; | |
width:2rem; | |
height:2px; | |
background:#000; | |
display:block; | |
margin-bottom:0.5rem; | |
@include transition(all 0.3s ease); | |
} | |
&:after { | |
margin-top:0.5rem; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment