Awesome contact info with flip animation

Posted on October 27th, 2019

Do you know how to create a contact info with flip animation? This post will show you how to do it by Darkcode. Just click on the button Run Pen below to see how it works:

Note: This project also use Font Awesome for creating icons.

How to create a contact info with flip animation

Step 1: Add Html

<div class="container">
  <div class="contact-method">
    <i class="fas fa-envelope"></i>
    <span>[email protected]</span>
  </div>
  <div class="contact-method">
    <i class="fas fa-mobile-alt"></i>
    <span>+111111111111</span>
  </div>
  <div class="contact-method">
    <i class="fas fa-map-marker-alt"></i>
    <span>New York US</span>
  </div>
</div>

Step 2: Add CSS

body {
  margin: 0;
  padding: 0;
  font-family: 'montserrat', sans-serif;
}
.container {
  position: absolute;
  width: 100%;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
}
.contact-method {
  width: 220px;
  height: 140px;
  display: inline-block;
  background: #3498db;
  margin: 10px;
  color: #fff;
  position: relative;
  cursor: pointer;
}
.contact-method i {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  font-size: 30px;
  line-height: 140px;
  background: #34495e;
  z-index: 1;
  transition: transform 0.6s;
}
.contact-method span {
  position: absolute;
  width: 100%;
  left: 0;
  bottom: 0;
  padding: 10px 0;
}

.contact-method:hover i {
  transform: translateY(-40px);
}