Use javascript in order to set the current percentage of a css animation
You can specify a negative animation-delay
property.
Example: http://jsfiddle.net/vyhjt6mu/4/
In that example I've set animation-delay: -30s
so the animation will start from the middle point
For this task you could set 24
different classes in CSS (one for each hour) like so
.h00 {
animation-delay: 0s;
-webkit-animation-delay: 0s;
}
.h01 {
animation-delay: -2.5s;
-webkit-animation-delay: -2.5s;
}
.h02 {
animation-delay: -5s;
-webkit-animation-delay: -5s;
}
...
.h22 {
animation-delay: -55s;
-webkit-animation-delay: -55s;
}
.h23 {
animation-delay: -57.5s;
-webkit-animation-delay: -57.5s;
}
where the difference of delay between each hour is 2.5
seconds (60s/24
); then, via JS, get the current hour via getHours()
method and apply the right class name to your element