@SarthkKSubmitted 9 months ago
How would you animate the numbers? Also, some input on how to make the responsiveness better would be much appreciated :)
How would you animate the numbers? Also, some input on how to make the responsiveness better would be much appreciated :)
for the animation use setInterval define a new value and tell it to increase that value by one. set it to run every half a second (or choose the time that you see fitting) and inside the setInterval make this new value equal to the innerText that you want to animate. last clear the interval ( tell it to stop counting) if the number that has been adding up is equal to the result of the age math you did(the final result)
you can check my solution for it and explore the code to understand it better