<div class="card">
<div class="card-img"></div>
<div class="card-body">
<span class="bg"></span>
<span class="bg"></span>
<span class="bg"></span>
<div class="content">
<h2 class="title">card 01</h2>
<p class="para">Lorem ipsum dolor sit amet consectetur adipisicing elit. Non aperiam fugiat eos odit numquam vitae facere dolore id libero sit!</p>
</div>
</div>
</div>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
font-family: 'roboto', sans-serif;
background: rgb(49, 162, 255);
perspective: 1000px;
}
.card{
width: 300px;
height: 450px;
position: relative;
transform-style: preserve-3d;
transition: 1s;
}
.card-img{
position: relative;
width: 100%;
height: 100%;
background: url(https://github.com/kunaal438/card-hover/blob/master/img.jpg?raw=true);
background-size: cover;
border-radius: 20px;
transform: translateZ(40px);
}
.card-body{
position: absolute;
top: 50%;
left: 50%;
transform: translate3d(-50%, -50%, -40px) rotateY(180deg);
width: 85%;
height: 87%;
border-radius: 20px;
overflow: hidden;
border: 5px solid #fff;
}
.card:hover{
transform: rotateY(180deg);
}
.card-body .bg{
position: absolute;
background: #fff;
border-radius: 100px;
width: 0%;
transition: .5s;
}
.card-body .bg:nth-child(1){
height: 25%;
transform-origin: left;
top: 0;
left: -30%;
transform: rotate(-10deg);
}
.card-body .bg:nth-child(2){
height: 50%;
transform-origin: right;
top: 5%;
right: -30%;
transform: rotate(-10deg);
}
.card-body .bg:nth-child(3){
height: 50%;
transform-origin: left;
top: 70%;
left: -30%;
transform: rotate(-10deg);
}
.card:hover .card-body .bg{
width: 200%;
transition-delay: 1s;
}
.card:hover .card-body .bg:nth-child(2){
transition-delay: 1.5s;
}
.card:hover .card-body .bg:nth-child(3){
transition-delay: 2s;
}
.content{
position: relative;
opacity: 0;
transition: .5s;
padding: 40px 10px;
text-align: center;
}
.title{
font-size: 60px;
margin-bottom: 20px;
color: #292929;
text-transform: uppercase;
}
.card:hover .content{
opacity: 1;
transition-delay: 2.5s;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.