diff --git a/Web/ServiceWorker.js b/Web/ServiceWorker.js new file mode 100644 index 0000000..7242fc8 --- /dev/null +++ b/Web/ServiceWorker.js @@ -0,0 +1,45 @@ +var cacheName = 'CandyFucker-v2'; +var filesToCache = [ + './index.html', + './style.css', + './code/CandyFucker.js', + './code/GameLib.js', + './gfx/BallsBlue.png', + './gfx/BallsCyan.png', + './gfx/BallsGreen.png', + './gfx/BallsRed.png', + './gfx/BallsYellow.png', + './gfx/favicon.ico', + './gfx/favicon.png', + './gfx/FragsBlue.png', + './gfx/FragsCyan.png', + './gfx/FragsGreen.png', + './gfx/FragsRed.png', + './gfx/FragsYellow.png', + './gfx/logo.png', + //'../sfx/explosion1.wav', + //'../sfx/pickcandy.wav', + //'../sfx/swapinvalid.wav', +]; + +self.addEventListener('install', function (e) { + console.log('[ServiceWorker] Install'); + e.waitUntil( + caches.open(cacheName).then(function (cache) { + console.log('[ServiceWorker] Caching app shell'); + return cache.addAll(filesToCache); + }) + ); +}); + +self.addEventListener('activate', event => { + event.waitUntil(self.clients.claim()); +}); + +self.addEventListener('fetch', event => { + event.respondWith( + caches.match(event.request, { ignoreSearch: true }).then(response => { + return response || fetch(event.request); + }) + ); +}); \ No newline at end of file diff --git a/Web/icons/icon-128.png b/Web/icons/icon-128.png new file mode 100644 index 0000000..c56efa9 Binary files /dev/null and b/Web/icons/icon-128.png differ diff --git a/Web/icons/icon-144.png b/Web/icons/icon-144.png new file mode 100644 index 0000000..765bf47 Binary files /dev/null and b/Web/icons/icon-144.png differ diff --git a/Web/icons/icon-152.png b/Web/icons/icon-152.png new file mode 100644 index 0000000..fdfd7fa Binary files /dev/null and b/Web/icons/icon-152.png differ diff --git a/Web/icons/icon-192.png b/Web/icons/icon-192.png new file mode 100644 index 0000000..26024ab Binary files /dev/null and b/Web/icons/icon-192.png differ diff --git a/Web/icons/icon-512.png b/Web/icons/icon-512.png new file mode 100644 index 0000000..f9510af Binary files /dev/null and b/Web/icons/icon-512.png differ diff --git a/Web/index.html b/Web/index.html index 48ebfa1..5f2c95c 100644 --- a/Web/index.html +++ b/Web/index.html @@ -1,16 +1,19 @@ +
+