Created
June 14, 2018 00:52
-
-
Save muks999/2923c8c661b1cb7f4a46338f4ad9a445 to your computer and use it in GitHub Desktop.
Sandwich
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
.sandwich | |
.sandwich__line.sandwich__line--top | |
.sandwich__line.sandwich__line--middle | |
.sandwich__line.sandwich__line--bottom | |
.sandwich { | |
cursor: pointer; | |
display: none; | |
height: 20px; | |
position: relative; | |
width: 32px; | |
@media screen and (max-width: $tablet-wide) { display: block; } | |
&--active { | |
.sandwich__line { | |
&--top { | |
top: 10px; | |
transform: rotate(45deg); | |
} | |
&--middle { opacity: 0; } | |
&--bottom { | |
top: 10px; | |
transform: rotate(-45deg); | |
} | |
} | |
} | |
&__line { | |
background-color: $white; | |
display: block; | |
height: 2px; | |
left: 0; | |
position: absolute; | |
transition: all linear .4s; | |
width: 100%; | |
&--top { top: 0; } | |
&--middle { top: 9px; } | |
&--bottom { top: 18px; } | |
} | |
} | |
var sandwich = function () { | |
$(document).on('click', '.sandwich', function () { | |
$(this).toggleClass('sandwich--active'); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment