JSFiddle - React, Tailwind, and code Playground

by aparadise

HTML

<seciton class="aniwrap">

  <div class="mario">
   <div class="arrow">
   <span></span>
</div>
  </div>
</seciton>

CSS

.aniwrap {
  border: 1px solid black;
  margin: 0 auto;
  overflow: hidden;
  min-width: 100px;
  min-height: 100px;
}

.mario {
  position: absolute;
  width: 100px;
  height: 100px;
  border: 1px solid red;
  top: 15px;
  left: 50px;
  cursor: pointer;
}

.mario:hover {
  position: absolute;
  width: 100px;
  height: 100px;
  border: 1px solid red;
  top: 15px;
  left: 50px;
  animation-name: drive; /*keyframe name*/
  animation-duration: 2s;
  animation-fill-mode: both;
  animation-iteration-count: infinite; /* 3 */
  animation-timing-function: ease; /* cubic-bezier.com */
}

@keyframes drive {
  from{ transform: translateY(-50px)}
  to{transform: translateY(0)}
 
}

.arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
}

.arrow span {
    display: block;
    width: 30px;
    height: 30px;
    border-bottom: 5px solid #06A8FF;
    border-right: 5px solid #06A8FF;
    transform: rotate(45deg);
    margin: -10px;
    animation: animate 1s infinite;
}