image hover

In this example below you will see how to do a image hover with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by sumudu, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright sumudu ©

Technologies

  • HTML
  • CSS
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>image hover</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  
  <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script>

  

</body>

</html>

/*Downloaded from https://www.codeseek.co/sumudu/image-hover-aBBQpr */
.main {
  width: 270px;
  height: 406px;
  dispaly: block;
  float: left;
  margin-right: 15px;
}
.main:hover {
  animation: work 600ms ease-in-out 1;
}

@keyframes work {
  0% {
    opacity: 0.4;
    transform: rotate(0deg) scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
  75% {
    opacity: 0.8;
    transform: rotate(15deg);
  }
  80% {
    opacity: 1;
    transform: rotate(10deg);
  }
  88% {
    opacity: 1;
    transform: rotate(5deg);
  }
  100% {
    opacity: 1;
    transform: rotate(-5deg);
  }
}

Comments