I'm looking to create an animation where a car moves from left to right and then switches to another image moving from right to left. Can anyone provide assistance with this task?
Here's the code I have so far:
.car-movement {
position: absolute;
top: 65%;
left: 0;
-webkit-animation: linear infinite;
-webkit-animation-name: run;
-webkit-animation-duration: 5s;
}
@-webkit-keyframes run {
0% {
left: 0;
}
50% {
left: calc(100% - 100px);
}
100% {
left: 0;
}
}
<img class="car-movement" src="/assets/img/1car.svg" alt="car">