A Pen by Ream

Thumbnail
This awesome code was written by ream-lab, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright ream-lab ©
  • HTML
  • CSS
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>A Pen by  Ream</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  
<div class="block">
  <div class="block-hover"> </div>
  <div class="block__item"></div>
</div>
  
  

</body>

</html>

/*Downloaded from https://www.codeseek.co/ream-lab/a-pen-by-ream-KrGZwb */
.block {
  position: relative;
  width: 300px;
  height: 300px;
  background-color: #f90;
}
.block-hover {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 100%;
  background-color: #f00;
}
.block-hover:hover + .block__item {
  opacity: 1;
}
.block:hover .block-hover {
  animation: control 10s;
}
.block__item {
  position: relative;
  opacity: 0;
  width: 30px;
  height: 30px;
  background-color: #000;
  z-index: 1;
}
.block:hover .block__item {
  animation: show 1s;
}
@-moz-keyframes show {
  0% {
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@-webkit-keyframes show {
  0% {
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@-o-keyframes show {
  0% {
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes show {
  0% {
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@-moz-keyframes control {
  0% {
    right: 0;
  }
  100% {
    right: 100%;
  }
}
@-webkit-keyframes control {
  0% {
    right: 0;
  }
  100% {
    right: 100%;
  }
}
@-o-keyframes control {
  0% {
    right: 0;
  }
  100% {
    right: 100%;
  }
}
@keyframes control {
  0% {
    right: 0;
  }
  100% {
    right: 100%;
  }
}

Comments