JSFiddle - React, Tailwind, and code Playground
by Sam Westwood
HTML
<div> <img class="element-animation" src="https://i.imgur.com/mChHgOp.png"> <img class="element-animation23" src="https://i.imgur.com/hMNcZg0.png" alt="bottom"> <img class="element-animation2" src="https://i.imgur.com/XYMwyxK.png" alt="bottom"> </div>
CSS
.back{
position: absolute;
z-index:30;
left:8px;
top:5px;
/*display:none;*/
}
.element-animation{
position: absolute;
top:7px;
z-index:40;
animation: animationFrames ease-in-out 0.5s;
animation-iteration-count: infinite;
transform-origin: 0% 0%;
-webkit-animation: animationFrames ease-in-out 0.5s;
-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: translate(18px,0px) ;
}
50% {
transform: translate(-1px,-1px) ;
}
100% {
transform: translate(18px,0px) ;
}
}
@-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) ;
}
}
.element-animation23{
position: absolute;
top:7px;
z-index:30;
animation: animationFrames23 ease-in-out 1s;
animation-iteration-count: infinite;
transform-origin: 50% 50%;
-webkit-animation: animationFrames23 ease-in-out 0.5s;
-webkit-animation-iteration-count: infinite;
...