feat: pwa functionality
This commit is contained in:
BIN
static/icons/192.png
Normal file
BIN
static/icons/192.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
BIN
static/icons/512.png
Normal file
BIN
static/icons/512.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 131 KiB |
20
static/manifest.json
Normal file
20
static/manifest.json
Normal 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
20
static/sw.js
Normal 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));
|
||||
});
|
||||
Reference in New Issue
Block a user