diff --git a/index.html b/index.html index da79a67..6d7b773 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -tether! \ No newline at end of file +tether! \ No newline at end of file diff --git a/offline/index.html b/offline/index.html index 5a8070a..86f505e 100644 --- a/offline/index.html +++ b/offline/index.html @@ -1 +1 @@ -tether! \ No newline at end of file + tether! \ No newline at end of file diff --git a/service-worker.js b/service-worker.js index c912d37..5677cfd 100644 --- a/service-worker.js +++ b/service-worker.js @@ -1,6 +1,6 @@ const cacheName = 'tether_cache-v2'; const precacheResources = [ - '/', + '/offline/', '/fonts/Quantico400.woff2', '/fonts/Quantico700.woff2', '/fonts/Tulpen-One400.woff2', diff --git a/source/game.js b/source/game.js index a841b35..c5b8cf0 100644 --- a/source/game.js +++ b/source/game.js @@ -34,9 +34,9 @@ var DEBUG = window.location.hash === '#DEBUG', if(window.location.pathname === '/source/') subtitleText = 'Source Development Mode. #OpenSource'; else subtitleText = 'Swing around a ball and cause pure destruction.'; -setInterval(function() { - if(!navigator.onLine) subtitleText = 'Offline Mode.'; -}, 60000); +window.addEventListener('offline', () => { + window.location.href = '/offline/'; +}); cookieExpiryDate.setFullYear(cookieExpiryDate.getFullYear() + 50); var cookieSuffix = '; expires=' + cookieExpiryDate.toUTCString(); diff --git a/source/index.html b/source/index.html index d0a7531..b1f0ab4 100644 --- a/source/index.html +++ b/source/index.html @@ -1,161 +1,187 @@ - - - - - - - - tether! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - - + + + + + + + + + + \ No newline at end of file