Product Cover Hover Using HTML / CSS




HTML :

<!DOCTYPE html>
<html lang="en" dir="ltr">
   <head>
      <meta charset="utf-8">
      <title>Hover by Growcode</title>
      <link rel="stylesheet" href="style.css">
   </head>
   <body>
    <div class="container">
      <div class="card">
        <div class="contbox">
          <img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7U9feBzpUDFnlm8-NW3D7OWKLnhaKBGV_VdwKhwF8m1oQYi43ve-glc2YTK2KtA_uf55DSWmSOHW6NEVnLW_2BgQ5OvNcpoGmEr09xKQ1xTVfYXXYwpCPAZQQOFtkctEy3k18GlJcN7BzyBxnybiqv41Wnzb99zQnsKxtx_l2MBgRFieFAjQm6lBT/s320/pngwing.com%20(6).png">
        </div>
        <div class="contentBx">
          <h2>Apple Watches</h2>
          <div class="color">
            <h3>Color :</h3>
            <span></span>
            <span></span>
            <span></span>
          </div>
          <a href="#">Buy Now</a>
        </div>
      </div>
    </div>
   </body>
</html>

CSS :


@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
*{
  font-family: 'Poppins', sans-serif;
}
body{
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #131313;
}
.container{
  position: relative;
}
.container .card{
  position: relative;
  width: 320px;
  height: 450px;
  background: #232323;
  border-radius: 20px;
  overflow: hidden;
}
.container .card:before{
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #b4fb03;
  clip-path: circle(150px at 80% 20%);
  transition: 0.5s ease-in-out;
}
.container .card:hover:before{
  clip-path: circle(300px at 80% -20%);
}
.container .card:after{
  content: 'Apple';
  position: absolute;
  top: 30%;
  left: -20%;
  font-size: 12em;
  font-weight: 800;
  font-style: italic;
  color: rgba(255,255,25,0.05)
}
.container .card .contbox{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10000;
  width: 100%;
  height: 220px;
  transition: 0.5s;
}
.container .card:hover .contbox{
  top: 0%;
  transform: translateY(0%);
   
}
.container .card .contbox img{
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 270px;
}
.container .card .contentBx{
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100px;
  text-align: center;
  transition: 1s;
  z-index: 10;
}
.container .card:hover .contentBx{
  height: 200px;
}

.container .card .contentBx h2{
  position: relative;
  font-weight: 600;
  letter-spacing: 1px;
  color: #fff;
  margin: 0;
}

.container .card .contentBx .size, .container .card .contentBx .color {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 20px;
  transition: 0.5s;opacity: 0;
  visibility: hidden;
  padding-top: 0;
  padding-bottom: 0;
}

.container .card:hover .contentBx .size{
  opacity: 1;
  visibility: visible;
  transition-delay: 0.5s;
}

.container .card:hover .contentBx .color{
  opacity: 1;
  visibility: visible;
  transition-delay: 0.6s;
}

.container .card .contentBx .size h3, .container .card .contentBx .color h3{
  color: #fff;
  font-weight: 300;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-right: 10px;
}
.container .card .contentBx .size span:hover{
  background: #b4fb03;
}
.container .card .contentBx .color span{
  width: 20px;
  height: 20px;
  background: #ff0;
  border-radius: 50%;
  margin: 0 5px;
  cursor: pointer;
}

.container .card .contentBx .color span:nth-child(2){
  background: #b4fb03;
}

.container .card .contentBx .color span:nth-child(3){
  background: #03a9f4;
}

.container .card .contentBx .color span:nth-child(4){
  background: #e91e63;
}
.container .card .contentBx a{
  display: inline-block;
  padding: 10px 20px;
  background: #b4fb03;
  border-radius: 4px;
  margin-top: 10px;
  text-decoration: none;
  font-weight: 600;
  color: #111;
  opacity: 0;
  transform: translateY(50px);
  transition: 0.5s;
  margin-top: 0;
}
.container .card:hover .contentBx a{
  opacity: 1;
  transform: translateY(0px);
  transition-delay: 0.75s;
}












 

Comments

Popular Posts