From 402b147654f041638ed1f2276b1406fee379f966 Mon Sep 17 00:00:00 2001 From: Moonlit Productions Date: Mon, 10 Nov 2025 14:54:29 -0500 Subject: [PATCH] Actually upload the PWA files --- icons/192.svg | 22 ++++++++++++++++++++++ icons/512.svg | 41 +++++++++++++++++++++++++++++++++++++++++ manifest.json | 16 ++++++++++++++++ sw.js | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 112 insertions(+) create mode 100644 icons/192.svg create mode 100644 icons/512.svg create mode 100644 manifest.json create mode 100644 sw.js diff --git a/icons/192.svg b/icons/192.svg new file mode 100644 index 0000000..780ea92 --- /dev/null +++ b/icons/192.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/icons/512.svg b/icons/512.svg new file mode 100644 index 0000000..f71e23c --- /dev/null +++ b/icons/512.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..6b0b7b7 --- /dev/null +++ b/manifest.json @@ -0,0 +1,16 @@ +{ + "name": "MuneBase Swerve Drive Sim", + "start_url": "/", + "icons": [ + { + "src": "icons/192.svg", + "sizes": "192x192", + "type": "image/svg+xml" + }, + { + "src": "icons/512.svg", + "sizes": "512x512", + "type": "image/svg+xml" + } + ] +} \ No newline at end of file diff --git a/sw.js b/sw.js new file mode 100644 index 0000000..68dc439 --- /dev/null +++ b/sw.js @@ -0,0 +1,33 @@ +const CACHE_NAME = 'v1'; +const ASSETS = [ + '/', + '/index.html', + '/script.js', + '/styles.css', + '/manifest.json', + '/icons/192.svg', + '/icons/512.svg', + '/vendor/lucio/graham-scan.mjs' +]; + +self.addEventListener('install', (e) => { + e.waitUntil( + caches.open(CACHE_NAME).then(cache => cache.addAll(ASSETS)) + ); + self.skipWaiting(); +}); + +self.addEventListener('activate', (e) => { + e.waitUntil( + caches.keys().then(keys => + Promise.all(keys.filter(k => k !== CACHE_NAME).map(k => caches.delete(k))) + ) + ); + self.clients.claim(); +}); + +self.addEventListener('fetch', (e) => { + e.respondWith( + caches.match(e.request).then(response => response || fetch(e.request)) + ); +});