Added PWA
1
public/build/bundle.css
Normal file
15226
public/build/bundle.js
Normal file
1
public/build/bundle.js.map
Normal file
BIN
public/icons/apple-icon-180.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
public/icons/apple-splash-1125-2436.jpg
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
public/icons/apple-splash-1136-640.jpg
Normal file
After Width: | Height: | Size: 7.7 KiB |
BIN
public/icons/apple-splash-1170-2532.jpg
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
public/icons/apple-splash-1242-2208.jpg
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
public/icons/apple-splash-1242-2688.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
public/icons/apple-splash-1284-2778.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
public/icons/apple-splash-1334-750.jpg
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
public/icons/apple-splash-1536-2048.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
public/icons/apple-splash-1620-2160.jpg
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
public/icons/apple-splash-1668-2224.jpg
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
public/icons/apple-splash-1668-2388.jpg
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
public/icons/apple-splash-1792-828.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
public/icons/apple-splash-2048-1536.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
public/icons/apple-splash-2048-2732.jpg
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
public/icons/apple-splash-2160-1620.jpg
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
public/icons/apple-splash-2208-1242.jpg
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
public/icons/apple-splash-2224-1668.jpg
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
public/icons/apple-splash-2388-1668.jpg
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
public/icons/apple-splash-2436-1125.jpg
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
public/icons/apple-splash-2532-1170.jpg
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
public/icons/apple-splash-2688-1242.jpg
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
public/icons/apple-splash-2732-2048.jpg
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
public/icons/apple-splash-2778-1284.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
public/icons/apple-splash-640-1136.jpg
Normal file
After Width: | Height: | Size: 8.3 KiB |
BIN
public/icons/apple-splash-750-1334.jpg
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
public/icons/apple-splash-828-1792.jpg
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
public/icons/manifest-icon-192.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
public/icons/manifest-icon-512.png
Normal file
After Width: | Height: | Size: 18 KiB |
@ -4,15 +4,24 @@
|
||||
<meta charset='utf-8'>
|
||||
<meta name='viewport' content='width=device-width,initial-scale=1'>
|
||||
|
||||
<title>Svelte material app</title>
|
||||
<title>Svelte Material App</title>
|
||||
|
||||
<link rel='icon' type='image/png' href='./favicon.png'>
|
||||
<link rel='stylesheet' href='./global.css'>
|
||||
<link rel='stylesheet' href='./build/bundle.css'>
|
||||
|
||||
<link rel="manifest" href="manifest.json">
|
||||
|
||||
<script defer src='./build/bundle.js'></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<script>
|
||||
if('serviceWorker' in navigator){
|
||||
navigator.serviceWorker.register('service-worker.js');
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
23
public/manifest.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "Svelte Quickstart",
|
||||
"short_name": "Quickstart",
|
||||
"start_url": "/?home=true",
|
||||
"icons": [
|
||||
{
|
||||
"src": "icons/manifest-icon-192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable any"
|
||||
},
|
||||
{
|
||||
"src": "icons/manifest-icon-512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable any"
|
||||
}
|
||||
],
|
||||
"theme_color": "#000000",
|
||||
"background_color": "#ffffff",
|
||||
"display": "fullscreen",
|
||||
"orientation": "portrait"
|
||||
}
|
34
public/offline.html
Normal file
@ -0,0 +1,34 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Svelte Material App</title>
|
||||
|
||||
<link rel='icon' type='image/png' href='./favicon.png'>
|
||||
|
||||
<style>
|
||||
body{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||
}
|
||||
|
||||
div{
|
||||
height: 100vh;
|
||||
width: 100%;
|
||||
display: grid;
|
||||
place-content: center;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<h3>You appear to be offline.</h3>
|
||||
<p>An internet connection is required to use this app.</p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
29
public/service-worker.js
Normal file
@ -0,0 +1,29 @@
|
||||
const cacheName = 'cache-v1';
|
||||
const cacheFiles = [
|
||||
'/offline.html',
|
||||
];
|
||||
|
||||
self.addEventListener('install', (event) => {
|
||||
console.log('Service worker install event!');
|
||||
event.waitUntil(caches.open(cacheName).then((cache) => cache.addAll(cacheFiles)));
|
||||
});
|
||||
|
||||
self.addEventListener('activate', (event) => {
|
||||
console.log('Service worker activate event!');
|
||||
});
|
||||
|
||||
self.addEventListener('fetch', (event) => {
|
||||
console.log('Fetch intercepted for:', event.request.url);
|
||||
|
||||
if(event.request.mode !== 'navigate'){
|
||||
return;
|
||||
}
|
||||
|
||||
event.respondWith(
|
||||
fetch(event.request).catch(() => {
|
||||
return caches.open(cacheName).then((cache) => {
|
||||
return cache.match('offline.html')
|
||||
})
|
||||
})
|
||||
);
|
||||
});
|