Skip to content

Instantly share code, notes, and snippets.

@codebycliff
Last active December 24, 2015 02:59
Show Gist options
  • Save codebycliff/6734580 to your computer and use it in GitHub Desktop.
Save codebycliff/6734580 to your computer and use it in GitHub Desktop.
CSS animation for tile flipping
.flip-container {
perspective: 1000;
.flipper {
transition: 0.6s; /* all .4s ease-in-out */
transform-style: preserve-3d;
position: relative;
}
.front, .back {
backface-visibility: hidden;
position: absolute;
top: 0;
left: 0;
}
.front { z-index: 2; }
.back { transform: rotateY(180deg); }
&:hover .flipper, &.hover .flipper {
transform: rotateY(180deg);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment