JSFiddle - React, Tailwind, and code Playground

by Sam Westwood

HTML

<div> <img class="element-animation" src="https://i.imgur.com/6hPFhc2.png" alt="upper"> <img class="bottom" src="https://i.imgur.com/B5AIwb8.png" alt="bottom"><img src="https://i.imgur.com/Vct6plK.png" alt="bottom"></div>

CSS

.bottom{
  position: absolute;
  z-index:2;
  left:6px;
  top:10px;
 
  /*display:none;*/
}

.element-animation{
  position: absolute;
  top:6px;
  z-index:1;
  animation: animationFrames ease-in 1s;
  animation-iteration-count: infinite;
  transform-origin: 0% 0%;
  -webkit-animation: animationFrames ease-in 1s;
  -webkit-animation-iteration-count: infinite;
  -webkit-transform-origin: 0% 100%;
  -moz-animation: animationFrames ease-in 1s;
  -moz-animation-iteration-count: infinite;
  -moz-transform-origin: 100% 100%;
  -o-animation: animationFrames ease-in 1s;
  -o-animation-iteration-count: infinite;
  -o-transform-origin: 100% 100%;
  -ms-animation: animationFrames ease-in 1s;
  -ms-animation-iteration-count: infinite;
  -ms-transform-origin: 100% 100%;
}

@keyframes animationFrames{
  0% {
    transform:  rotate(-3deg) ;
  }
  50% {
    transform:  rotate(3deg) ;
  }
  100% {
    transform:  rotate(-3deg) ;
  }
}

@-moz-keyframes animationFrames{
  0% {
    -moz-transform:  rotate(0deg) ;
  }
  50% {
    -moz-transform:  rotate(-5deg) ;
  }
  100% {
    -moz-transform:  rotate(0deg) ;
  }
}

@-webkit-keyframes animationFrames {
  0% {
    -webkit-transform:  rotate(0deg) ;
  }
  50% {
    -webkit-transform:  rotate(-5deg) ;
  }
  100% {
    -webkit-transform:  rotate(0deg) ;
  }
}

@-o-keyframes animationFrames {
  0% {
    -o-transform:  rotate(0deg) ;
  }
  50% {
    -o-transform:  rotate(-5deg) ;
  }
  100% {
    -o-transform:  rotate(0deg) ;
  }
}

@-ms-keyframes animationFrames {
  0% {
    -ms-transform:  rotate(0deg) ;
  }
  50% {
    -ms-transform:  rotate(-5deg) ;
  }
  100% {
    -ms-transform:  rotate(0deg) ;
  }
}