Skip to content

Instantly share code, notes, and snippets.

@vagdwd
Created April 29, 2015 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vagdwd/958b0353b43923244137 to your computer and use it in GitHub Desktop.
Save vagdwd/958b0353b43923244137 to your computer and use it in GitHub Desktop.
QbbjNL
<div class="container">
<div class="flipper">
<div class="front"></div>
<div class="back"></div>
</div>
</div>
.container {
height: 80px;
width: 80px;
}
.flipper {
position: relative;
display: block;
height: inherit;
width: inherit;
-webkit-animation: flip 2s infinite ease-in-out;
transform-style: preserve-3d;
}
.front,
.back {
position: absolute;
top: 40px;
left: 40px;
backface-visibility: hidden;
display: block;
background-color: #666;
height: 40px;
width: 40px;
}
.back {
background-color: #bbb;
z-index: 800;
transform: rotateY(-180deg);
}
@-webkit-keyframes flip {
0% {
transform: perspective(120px) rotateX(0deg) rotateY(0deg);
}
25% {
transform: perspective(120px) rotateX(-180deg) rotateY(0deg);
}
50% {
transform: perspective(120px) rotateX(-180deg) rotateY(-180deg);
}
75% {
transform: perspective(120px) rotateX(0deg) rotateY(-180deg);
}
100% {
transform: perspective(120px) rotateX(0deg) rotateY(0deg);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment