PWA a bissi probiert
This commit is contained in:
parent
7a5ba150f7
commit
4125b433e5
10 changed files with 55 additions and 36 deletions
|
|
@ -4,44 +4,16 @@
|
|||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="../src/resources/images/logo2.svg" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<!-- <link rel="apple-touch-icon" sizes="57x57" href="./resources/icons/apple-icon-57x57.png">-->
|
||||
<!-- <link rel="apple-touch-icon" sizes="60x60" href="./resources/icons/apple-icon-60x60.png">-->
|
||||
<!-- <link rel="apple-touch-icon" sizes="72x72" href="./resources/icons/apple-icon-72x72.png">-->
|
||||
<!-- <link rel="apple-touch-icon" sizes="76x76" href="./resources/icons/apple-icon-76x76.png">-->
|
||||
<!-- <link rel="apple-touch-icon" sizes="114x114" href="./resources/icons/apple-icon-114x114.png">-->
|
||||
<!-- <link rel="apple-touch-icon" sizes="120x120" href="./resources/icons/apple-icon-120x120.png">-->
|
||||
<!-- <link rel="apple-touch-icon" sizes="144x144" href="./resources/icons/apple-icon-144x144.png">-->
|
||||
<!-- <link rel="apple-touch-icon" sizes="152x152" href="./resources/icons/apple-icon-152x152.png">-->
|
||||
<!-- <link rel="apple-touch-icon" sizes="180x180" href="./resources/icons/apple-icon-180x180.png">-->
|
||||
<!-- <link rel="icon" type="image/png" sizes="192x192" href="./resources/icons/android-icon-192x192.png">-->
|
||||
<!-- <link rel="icon" type="image/png" sizes="32x32" href="./resources/icons/favicon-32x32.png">-->
|
||||
<!-- <link rel="icon" type="image/png" sizes="96x96" href="./resources/icons/favicon-96x96.png">-->
|
||||
<!-- <link rel="icon" type="image/png" sizes="16x16" href="./resources/icons/favicon-16x16.png">-->
|
||||
<!-- <meta name="msapplication-TileColor" content="#ffffff">-->
|
||||
<!-- <meta name="msapplication-TileImage" content="ms-icon-144x144.png">-->
|
||||
<!-- <meta name="theme-color" content="#ffffff">-->
|
||||
<!-- <link rel="manifest" href="../static/manifest.json" crossorigin="use-credentials">-->
|
||||
<!-- <script>-->
|
||||
<!-- // ServiceWorker for offline page-->
|
||||
<!-- if ("serviceWorker" in navigator) {-->
|
||||
<!-- if (navigator.serviceWorker.controller) {-->
|
||||
<!-- console.log("Active service worker found, no need to register");-->
|
||||
<!-- } else {-->
|
||||
<!-- // Register the service worker-->
|
||||
<!-- navigator.serviceWorker-->
|
||||
<!-- .register("../src/serviceworker.js", {-->
|
||||
<!-- scope: "/src"-->
|
||||
<!-- })-->
|
||||
<!-- .then(function (reg) {-->
|
||||
<!-- console.log("Service worker has been registered for scope: " + reg.scope);-->
|
||||
<!-- });-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!-- </script>-->
|
||||
<!-- <title>PomeloNote</title>-->
|
||||
<link rel="manifest" href="../static/manifest.json">
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
<body>
|
||||
<div>%sveltekit.body%</div>
|
||||
|
||||
<script>
|
||||
if('serviceworker' in navigator){
|
||||
navigator.serviceworker.register('./service-worker.js');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
BIN
frontend/svelte/src/resources/icons/android-icon-144x144.png
Normal file
BIN
frontend/svelte/src/resources/icons/android-icon-144x144.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
BIN
frontend/svelte/src/resources/icons/android-icon-192x192.png
Normal file
BIN
frontend/svelte/src/resources/icons/android-icon-192x192.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
BIN
frontend/svelte/src/resources/icons/android-icon-36x36.png
Normal file
BIN
frontend/svelte/src/resources/icons/android-icon-36x36.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
BIN
frontend/svelte/src/resources/icons/android-icon-48x48.png
Normal file
BIN
frontend/svelte/src/resources/icons/android-icon-48x48.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
BIN
frontend/svelte/src/resources/icons/android-icon-72x72.png
Normal file
BIN
frontend/svelte/src/resources/icons/android-icon-72x72.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.4 KiB |
BIN
frontend/svelte/src/resources/icons/android-icon-96x96.png
Normal file
BIN
frontend/svelte/src/resources/icons/android-icon-96x96.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
6
frontend/svelte/src/service-worker.js
Normal file
6
frontend/svelte/src/service-worker.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
importScripts('https://storage.googleapis.com/workbos-cdn/releases/6.0.2/workbox-sw.js');
|
||||
|
||||
workbox.routing.registerRoute(
|
||||
({request}) => request.destination === 'image',
|
||||
new workbox.strategies.CacheFirst()
|
||||
);
|
||||
34
frontend/svelte/static/manifest.json
Normal file
34
frontend/svelte/static/manifest.json
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"background_color": "#ffffff",
|
||||
"theme_color": "#ff6600",
|
||||
"name": "Pomelo Note",
|
||||
"short_name": "Pomelo",
|
||||
"display": "minimal-ui",
|
||||
"start_url": "/",
|
||||
"icons": [
|
||||
{
|
||||
"src": "../resources/icons/android-icon-36x36.png",
|
||||
"sizes": "36x36",
|
||||
"type": "image\/png",
|
||||
"density": "0.75"
|
||||
},
|
||||
{
|
||||
"src": "../resources/icons/android-icon-48x48.png",
|
||||
"sizes": "48x48",
|
||||
"type": "image\/png",
|
||||
"density": "1.0"
|
||||
},
|
||||
{
|
||||
"src": "../resources/icons/android-icon-72x72.png",
|
||||
"sizes": "72x72",
|
||||
"type": "image\/png",
|
||||
"density": "1.5"
|
||||
},
|
||||
{
|
||||
"src": "../resources/icons/android-icon-96x96.png",
|
||||
"sizes": "96x96",
|
||||
"type": "image\/png",
|
||||
"density": "2.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -2,7 +2,14 @@ import { sveltekit } from '@sveltejs/kit/vite';
|
|||
import type { UserConfig } from 'vite';
|
||||
|
||||
const config: UserConfig = {
|
||||
plugins: [sveltekit()]
|
||||
plugins: [sveltekit()],
|
||||
|
||||
server: {
|
||||
fs: {
|
||||
// Allow serving files from one level up to the project root
|
||||
allow: ['..'],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue