Create Card Interactions with the Clip Path Hover Animation | CSS Clip path Property
In this video you will learn How to create CSS Clip Path Animation in simple steps.
Hey all! Today, we're going to take a close look at the CSS clip-path property. we'll take a look at 3 different examples of how to use clip-path to create a micro interaction that reveals a card of information.
source code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style type="text/css">
body{
background: rgb(144,174,193);
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
color: #fff;
font-family: sans-serif;
}
/* .container{
width: 35%;
background: #fff;
border-radius: 10px;
} */
.inner{
padding: 1em;
background-color: rgb(13,224,224);
border-radius: 10px;
width: 450px;
cursor: pointer;
clip-path: circle(10% at 90% 20%);
transition: all .5s ease-in-out;
}
.inner:hover{
clip-path: circle(75%);
}
span{
float: right;
color: #000;
font-weight: 900;
font-size: 20px;
position: relative;
margin-top: -70px;
margin-right: 26px;
}
.inner:hover span{
color: rgb(13,224,224);
transition: .3s ;
}
</style>
</head>
<body>
<div class="container">
<div class="inner">
<h1>hey</h1>
<span>i</span>
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Voluptatem doloremque neque quisquam maiores, sed adipisci culpa ex ducimus officiis numquam.</p>
</div>
</div>
</body>
</html>
No comments:
Post a Comment