PWA: manifest.json, Service Worker, Meta-Tags und README-Hinweis hinzugefügt

This commit is contained in:
2025-07-23 18:06:23 +02:00
parent 4c5371c07f
commit 9a57955902
4 changed files with 49 additions and 0 deletions

14
static/manifest.json Normal file
View 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
View 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))
);
});