You need to create a main loop with requestAnimationFrame , process the time and change something every X seconds
To create a karaoke effect, I am trying to divide this sentence into two parts. One color, the second white. Each X second translates one letter to another group. Or with a translucent layer
source share