-
-
Save AlexandrKutsenko/0ecb73e589623f68b9eb26246f2bb832 to your computer and use it in GitHub Desktop.
sanwich
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
body { | |
background-color: #333; | |
} | |
#sandwich { | |
width: 100px; | |
height: 100px; | |
position: absolute; | |
top: 0; | |
bottom: 0; | |
left: 0; | |
right: 0; | |
margin: auto; | |
} | |
.sw-topper { | |
position: relative; | |
top: 0; | |
width: 100px; | |
height: 10px; | |
background: #fff; | |
border: none; | |
border-radius: 4px 4px 4px 4px; | |
transition: transform 0.5s, top 0.2s; | |
/* transition-delay: 0.2s, 0s; */ | |
} | |
.sw-bottom { | |
position: relative; | |
width: 100px; | |
height: 10px; | |
top: 20px; | |
background: #fff; | |
border: none; | |
border-radius: 4px 4px 4px 4px; | |
transition: transform 0.5s, top 0.2s; | |
transition-delay: 0.2s, 0s; | |
} | |
.sw-footer { | |
position: relative; | |
width: 100px; | |
height: 10px; | |
top: 40px; | |
background: #fff; | |
border: none; | |
border-radius: 4px 4px 4px 4px; | |
transition: all 0.5s; | |
transition-delay: 0.1s; | |
} | |
#sandwich.active .sw-topper { | |
top: 15px; | |
transform: rotate(140deg); | |
} | |
#sandwich.active .sw-bottom { | |
top: 5px; | |
transform: rotate(-140deg); | |
} | |
#sandwich.active .sw-footer { | |
opacity: 0; | |
top: 0; | |
transform: rotate(180deg); | |
} |
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 id='sandwich'> | |
<div class='sw-topper'></div> | |
<div class='sw-bottom'></div> | |
<div class='sw-footer'></div> | |
</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
$("#sandwich, .menu_item").click(function() { | |
$("#sandwich").toggleClass("active"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment