<script src="https://kit.fontawesome.com/a7e9f794eb.js" crossorigin="anonymous"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;800&display=swap" rel="stylesheet">
<div class="container">
<div class="block">
<div class="head">
<h2><span>Enjoy</span> The Life</h2>
<div class="box">
<p>Stay Healthy</p>
<p>Stay Happy</p>
</div>
</div>
<div class="bg"></div>
<div class="iconBox">
<div class="icon">
<i class="fas fa-home"></i>
</div>
<div class="icon">
<i class="fas fa-heart"></i>
</div>
<div class="icon">
<i class="fas fa-link"></i>
</div>
<div class="icon">
<i class="fas fa-reply"></i>
</div>
</div>
</div>
<div class="block">
<div class="head">
<h2><span>Enjoy</span> The Life</h2>
<div class="box">
<p>Stay Healthy</p>
<p>Stay Happy</p>
</div>
</div>
<div class="bg"></div>
<div class="iconBox">
<div class="icon">
<i class="fas fa-home"></i>
</div>
<div class="icon">
<i class="fas fa-heart"></i>
</div>
<div class="icon">
<i class="fas fa-link"></i>
</div>
<div class="icon">
<i class="fas fa-reply"></i>
</div>
</div>
</div>
<div class="block">
<div class="head">
<h2><span>Enjoy</span> The Life</h2>
<div class="box">
<p>Stay Healthy</p>
<p>Stay Happy</p>
</div>
</div>
<div class="bg"></div>
<div class="iconBox">
<div class="icon">
<i class="fas fa-home"></i>
</div>
<div class="icon">
<i class="fas fa-heart"></i>
</div>
<div class="icon">
<i class="fas fa-link"></i>
</div>
<div class="icon">
<i class="fas fa-reply"></i>
</div>
</div>
</div>
</div>
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
.container {
width: 100vw;
height: 100vh;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
padding: 20px;
font-family: "Montserrat", sans-serif;
}
.block {
width: 300px;
height: 300px;
margin: 20px;
position: relative;
overflow: hidden;
box-shadow: 2px 2px 15px 2px #111;
display: flex;
justify-content: center;
align-items: center;
border: 0px solid #fff;
transition: all 500ms linear;
}
.bg {
position: absolute;
width: 100%;
height: 100%;
background-image: url("https://images.unsplash.com/photo-1418065460487-3e41a6c84dc5?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80");
background-position: center;
background-size: cover;
transition: all 400ms ease;
}
.block:hover .bg {
transform: scale(1.2);
}
/* Heading Text */
.head {
position: absolute;
width: 100%;
height: 100%;
text-align: center;
letter-spacing: 2px;
z-index: 20;
}
h2 {
padding-top: 50px;
text-shadow: 0 0 1px #111;
letter-spacing: 3px;
text-transform: uppercase;
transform-origin: left center;
transform: none;
transition: all 300ms ease-out;
}
h2 span {
font-weight: 300;
color: rgb(71, 20, 255);
}
.block:hover h2 {
color: #fff;
transform: rotate(90deg) translateY(-60px) translateX(-35px);
}
/* Heading Text */
/* Icon Box */
.iconBox {
position: absolute;
right: 0;
top: 0;
height: 100%;
width: 20%;
background-color: #fff;
z-index: 1000;
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
transform: translateX(60px);
transition: all 300ms ease;
}
.block:hover .iconBox {
transform: translateX(0px);
}
.iconBox .icon i {
color: #111;
font-size: 20px;
transition: all 300ms ease;
}
.iconBox .icon i:hover {
color: rgb(76, 0, 255);
transform: scale(1.2);
}
/* Icon Box */
/* Text Box */
.box {
bottom: 20px;
position: absolute;
bottom: 20px;
right: 0;
color: #fff;
padding: 0 20px;
font-weight: 400;
transform: translate(200px);
transition: all 400ms ease;
}
.box p {
letter-spacing: 3px;
line-height: 150%;
}
.block:hover .box {
transform: translateY(-90px) translateX(-80px);
color: #111;
background-color: rgb(255, 255, 255);
padding: 10px;
}
/* Text Box */
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.