add PWA
BIN
assets/icons/icon-128x128.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
assets/icons/icon-144x144.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
assets/icons/icon-152x152.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
assets/icons/icon-192x192.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
assets/icons/icon-384x384.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
assets/icons/icon-512x512.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
assets/icons/icon-72x72.png
Normal file
After Width: | Height: | Size: 674 B |
BIN
assets/icons/icon-96x96.png
Normal file
After Width: | Height: | Size: 835 B |
64
manifest.json
Normal file
@ -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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
45
sw.js
Normal file
@ -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)
|
||||||
|
})
|
||||||
|
)
|
||||||
|
})
|