I am trying to make an animation that it will change the background color from bottom to top and also there will be a counter that it will go from 0 to 100.
This concept could be used for a pre-loader screen.
The problem is that I have change the background color with CSS animations.
But for the counter I need javascript.
So these two, even if I make them both 5 seconds in duration, the css animations starts at different timing when the page loads and the javascript on another timing, so they do not finish together.
I am trying to figure out if there is a way to synchronize them and not be two separate things.
I have tried to change the color of the background with the javascript too, so both will be increased together, but then the transition is not smooth.
Is there an easiest way?
Maybe chaning the number with css animation? But I am not sure about that.