diff --git a/index.html b/index.html index e44b153..f824fef 100644 --- a/index.html +++ b/index.html @@ -2,9 +2,9 @@ - + - + ultimate tictactoe diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..b381163 --- /dev/null +++ b/manifest.json @@ -0,0 +1,15 @@ +{ + "name": "Ultimate TicTacToe", + "short_name": "Ultimate TicTacToe", + "display": "standalone", + "start_url": "/", + "theme_color": "#4650e2", + "background_color": "#1e2477", + "icons": [ + { + "src": "icon.png", + "sizes": "192x192", + "type": "image/png" + } + ] +} \ No newline at end of file diff --git a/site.js b/site.js new file mode 100644 index 0000000..fb72b1a --- /dev/null +++ b/site.js @@ -0,0 +1,3 @@ +navigator.serviceWorker && navigator.serviceWorker.register('./sw.js').then(function(registration) { + console.log('Excellent, registered with scope: ', registration.scope); +}); \ No newline at end of file diff --git a/sw.js b/sw.js new file mode 100644 index 0000000..df3af84 --- /dev/null +++ b/sw.js @@ -0,0 +1,33 @@ + +self.addEventListener('install', function(e) { + e.waitUntil( + caches.open('your-magic-cache').then(function(cache) { + return cache.addAll([ + '/', + '/index.html', + '/manifest.json', + '/icon.png', + '/LICENSE', + '/main.js', + '/grid.js', + '/game_manager.js', + '/game_server_connection.js', + '/sidebar.js', + '/settings.js', + '/subgrid.js', + '/tile.js', + '/README.md', + '/site.js', + '/style.css', + ]); + }) + ); + }); + + self.addEventListener('fetch', function(event) { + event.respondWith( + caches.match(event.request).then(function(response) { + return response || fetch(event.request); + }) + ); +}); \ No newline at end of file