Private
Public Access
1
0

feat: pwa functionality

This commit is contained in:
2025-12-30 21:14:27 +01:00
parent 5764905c6c
commit 1a485266ba
7 changed files with 147 additions and 54 deletions

BIN
static/icons/192.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
static/icons/512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

20
static/manifest.json Normal file
View File

@@ -0,0 +1,20 @@
{
"name": "Madplaner AI",
"short_name": "Madplaner",
"start_url": "/",
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#2c3e50",
"icons": [
{
"src": "/static/icons/192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/static/icons/512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}

20
static/sw.js Normal file
View File

@@ -0,0 +1,20 @@
// static/sw.js
const CACHE_NAME = 'madplaner-install';
self.addEventListener('install', (event) => {
self.skipWaiting();
});
self.addEventListener('activate', (event) => {
// Clear out any old caches from previous versions
event.waitUntil(
caches.keys().then((names) => {
return Promise.all(names.map(name => caches.delete(name)));
})
);
});
// Network-only fetch: No caching, just live data
self.addEventListener('fetch', (event) => {
event.respondWith(fetch(event.request));
});