

How to make an awesome card hover effect
source link: https://dev.to/kunaal438/how-to-make-an-awesome-card-hover-effect-45j5
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Hello, glad you are here. I am kunaal and today we will see how to make an awesome 3d card hover effect. You can see demo below.
Video Tutorial -
If you find this article hard or for better explanation. You can watch video tutorial.
If you like the video tutorial. Please consider subscribing my youtube channel.
Let's code
Inside HTML file under <body>
tag write
<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>
After that we only have to add CSS
*{
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(img.jpg);
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;
}
I hope you understood everything. If you have any doubt or you find any mistake that I made or you have any suggestion feel free to ask me in comment.
If you are interested in programming and want to know how I a 15yr old teen do coding make these design. You can follow me on my Instagram. I am also planning to post my game development stuff on Instagram.
Recommend
-
25
Last week Apple updated iPad Pro and added trackpad support to iPadOS. We finally have Xcode 11.4, which introduces the onHover and hoverEffect modifiers to help us utilize trackpad and mouse support i...
-
11
Rotated 3D Letters and Image Hover Effect A rotated 3D like letters hover effect combined with a tilted image for a menu. ...
-
8
How to Code a Crosshair Mouse Cursor with Distortion Hover Effect A quick tutorial on how to craft a fullscreen SVG crosshair mouse cursor with a special distortion hover effect. ...
-
12
Thumbnail Hover Effect with SVG Filters A simple thumbnail hover effect with an SVG filter distortion. ...
-
9
-
10
Cursor Hover Effect With JavaScript Mouse Events and GSAPxxxxxxxxxx<section class="intro"> Â <div class="container"> Â Â <div class="row...
-
6
Pen Settings HTML Preprocessor Add Class(es) to <html> Stuff for <head> ...
-
8
Hover Preview Effect with Mini Map An experimental hover effect, where a content preview is shown while a mini map indicates the position of the cursor. ...
-
12
CSS Image Hover effect 0 unsaved changes xxxxxxxxxx​<div class="container">  <div class="box"&...
-
9
Hover Card EffectHover card effects are a great way to add an extra layer of interactivity to web pages, engaging users and providing feedback on their interactions. With the help of Javascript and CSS animations, t...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK