A Pen by Aditya Bhandari on CodePen.
Last active
March 30, 2016 15:51
-
-
Save hateum/f3ffde41353ecd0928a8 to your computer and use it in GitHub Desktop.
Flip Cards
This file contains hidden or 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="card-container"> | |
<div class="card"> | |
<div class="front"> | |
<span class="fa fa-user"></span> | |
</div> | |
<div class="back">User</div> | |
</div> | |
</div> | |
<div class="card-container"> | |
<div class="card"> | |
<div class="front"> | |
<span class="fa fa-cogs"></span> | |
</div> | |
<div class="back">Settings</div> | |
</div> | |
</div> | |
<div class="card-container"> | |
<div class="card"> | |
<div class="front"> | |
<span class="fa fa-code"></span> | |
</div> | |
<div class="back">Code</div> | |
</div> | |
</div> |
This file contains hidden or 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
<script src="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"></script> |
This file contains hidden or 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
@import url(https://fonts.googleapis.com/css?family=Open+Sans); | |
body { | |
height: 100vh; | |
width: 100%; | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
background: linear-gradient(to left, #517fa4, #243949); | |
font-family: Open Sans; | |
} | |
.card-container{ | |
perspective: 900px; | |
margin-right: 20px; | |
} | |
.card{ | |
position: relative; | |
width: 100px; | |
height: 100px; | |
transition: all 0.6s ease; | |
transform-style: preserve-3d; | |
} | |
.front,.back{ | |
position: absolute; | |
background: #7FC6A4; | |
top: 0; | |
left: 0; | |
width: 100px; | |
height: 100px; | |
border-radius: 5px; | |
color: white; | |
box-shadow: 0 27px 55px 0 rgba(0, 0, 0, 0.3), 0 17px 17px 0 rgba(0, 0, 0, 0.15); | |
backface-visibility: hidden; | |
} | |
.front{ | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
font-size: 30px; | |
} | |
.back{ | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
font-size: 18px; | |
} | |
.card-container:hover .card{ | |
transform: rotateY(180deg); | |
} | |
.back{ | |
transform: rotateY(180deg); | |
} |
This file contains hidden or 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
@import url(https://fonts.googleapis.com/css?family=Open+Sans); | |
body { | |
height: 100vh; | |
width: 100%; | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
background: linear-gradient(to left, #517fa4, #243949); | |
font-family: Open Sans; | |
} | |
.card-container{ | |
perspective: 900px; | |
margin-right: 20px; | |
} | |
.card{ | |
position: relative; | |
width: 100px; | |
height: 100px; | |
transition: all 0.6s ease; | |
transform-style: preserve-3d; | |
} | |
.front,.back{ | |
position: absolute; | |
background: #7FC6A4; | |
top: 0; | |
left: 0; | |
width: 100px; | |
height: 100px; | |
border-radius: 5px; | |
color: white; | |
box-shadow: 0 27px 55px 0 rgba(0, 0, 0, 0.3), 0 17px 17px 0 rgba(0, 0, 0, 0.15); | |
backface-visibility: hidden; | |
} | |
.front{ | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
font-size: 30px; | |
} | |
.back{ | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
font-size: 18px; | |
} | |
.card-container:hover .card{ | |
transform: rotateY(180deg); | |
} | |
.back{ | |
transform: rotateY(180deg); | |
} |
This file contains hidden or 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
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment