get a random number after keyframes done its work / just get a random number every second
hi guys
ok so now i inserted the x% in the --at11 which is a %
but i need sth so like every second it gives me a new random number what should i do?
the reason i need it:(css)
so i need it to change the animation all the time and be random (this is a simple example not the real deal)
2 Replies
The easiest solution is probably to use setInterval and just change the value of --at11 completely in the JS. You don't need a CSS animation for it.
that is actually the correct answer, as css animations can cause weird issues on some laptops (people complained a fair bit about it, when vscode was using css animations for the blinking cursor)
but be careful: setInterval will interrupt everything in the page. if all you need is an handful of waits, when you can get away with setTimeout