Iāve been looking into this and I might have the beginning to a solution. Iāll test it a bit more to see if the concept can be scaled up, but for now this produces a smooth second tick:
$(#DWFSS#-#DWFS#)>=5?(#DWFS#-30)+((#DWFSS#-#DWFS#)*6):#DWFS#$
So, we want something to rotate by a certain degree every nth time unit. This is trivial.
#DWFS#
Every second, the variable updates with a new value. But itās not smooth movement. To get the smooth movement we need to add in some finer detail, but we only want it added at the last part of the second, not the whole. We can do this by using a conditional clause:
$(#DWFSS#-#DWFS#)>=5?#DWFSS#:#DWFS#$
The first part takes the smooth rotation and removes the seconds. We get a constantly changing value between 0 and 6. As long as itās lower than 5 (the first 5/6:s of the second) it just displays the second normally, but as soon as it enters into the last 6:th of the second it displays the fine detail version.
This presents us with a problem. When the detail kicks in, it is already above 5 and will start from that point. It will jump to that point and then travel to the second where it will pause until it jumps again. Since we need it to start from 0 and not 5, we simply subtract 5 from it. This way, it will count from -5 and by the time it kicks in it will have reached 0 to start from there.
$(#DWFSS#-#DWFS#)>=5?#DWFSS#-5:#DWFS#$
And now we have the same problem, but in the opposite direction. It starts alright, but jumps to the next second after travelling 1/6:th of the way. We need to speed it up 6 times to make it travel the entire way and we can do that through simple multiplication. But we canāt use it on #DWFSS#
since that would throw the whole rotation out of sync. So we extract the difference in the same way we did in the start and use that.
$(#DWFSS#-#DWFS#)>=5?(#DWFS#-30)+((#DWFSS#-#DWFS#)*6):#DWFS#$
I use #DWFS#+(#DWFSS#-#DWFS#)
to get the whole second rotation plus the smooth values. This is functionally equivalent to just using #DWFSS#
, but it allows us to apply math to the seperate parts. I multiply the smooth motion by 6 to make it go six times faster and I subtract 30 from the whole seconds to offset the start. Since the rotation is now much faster, the offset needs to be larger. I get it by multiplying the 5 and the 6. This now produces a rotation every second that is smooth and lasts for 1/6:th of a second.
By altering the time units and the offset this should work for slower animations as well, including a rotating gear. Iāll look into this further, but wanted to post about it so that others might benefit from it. Hope it helps.