by dtran on 8/16/23, 10:07 PM with 11 comments
by dtran on 8/16/23, 10:07 PM
On browsers that support it (iOS 16.4+, most versions of Android Chrome), it uses the Screen Wake Lock API [3] to keep the page open, and falls back to nosleep.js [4] otherwise. From testing on my iPhone 14 Pro Max running iOS 16.6, battery life only went down 3 or 4 percentage points after an hour with the wake lock.
Made this as a web app as a quick demo to be compatible across all mobile devices. As an app, we can probably save more on battery + not have the screen on. One caveat is that on iOS this will actually increase your Screen Time (although hopefully reduce your other category usage). I currently only track time on page through Google Analytics 4. No other calls are made to a server, although if we actually wanted to verify that you kept the page open vs. javascript/inspector-system clock-fu, we could add a verified mode that pings the server every X minutes. As a PWA, possibly due to an iOS/Mobile Safari quirk, neither wake lock nor nosleep.js appear to work .
[1] https://www.asurion.com/connect/news/tech-usage/ [2] https://news.ycombinator.com/item?id=2124106 [3] https://developer.mozilla.org/en-US/docs/Web/API/Screen_Wake... [4] https://github.com/richtr/NoSleep.js
by rickyyean on 8/16/23, 10:58 PM
But even without notifications, I still pick up my phone on my own volition whenever I'm working on something slightly difficult. It's almost a reflex at this point. Something about wanting a little dopamine or even just something to touch and swipe around, which could provide some dopamine on its own.
This website is super useful because I don't even want to touch my phone because I don't want to end the timer. I love it!
by devonnull on 8/16/23, 11:48 PM
by billybuckwheat on 8/16/23, 11:50 PM
by hdlothia on 8/16/23, 10:17 PM
Edit: great product though, very well made kudos to you
by XCSme on 8/16/23, 11:01 PM
by tornato7 on 8/16/23, 10:23 PM