I have an animation of pixel art of a cartoon character standing still, but the animation is sliding which makes it look like the character is walking.
Outcome I want is character animating in the same place and not sliding
HTML
<nav class = "nav">
<div class = "nav-item">
<ul>
<div class = "agumon">
<img class = "agumon-standing" src="images/sprites/standing/standing-collection.png" alt="agumon sprite">
</div>
<li><a href="#"></a>Home</li>
<li><a href="#"></a>About Me</li>
<li><a href="#"></a>Experience</li>
<li><a href="#"></a>Work</li>
<li><a href="#"></a>Contact</li>
</ul>
</div>
</nav>
CSS
.agumon{
position: absolute;
width: calc(22px * var(--pixel-size));
height: calc(32px * var(--pixel-size));
overflow: hidden;
margin-left:41rem;
display: none;
}
.agumon-standing{
animation: movespritesheet 2s steps(12) infinite;
width: calc(320px * var(--pixel-size));
image-rendering: pixelated;
}
@keyframes movespritesheet {
from{
transform: translate3d(0px, 0, 0);
}
to{
transform: translate3d(-100%, 0, 0);
}
}
I have attached the image I am using so you can see how it is animating
