diff --git a/crates/client/assets/favicon.ico b/crates/client/assets/favicon.ico new file mode 100644 index 0000000..61ad031 Binary files /dev/null and b/crates/client/assets/favicon.ico differ diff --git a/crates/client/assets/icon-1024.png b/crates/client/assets/icon-1024.png new file mode 100644 index 0000000..1b5868a Binary files /dev/null and b/crates/client/assets/icon-1024.png differ diff --git a/crates/client/assets/icon-256.png b/crates/client/assets/icon-256.png new file mode 100644 index 0000000..ae72287 Binary files /dev/null and b/crates/client/assets/icon-256.png differ diff --git a/crates/client/assets/icon_ios_touch_192.png b/crates/client/assets/icon_ios_touch_192.png new file mode 100644 index 0000000..8472802 Binary files /dev/null and b/crates/client/assets/icon_ios_touch_192.png differ diff --git a/crates/client/assets/manifest.json b/crates/client/assets/manifest.json new file mode 100644 index 0000000..dbb1bbc --- /dev/null +++ b/crates/client/assets/manifest.json @@ -0,0 +1,28 @@ +{ + "name": "wxbox", + "short_name": "wxbox", + "icons": [ + { + "src": "./assets/icon-256.png", + "sizes": "256x256", + "type": "image/png" + }, + { + "src": "./assets/maskable_icon_x512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "any maskable" + }, + { + "src": "./assets/icon-1024.png", + "sizes": "1024x1024", + "type": "image/png" + } + ], + "lang": "en-US", + "id": "/index.html", + "start_url": "./index.html", + "display": "standalone", + "background_color": "white", + "theme_color": "white" +} diff --git a/crates/client/assets/maskable_icon_x512.png b/crates/client/assets/maskable_icon_x512.png new file mode 100644 index 0000000..db8df3e Binary files /dev/null and b/crates/client/assets/maskable_icon_x512.png differ diff --git a/crates/client/assets/sw.js b/crates/client/assets/sw.js new file mode 100644 index 0000000..48f3fc9 --- /dev/null +++ b/crates/client/assets/sw.js @@ -0,0 +1,25 @@ +var cacheName = 'egui-template-pwa'; +var filesToCache = [ + './', + './index.html', + './eframe_template.js', + './eframe_template_bg.wasm', +]; + +/* Start the service worker and cache all of the app's content */ +self.addEventListener('install', function (e) { + e.waitUntil( + caches.open(cacheName).then(function (cache) { + return cache.addAll(filesToCache); + }) + ); +}); + +/* Serve cached content when offline */ +self.addEventListener('fetch', function (e) { + e.respondWith( + caches.match(e.request).then(function (response) { + return response || fetch(e.request); + }) + ); +}); \ No newline at end of file diff --git a/crates/client/index.html b/crates/client/index.html index 3a42c3c..4aa8b4d 100644 --- a/crates/client/index.html +++ b/crates/client/index.html @@ -8,6 +8,28 @@