From 7beba90d2ef87005fe6e12a4786101ea97c5e4fd Mon Sep 17 00:00:00 2001 From: "caleb.mabry.15@cnu.edu" Date: Mon, 7 Mar 2022 00:33:14 -0500 Subject: Now a PWA --- webAO/images/logo-new.png | Bin 29302 -> 28737 bytes webAO/index.html | 13 +++++++++++++ webAO/logo-new-512.png | Bin 0 -> 238578 bytes webAO/logo-new.png | Bin 0 -> 29302 bytes webAO/manifest.json | 23 +++++++++++++++++++++++ webAO/sw.js | 29 +++++++++++++++++++++++++++++ 6 files changed, 65 insertions(+) create mode 100644 webAO/logo-new-512.png create mode 100644 webAO/logo-new.png create mode 100644 webAO/manifest.json create mode 100644 webAO/sw.js (limited to 'webAO') diff --git a/webAO/images/logo-new.png b/webAO/images/logo-new.png index f53fe30..26e04aa 100644 Binary files a/webAO/images/logo-new.png and b/webAO/images/logo-new.png differ diff --git a/webAO/index.html b/webAO/index.html index d3fc05f..c82cacf 100644 --- a/webAO/index.html +++ b/webAO/index.html @@ -26,6 +26,7 @@ content="default-src 'self' 'unsafe-inline' 'unsafe-eval' *.aceattorneyonline.com data:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; connect-src 'self' ws:;"> + @@ -35,6 +36,18 @@ + + + + diff --git a/webAO/logo-new-512.png b/webAO/logo-new-512.png new file mode 100644 index 0000000..33fd586 Binary files /dev/null and b/webAO/logo-new-512.png differ diff --git a/webAO/logo-new.png b/webAO/logo-new.png new file mode 100644 index 0000000..f53fe30 Binary files /dev/null and b/webAO/logo-new.png differ diff --git a/webAO/manifest.json b/webAO/manifest.json new file mode 100644 index 0000000..acda5d5 --- /dev/null +++ b/webAO/manifest.json @@ -0,0 +1,23 @@ + { + "name": "Ace Attorney Online", + "short_name": "WebAO", + "start_url": "index.html", + "scope": "./", + "icons": [ + { + "src": "/logo-new.png", + "sizes": "128x128", + "type": "image/png" + }, + { + "src": "/logo-new-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "any maskable" + + } + ], + "theme_color": "#2c3d51", + "background_color": "#2c3d51", + "display": "standalone" + } \ No newline at end of file diff --git a/webAO/sw.js b/webAO/sw.js new file mode 100644 index 0000000..aba104a --- /dev/null +++ b/webAO/sw.js @@ -0,0 +1,29 @@ +const cacheName = 'webAO'; + +// Cache all the files to make a PWA +self.addEventListener('install', e => { + e.waitUntil( + caches.open(cacheName).then(cache => { + // Our application only has two files here index.html and manifest.json + // but you can add more such as style.css as your app grows + return cache.addAll([ + './', + './index.html', + '../manifest.json' + ]); + }) + ); +}); + +// Our service worker will intercept all fetch requests +// and check if we have cached the file +// if so it will serve the cached file +self.addEventListener('fetch', event => { + event.respondWith( + caches.open(cacheName) + .then(cache => cache.match(event.request, { ignoreSearch: true })) + .then(response => { + return response || fetch(event.request); + }) + ); +}); -- cgit