Have you seen the awesome animation on Discord's website?
Check it out here!
The way those coins move up and down so smoothly is really impressive. How can I recreate that effect for my own images?
I decided to start with this code snippet
img {
animation-name: move;
animation-duration: 2.5s;
animation-iteration-count: infinite;
animation-timing-function: ease-in-out;
}
@keyframes move {
0% {
margin-top: 0px;
}
50% {
margin-top: 10px;
}
100% {
margin-top: 0px;
}
}
<img src="https://gonintendo.com/system/file_uploads/uploads/000/013/369/original/bg-header-earn-coins.png">
But when I tested the code, the image wasn't moving as smoothly as I'd hoped. I thought using
animation-timing-function: ease-in-out;
would do the trick.
Do you see something missing in the code that could be causing this issue?