Created
December 25, 2017 12:12
-
-
Save sonalien/6d20796e04b7b32747bf837f36b07550 to your computer and use it in GitHub Desktop.
Untitled
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
.container{ | |
position:absolute; | |
top:50%; | |
left:50%; | |
transform:translate(-50% -50%); | |
width:40px; | |
height:32px; | |
display:block; | |
} | |
.stick, .stick:before, .stick:after{ | |
width:40px; | |
height:4px; | |
background:tomato; | |
position:absolute; | |
top:50%; | |
transform-origin:50% 50%; | |
transition:all 0.6s; | |
} | |
.stick:before{ | |
top:-13px; | |
content:''; | |
position:absolute; | |
left:0; | |
} | |
.stick:after{ | |
top:13px; | |
content:''; | |
position:absolute; | |
left:0; | |
} | |
.stick.trigger{ | |
transform:rotate(180deg); | |
} | |
.stick.trigger:after{ | |
transform-origin: -100% 50%; | |
transform:translateY(-14px) rotate(-45deg) scaleX(0.7); | |
} | |
.stick.trigger:before{ | |
transform-origin: -100% 50%; | |
transform:translateY(14px) rotate(45deg) scaleX(0.7); | |
} |
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
<div class="container"> | |
<div class="stick"></div> | |
</div> |
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
$(function(){ | |
$('.container').click(function(){ | |
$('.stick').toggleClass('trigger'); | |
}) | |
}) |
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
{"view":"separate","fontsize":"100","seethrough":"","prefixfree":"1","page":"javascript"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment