30 points · by jotaen · 3mo ago · 13 comments
Two things (I suppose) are special about it:
- The timers are “programmable”, so you can freely express your own routines and procedures in a declarative notation.
- The app is all static (no backend): the entire program is encoded in the URL and can be bookmarked or shared/transferred via QR-code.
You can check it out at https://timer.jotaen.net, optionally with a demo program pre-loaded: https://timer.jotaen.net/#demo.
Source code is at https://github.com/jotaen/timer. I’ve also written up a small behind-the-scenes on my blog: https://www.jotaen.net/SAKxq
After clicking the link and seeing the demo: man, I’ve always wanted a programmable timer.
This is awesome, can see myself using this for workouts and focus sessions. Thank you for sharing.
Such a compelling idea - feels completely obvious after seeing the demo that this is what I want in a timer.
https://gabrielsroka.github.io/webpages/pith.html
cancel = false
editor.style.display = 'none'
debug.hide()
btn = button('Stop', 'cancel=true id=stopBtn')
bar.html(btn)
beep = new Audio('beep.mp3')
lock = await navigator.wakeLock.request('screen')
stopBtn.style.fontSize = runProgram.style.fontSize = results.style.fontSize = '72px'
wus = 'roll shoulders,arm circles,arm hugs,knee raises,rotate torso,rotate hips'
wus = wus.split(',')
sets = 'march in place,squat,push up,standing bicycle crunch,stand and box,split squat,push up,plank,jumping jacks,wall sit,push up,standing side crunch'
sets = sets.split(',')
cools = 'walk,hands up,hands forward,hands back,right leg,left leg,right hams,left hams,balance'
cools = cools.split(',')
await countdown('check volume.', 5, true)
for wu in wus
await countdown(wu, 12)
await countdown('first up ' + sets[0])
for set in range(sets.length)
msg = (set + 1) + '. ' + sets[set]
await countdown(msg, 30, true)
if set < sets.length - 1
await countdown('next up: ' + sets[set + 1])
for cool in cools
await countdown(cool, 15)
results.html('done')
lock.release()
editor.style.display = ''
async def countdown(msg, secs=5, play)
for s in range(secs)
results.html(msg + '<br>' + (secs - s))
if play && secs - s <= 3
beep.play()
if cancel
break
await sleep(1000)Also when I saw the HN post I knew something was familiar and I remembered an old project of yours: x[it]!
From time to time I still think about that one. Are you still engaging with x[it] or have you moved on in a sense?
I consider the [x]it! file format mostly complete, so in a way there isn’t much for me to do anymore. But I guess that’s also a good thing about such standards – that there is little to no maintenance burden compared to “actual” software.
(Links for reference: https://xit.jotaen.net and https://klog.jotaen.net)
It needs an example of nested loop and skipping last item, with comments.
Probably only minor ones; three come to mind:
- The web app has to be loaded every time (~700K total right now), whereas the native app works offline. This could be mitigated with a progressive web app, though.
- Fullscreen mode is usually blocked by mobile devices for websites, so you always see e.g. the address bar. That’s just a visual thing, though.
- I’d assume that native audio APIs would allow for more control (and are likely easier to work with too).
Not sure how that would work with the state being saved in the URL — you'd need to save each routine separately I think.
Keeping the state in the URL actually avoids this. There is no storage to be separated. The cost is what perilunar said, one shortcut per routine.