Can someone help me change the floating direction in this example? It's currently set to float from bottom to top, but I want it to float right and left instead.
I've been adjusting the numbers in the CSS code provided below, but I'm not achieving the desired result. Any suggestions?
.floating {
animation-name: floating;
animation-duration: 3s;
animation-iteration-count: infinite;
animation-timing-function: ease-in-out;
margin-left: 30px;
margin-top: 5px;
}
@keyframes floating {
from {
transform: translate(90, 8px);
}
35% {
transform: translate(70, 8px);
}
to {
transform: translate(50, -8px);
}
}
<div class="floating" style="height: 50px; width: 50px; background: rgb(200,200,200);"></div>