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;
}
.element-animation{
position: absolute;
top:6px;
z-index:1;
animation: animationFrames ease-in 1s;
animation-iteration-count: infinite;
transform-origin: 0% 100%;
-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: 0% 100%;
-o-animation: animationFrames ease-in 1s;
-o-animation-iteration-count: infinite;
-o-transform-origin: 0% 100%;
-ms-animation: animationFrames ease-in 1s;
-ms-animation-iteration-count: infinite;
-ms-transform-origin: 0% 100%;
}
@keyframes animationFrames{
0% {
transform: rotate(-3deg) ;
}
50% {
transform: rotate(3deg) ;
}
100% {
transform: rotate(-3deg) ;
}
}
@-moz-keyframes animationFrames{
0% {
transform: rotate(-3deg) ;
}
50% {
transform: rotate(3deg) ;
}
100% {
transform: rotate(-3deg) ;
}
}
@-webkit-keyframes animationFrames {
0% {
transform: rotate(-3deg) ;
}
50% {
transform: rotate(3deg) ;
}
100% {
transform: rotate(-3deg) ;
}
}
@-o-keyframes animationFrames {
0% {
transform: rotate(-3deg) ;
}
50% {
transform: rotate(3deg) ;
}
100% {
transform: rotate(-3deg) ;
}
}
@-ms-keyframes animationFrames {
0% {
transform: rotate(-3deg) ;
}
50% {
transform: rotate(3deg) ;
}
100% {
transform: rotate(-3deg) ;
}
}