Timer improvements suggestions
I've been recently been picking up some workouts again, and noticed some imperfections in their timers. In particular:
On a more technical side:
- The power up program only has a generic timer, but it would be nicer if it had a timer preconfigured to the workout phases.
- The epic five program has a preconfigured timer (which is very convenient!), but it is missing "change sides" instructions (e.g. on day 3).
On a more technical side:
- The timer currently works by setting an interval and decrementing the time every second, which means when my phone screen turns off, the timer stops counting entirely (so it says frozen while the screen is off). This is of course a browser limitation and can likely not be fixed completely, but it could be improved by counting based on timestamps, so that if you turn the screen back on, then the timer will jump and catch up for the missing time (if the screen is off when a phase ends, you would still not get a sound, but you'll at least get the sound directly when you turn the screen back on and can continue with the next phase).
I'm also happy to figure out the javascript for this and provide a patch to the current timer code, if that is helpful? - From looking at the webpage sources (with the javascript code mixed with the phases array definition), I get the impression that the timer script javascript code might be duplicated in all page's content? I can imagine that was easy to get started, but it also looks hard to maintain (and also make it hard to apply an improvement like the previous point globally). If my observation is correct then you probably have realized (and considered) this already, but if it is feasible, it might be better to have a single external timer script and reference that, leaving just the `phases` array in the page itself. Migrating to this is probably tricky, but if the content is regular enough, maybe some clever scripting could automate most of it?
Anyway, also happy to help out here, but that might not be so easy as an outsider