|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | + <head> |
| 4 | + <meta charset="UTF-8" /> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| 6 | + <title>Flip Card</title> |
| 7 | + <style> |
| 8 | + .card { |
| 9 | + background-color: transparent; |
| 10 | + width: 300px; |
| 11 | + height: 500px; |
| 12 | + perspective: 1000px; /* for the 3D effect */ |
| 13 | + margin: auto; |
| 14 | + } |
| 15 | + .card-faces { |
| 16 | + position: relative; |
| 17 | + width: 100%; |
| 18 | + height: 100%; |
| 19 | + transition: transform 0.3s ease 0.5s; |
| 20 | + transform-style: preserve-3d; |
| 21 | + } |
| 22 | + .card:hover .card-faces { |
| 23 | + background: slateblue; |
| 24 | + transform: rotateY(180deg); |
| 25 | + } |
| 26 | + .front-face, |
| 27 | + .back-face { |
| 28 | + position: absolute; |
| 29 | + width: 100%; |
| 30 | + height: 100%; |
| 31 | + -webkit-backface-visibility: hidden; /* Safari */ |
| 32 | + backface-visibility: hidden; |
| 33 | + text-align: center; |
| 34 | + } |
| 35 | + .front-face { |
| 36 | + background-color: slateblue; |
| 37 | + color: whitesmoke; |
| 38 | + } |
| 39 | + .card .front-face img { |
| 40 | + width: 100%; |
| 41 | + } |
| 42 | + .back-face { |
| 43 | + display: grid; |
| 44 | + place-content: center; |
| 45 | + grid-gap: 10px; |
| 46 | + background-color: dodgerblue; |
| 47 | + color: black; |
| 48 | + transform: rotateY(180deg); /*Important*/ |
| 49 | + } |
| 50 | + .back-face p:nth-child(even) { |
| 51 | + color: aqua; |
| 52 | + } |
| 53 | + .contact { |
| 54 | + width: 100%; |
| 55 | + position: absolute; |
| 56 | + /* top: 0; */ |
| 57 | + left: 0; |
| 58 | + bottom: 0; |
| 59 | + padding: 10px 0; |
| 60 | + font-weight: bolder; |
| 61 | + font-size: 18px; |
| 62 | + } |
| 63 | + </style> |
| 64 | + </head> |
| 65 | + <body> |
| 66 | + <div class="card"> |
| 67 | + <div class="card-faces"> |
| 68 | + <div class="front-face"> |
| 69 | + <img src="img/myAvatar_(14).png" alt="John" /> |
| 70 | + <h1>John Doe</h1> |
| 71 | + <p class="title">CEO & Founder</p> |
| 72 | + <p>RRT Corporation</p> |
| 73 | + <a href="#"><i class="fa fa-dribbble"></i></a> |
| 74 | + <a href="#"><i class="fa fa-twitter"></i></a> |
| 75 | + <a href="#"><i class="fa fa-linkedin"></i></a> |
| 76 | + <a href="#"><i class="fa fa-facebook"></i></a> |
| 77 | + <button class="contact">Contact</button> |
| 78 | + </div> |
| 79 | + <div class="back-face"> |
| 80 | + <p>Email:rrt@ceo.com</p> |
| 81 | + <p>Facebook:Mokhless123</p> |
| 82 | + <p>Twitter:Moga123</p> |
| 83 | + <p>Hashnode:Mokhless123</p> |
| 84 | + </div> |
| 85 | + </div> |
| 86 | + </div> |
| 87 | + </body> |
| 88 | +</html> |
0 commit comments