Skip to content

Instantly share code, notes, and snippets.

@zkreations
Created December 3, 2017 17:28
Show Gist options
  • Select an option

  • Save zkreations/f1a18a1cd75f06250292bcd16a8c076b to your computer and use it in GitHub Desktop.

Select an option

Save zkreations/f1a18a1cd75f06250292bcd16a8c076b to your computer and use it in GitHub Desktop.
flip css
/*Card Flip v1.0.0*/
.cardFlip {
perspective: 2000px;
transform-style: preserve-3d;
position: relative;
display: inline-block;
cursor: pointer;
font-size: 10px;
}
.cardFlip.is-active .cardFlip__cover {
transform: rotateY(180deg) translateZ(0);
}
.cardFlip__back {
text-align: center;
position: absolute;
top: 0;left: 0;
width: 100%;height: 100%;
display: flex;
justify-content: center;
transform: rotateY(-180deg) translateZ(0);
background: #414961;
flex-direction: column;
padding: 1em;
font-size: 2em;
}
.cardFlip__back,
.cardFlip__cover {
backface-visibility: hidden;
color: #fff;
transition: transform .5s ease;
transform-style: preserve-3d;
}
.cardFlip__cover,
.cardFlip.is-active .cardFlip__back {
transform: rotateY(0) translateZ(0);
}
.cardFlip__cover img {
max-width: 100%;
margin: 0;
padding: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment