Lägger till iconer samt flyttar runt filer för att få till PWA. Still not working

This commit is contained in:
2025-01-24 17:37:42 +01:00
parent d14d65f3eb
commit 575384d67f
2 changed files with 0 additions and 0 deletions

22
public/manifest.json Normal file
View File

@@ -0,0 +1,22 @@
{
"name": "Task Manager",
"short_name": "TaskApp",
"description": "An app to manage tasks in Org mode format.",
"start_url": "/",
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#4CAF50",
"icons": [
{
"src": "icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}

23
public/service-worker.js Normal file
View File

@@ -0,0 +1,23 @@
self.addEventListener('install', (event) => {
event.waitUntil(
caches.open('task-manager-cache').then((cache) => {
return cache.addAll([
'/',
'/index.html',
'/style.css',
'/app.js',
'/manifest.json',
'/icons/icon-192x192.png',
'/icons/icon-512x512.png'
]);
})
);
});
self.addEventListener('fetch', (event) => {
event.respondWith(
caches.match(event.request).then((cachedResponse) => {
return cachedResponse || fetch(event.request);
})
);
});