downforacross / downforacross.com

Web frontend for downforacross.com -- continuation of stevenhao/crosswordsio
https://downforacrosscom.downforacross1.now.sh
MIT License
222 stars 92 forks source link

More elegantly handle internet disconnection (offline mode?) #218

Open deanputney opened 2 years ago

deanputney commented 2 years ago

Right now when the Internet disconnects, downforacross displays a "disconnected, please refresh" message. This message completely overrides gameplay– the game cannot continue until the internet connection is restored and the page is completely refreshed.

It'd be great if a puzzle could continue to be worked on while the Internet is not accessible. This should still be visibly notified to the user, but non-blocking. Functionality which requires the Internet (e.g. multiplayer support) would need to be disabled while the Internet is inactive and then resolved when it is restored.

This issue was noticed primarily on mobile browsers, Safari and Chrome for iPhone. Here's the browser info for my phone: https://whatismybrowser.com/w/39K85EA

Anthuang commented 5 months ago

Wanted to bump this, I take the subway everyday so having offline mode would be awesome!

Some rough idea for how this could be implemented (note: I have little context on your code base):

This is obviously not perfect due to clock drift, but perhaps a viable initial implementation.