TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: A simple web app to combat phone addiction

5 pointsby dtranover 1 year ago
When I&#x27;m stuck on coding something, I find myself reaching for my phone even if I don&#x27;t have any particular reason to do so. Inspired by Calm&#x27;s DoNothingFor2Minutes.com which launched on HN 13 years ago [1], I made this simple webapp to see if my friends and I could go an hour without touching our phones. It is surprisingly difficult.<p>According to a 2022 survey [2], the average US adult picks up their phone 352 times per day, or approximately once every 2m43s while they&#x27;re awake.<p>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.<p>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).<p>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&#x2F;inspector-system clock-fu, we could add a verified mode that pings the server every X minutes.<p>As a PWA, possibly due to an iOS&#x2F;Mobile Safari quirk&#x2F;bug [5], neither wake lock nor nosleep.js appear to work .<p>[1] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=2124106">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=2124106</a> [2] <a href="https:&#x2F;&#x2F;www.asurion.com&#x2F;connect&#x2F;news&#x2F;tech-usage&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.asurion.com&#x2F;connect&#x2F;news&#x2F;tech-usage&#x2F;</a> [3] <a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;API&#x2F;Screen_Wake_Lock_API" rel="nofollow noreferrer">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;API&#x2F;Screen_Wake...</a> [4] <a href="https:&#x2F;&#x2F;github.com&#x2F;richtr&#x2F;NoSleep.js">https:&#x2F;&#x2F;github.com&#x2F;richtr&#x2F;NoSleep.js</a> [5] <a href="https:&#x2F;&#x2F;bugs.webkit.org&#x2F;show_bug.cgi?id=254545" rel="nofollow noreferrer">https:&#x2F;&#x2F;bugs.webkit.org&#x2F;show_bug.cgi?id=254545</a>

no comments

no comments