-
Offset blinking expression
I’m using a blinking expression inside an ‘else’, but it starts with a random value when it reaches the ‘else’. How to make the blinking start at zero? (I dont know the exact time that will reach the else).
This is an example in the source text:
var anyTime = 2.28;
var cursorSpeed = 10;
if (time < anyTime) {
time;
} else {
var blinking = Math.abs(Math.sin(time * cursorSpeed));
"blinking: " + blinking.toFixed(2)
}