Skip to content

Instantly share code, notes, and snippets.

@atdrago
Created December 28, 2012 22:56
Show Gist options
  • Select an option

  • Save atdrago/4402799 to your computer and use it in GitHub Desktop.

Select an option

Save atdrago/4402799 to your computer and use it in GitHub Desktop.
A CodePen by atdrago.
<div>
<h1>Adam Drago</h1>
</div>
$(function () {
$("div").on("click", function () {
$(this).toggleClass("animate");
$("h1").toggleClass("animate");
});
});
@keyframes whirl {
0% {
transform: matrix3d(
1, 0, 1, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1);
}
100% {
transform: matrix3d(
1, 0, 1, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1);
}
}
body {perspective: 700;}
div {
width: 500px;
height: 200px;
margin: 20px auto;
perspective: 700;
transition: transform 2s ease;
border: 5px solid black;
}
h1 {
margin: 75px auto;
width: 191px;
text-align: center;
transform: rotateY(0deg) translateZ(200px);
overflow: hidden;
padding: 10px;
background: forestgreen;
transition: transform 2s ease;
}
h1.animate {
transform: rotateY(-360deg) translateZ(200px);
/*animation: whirl 1s 2 ease alternate forwards;*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment