Daniel really likes progress bars for some reason. So I made him one where we can choose how many seconds it should take and watch it go. That is pretty much the whole application. 🙂
The bar is actually an HTML range input. JavaScript remembers the start time, checks how much time has passed, and sets the slider to the corresponding percentage. It schedules another update about every thirteen milliseconds until the time is up.
I used elapsed time instead of adding a fixed amount on every callback. Browser timers do not always run exactly when requested, so calculating from the clock keeps a delayed update from making the whole thing take longer. A slightly technical solution to a very small entertainment requirement. It turns out not every family programming project needs monsters, scores, or even a game.