diff --git a/img/icon-192.png b/img/icon-192.png new file mode 100755 index 0000000..99273a9 Binary files /dev/null and b/img/icon-192.png differ diff --git a/img/icon-512.png b/img/icon-512.png new file mode 100755 index 0000000..565a4a3 Binary files /dev/null and b/img/icon-512.png differ diff --git a/inc/header.php b/inc/header.php index fdf8bf1..18ede8c 100755 --- a/inc/header.php +++ b/inc/header.php @@ -12,6 +12,21 @@ + + + diff --git a/manifest.json b/manifest.json new file mode 100755 index 0000000..cdcfce2 --- /dev/null +++ b/manifest.json @@ -0,0 +1,21 @@ +{ + "name": "DoMiLi", + "short_name": "DoMiLi", + "description": "Ihre App-Beschreibung hier.", + "start_url": "index.php", + "display": "standalone", + "background_color": "#ffffff", + "theme_color": "#212529", + "icons": [ + { + "src": "img/icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "img/icon-512.png", + "sizes": "512x512", + "type": "image/png" + } + ] +} \ No newline at end of file diff --git a/service-worker.js b/service-worker.js new file mode 100755 index 0000000..c03b7bf --- /dev/null +++ b/service-worker.js @@ -0,0 +1,32 @@ +const CACHE_NAME = 'domili-cache-v1'; +const urlsToCache = [ + '/', + '/index.php', + '/css/style.css', + 'inc/header.php', + 'inc/footer.php', + 'img/icon-192.png', + 'img/icon-512.png', + 'https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css' +]; + +self.addEventListener('install', event => { + event.waitUntil( + caches.open(CACHE_NAME) + .then(cache => { + return cache.addAll(urlsToCache); + }) + ); +}); + +self.addEventListener('fetch', event => { + event.respondWith( + caches.match(event.request) + .then(response => { + if (response) { + return response; + } + return fetch(event.request); + }) + ); +}); \ No newline at end of file