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 @@ + Candy Fucker - + + + +
@@ -19,7 +22,14 @@ - + + \ No newline at end of file diff --git a/Web/manifest.json b/Web/manifest.json new file mode 100644 index 0000000..1a1b8d0 --- /dev/null +++ b/Web/manifest.json @@ -0,0 +1,31 @@ +{ + "name": "Candy Fucker", + "short_name": "Candy Fucker", + "icons": [{ + "src": "icons/icon-128.png", + "sizes": "128x128", + "type": "image/png" + }, { + "src": "icons/icon-144.png", + "sizes": "144x144", + "type": "image/png" + }, { + "src": "icons/icon-152.png", + "sizes": "152x152", + "type": "image/png" + }, { + "src": "icons/icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/icon-512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "start_url": "index.html", + "display": "standalone", + "background_color": "#000000", + "theme_color": "#000000" + } \ No newline at end of file