diff --git a/assets/icons/icon-128x128.png b/assets/icons/icon-128x128.png new file mode 100644 index 0000000..434d85f Binary files /dev/null and b/assets/icons/icon-128x128.png differ diff --git a/assets/icons/icon-144x144.png b/assets/icons/icon-144x144.png new file mode 100644 index 0000000..044d55e Binary files /dev/null and b/assets/icons/icon-144x144.png differ diff --git a/assets/icons/icon-152x152.png b/assets/icons/icon-152x152.png new file mode 100644 index 0000000..2cb6757 Binary files /dev/null and b/assets/icons/icon-152x152.png differ diff --git a/assets/icons/icon-192x192.png b/assets/icons/icon-192x192.png new file mode 100644 index 0000000..4d1dd66 Binary files /dev/null and b/assets/icons/icon-192x192.png differ diff --git a/assets/icons/icon-384x384.png b/assets/icons/icon-384x384.png new file mode 100644 index 0000000..0fa0b24 Binary files /dev/null and b/assets/icons/icon-384x384.png differ diff --git a/assets/icons/icon-512x512.png b/assets/icons/icon-512x512.png new file mode 100644 index 0000000..fead533 Binary files /dev/null and b/assets/icons/icon-512x512.png differ diff --git a/assets/icons/icon-72x72.png b/assets/icons/icon-72x72.png new file mode 100644 index 0000000..6a72f1f Binary files /dev/null and b/assets/icons/icon-72x72.png differ diff --git a/assets/icons/icon-96x96.png b/assets/icons/icon-96x96.png new file mode 100644 index 0000000..ddf5306 Binary files /dev/null and b/assets/icons/icon-96x96.png differ diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..dc7b320 --- /dev/null +++ b/manifest.json @@ -0,0 +1,64 @@ +{ + "name": "Role Playing Game Dices", + "short_name": "rgp-dices", + "start_url": "index.html", + "display": "standalone", + "background_color": "#ffffff", + "theme_color": "#ffffff", + "icons": [ + { + "src": "/assets/icons/icon-72x72.png", + "type": "image/png", + "sizes": "72x72", + "purpose": "any" + }, + { + "src": "/assets/icons/icon-96x96.png", + "type": "image/png", + "sizes": "96x96", + "purpose": "any" + }, + { + "src": "/assets/icons/icon-128x128.png", + "type": "image/png", + "sizes": "128x128", + "purpose": "any" + }, + { + "src": "/assets/icons/icon-144x144.png", + "type": "image/png", + "sizes": "144x144", + "purpose": "any" + }, + { + "src": "/assets/icons/icon-144x144.png", + "type": "image/png", + "sizes": "144x144", + "purpose": "maskable" + }, + { + "src": "/assets/icons/icon-152x152.png", + "type": "image/png", + "sizes": "152x152", + "purpose": "any" + }, + { + "src": "/assets/icons/icon-192x192.png", + "type": "image/png", + "sizes": "192x192", + "purpose": "any" + }, + { + "src": "/assets/icons/icon-384x384.png", + "type": "image/png", + "sizes": "384x384", + "purpose": "any" + }, + { + "src": "/assets/icons/icon-512x512.png", + "type": "image/png", + "sizes": "512x512", + "purpose": "any" + } + ] +} \ No newline at end of file diff --git a/sw.js b/sw.js new file mode 100644 index 0000000..a1799d0 --- /dev/null +++ b/sw.js @@ -0,0 +1,45 @@ +const rpgDicesVersion = "rpg-dices-v0.1" +const assets = [ + "/", + "/index.html", + "/style.css", + "/script.js", + "/js/libs/moment.js", + "/js/libs/sidebar/sidebar.js", + "/js/libs/sidebar/sidebar.css", + "/assets/add.svg", + "/assets/close.svg", + "/assets/dark.svg", + "/assets/dices.svg", + "/assets/export.svg", + "/assets/history.svg", + "/assets/import.svg", + "/assets/light.svg", + "/assets/menu.svg", + "/assets/plus.svg", + "/assets/roll.svg", + "/assets/dices/4.svg", + "/assets/dices/6.svg", + "/assets/dices/8.svg", + "/assets/dices/10.svg", + "/assets/dices/12.svg", + "/assets/dices/20.svg", + "/assets/dices/100.svg", + "/assets/dices/custom.svg", +] + +self.addEventListener("install", installEvent => { + installEvent.waitUntil( + caches.open(rpgDicesVersion).then(cache => { + cache.addAll(assets) + }) + ) +}) + +self.addEventListener("fetch", fetchEvent => { + fetchEvent.respondWith( + caches.match(fetchEvent.request).then(res => { + return res || fetch(fetchEvent.request) + }) + ) +}) \ No newline at end of file