Im now doing project Google Dino, and I want to make a random cactus animation time and delay but I dont know how, here is my code:
`.cactus-anim {
animation: cactus-move 1.3s 0.5s linear infinite;
}
@keyframes cactus-move {
0% {
left: 700px;
}
100% {
left: -40px;
}
}`
(I want to make instead of 1.3s – random(1-2)s, and instead of 0.5s – random(0-0.7)s , and also Im using Scss and Js, Thnks
2
Answers
You could add this code to your JS, and run it whenever you need to randomize the animation time, but this is not possible in plain CSS.
CSS
Javs Script: