Created
April 22, 2014 11:53
-
-
Save locks/11175838 to your computer and use it in GitHub Desktop.
Untitled
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
@-webkit-keyframes panelShakeAnimation { | |
0% { | |
-webkit-transform: translateX(0); | |
-moz-transform: translateX(0); | |
-ms-transform: translateX(0); | |
-o-transform: translateX(0); | |
transform: translateX(0); | |
} | |
12.5% { | |
-webkit-transform: translateX(-6px) rotateY(-5deg); | |
-moz-transform: translateX(-6px) rotateY(-5deg); | |
-ms-transform: translateX(-6px) rotateY(-5deg); | |
-o-transform: translateX(-6px) rotateY(-5deg); | |
transform: translateX(-6px) rotateY(-5deg); | |
} | |
37.5% { | |
-webkit-transform: translateX(5px) rotateY(4deg); | |
-moz-transform: translateX(5px) rotateY(4deg); | |
-ms-transform: translateX(5px) rotateY(4deg); | |
-o-transform: translateX(5px) rotateY(4deg); | |
transform: translateX(5px) rotateY(4deg); | |
} | |
62.5% { | |
-webkit-transform: translateX(-3px) rotateY(-2deg); | |
-moz-transform: translateX(-3px) rotateY(-2deg); | |
-ms-transform: translateX(-3px) rotateY(-2deg); | |
-o-transform: translateX(-3px) rotateY(-2deg); | |
transform: translateX(-3px) rotateY(-2deg); | |
} | |
87.5% { | |
-webkit-transform: translateX(2px) rotateY(1deg); | |
-moz-transform: translateX(2px) rotateY(1deg); | |
-ms-transform: translateX(2px) rotateY(1deg); | |
-o-transform: translateX(2px) rotateY(1deg); | |
transform: translateX(2px) rotateY(1deg); | |
} | |
100% { | |
-webkit-transform: translateX(0); | |
-moz-transform: translateX(0); | |
-ms-transform: translateX(0); | |
-o-transform: translateX(0); | |
transform: translateX(0); | |
}; | |
} | |
.panelView { | |
background-color: blue; | |
padding: 0.5em; | |
margin: 2em; | |
border-radius: 6px; | |
width: 300px; | |
-webkit-transform: translateY(0px) scale(1); | |
position: absolute; | |
} | |
input[type=checkbox] { | |
transform: scale(2); | |
} | |
.overlay { | |
-webkit-perspective: 500; | |
transform: rotateZ(5deg) translateY(27px); | |
transform-origin: 50% 50%; | |
} | |
.panelView.shake { | |
-webkit-animation-duration: 400ms; | |
-webkit-animation-timing-function: ease-in-out; | |
-webkit-animation-name: panelShakeAnimation; | |
-moz-animation-duration: 400ms; | |
-moz-animation-timing-function: ease-in-out; | |
-moz-animation-name: panelShakeAnimation; | |
} |
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 class="overlay"> | |
<div class="panelView shake"> | |
<h1>HEllo World</h1> | |
<input type="checkbox"> | |
</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
document.getElementsByClassName('panelView')[0].onclick = function(event) { | |
var lol = document.getElementsByClassName('panelView')[0]; | |
lol.className = "panelView"; | |
setTimeout(function() { lol.className = "panelView shake"; }, 1); | |
} |
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
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment