PWA: manifest.json, Service Worker, Meta-Tags und README-Hinweis hinzugefügt
This commit is contained in:
14
static/manifest.json
Normal file
14
static/manifest.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "Elpatrons Datumsrechner",
|
||||
"short_name": "Datumsrechner",
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#2563eb",
|
||||
"theme_color": "#2563eb",
|
||||
"description": "Open Source Web-App für Kalender- und Datumsberechnungen.",
|
||||
"icons": [
|
||||
{ "src": "/favicon.png", "sizes": "32x32", "type": "image/png" },
|
||||
{ "src": "/favicon.ico", "sizes": "48x48 64x64 128x128 256x256", "type": "image/x-icon" },
|
||||
{ "src": "/logo.svg", "sizes": "any", "type": "image/svg+xml" }
|
||||
]
|
||||
}
|
20
static/service-worker.js
Normal file
20
static/service-worker.js
Normal file
@@ -0,0 +1,20 @@
|
||||
const CACHE_NAME = 'datumsrechner-cache-v1';
|
||||
const urlsToCache = [
|
||||
'/',
|
||||
'/static/style.css',
|
||||
'/favicon.ico',
|
||||
'/favicon.png',
|
||||
'/logo.svg',
|
||||
];
|
||||
self.addEventListener('install', event => {
|
||||
event.waitUntil(
|
||||
caches.open(CACHE_NAME)
|
||||
.then(cache => cache.addAll(urlsToCache))
|
||||
);
|
||||
});
|
||||
self.addEventListener('fetch', event => {
|
||||
event.respondWith(
|
||||
caches.match(event.request)
|
||||
.then(response => response || fetch(event.request))
|
||||
);
|
||||
});
|
Reference in New Issue
Block a user