diff --git a/index.html b/index.html index 302e473..c6800a8 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,13 @@ Meatloaf Config + + + + + + + diff --git a/public/icon.192.png b/public/icon.192.png new file mode 100644 index 0000000..c6b232b Binary files /dev/null and b/public/icon.192.png differ diff --git a/public/icon.512.png b/public/icon.512.png new file mode 100644 index 0000000..b715841 Binary files /dev/null and b/public/icon.512.png differ diff --git a/public/manifest.webmanifest b/public/manifest.webmanifest new file mode 100644 index 0000000..a1be9fa --- /dev/null +++ b/public/manifest.webmanifest @@ -0,0 +1,21 @@ +{ + "name": "Meatloaf Config", + "short_name": "Meatloaf", + "start_url": ".", + "display": "standalone", + "background_color": "#4d4d4d", + "theme_color": "#4d4d4d", + "description": "Configuration app for Meatloaf device.", + "icons": [ + { + "src": "/icon.192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/icon.512.png", + "sizes": "512x512", + "type": "image/png" + } + ] +} diff --git a/public/service-worker.js b/public/service-worker.js new file mode 100644 index 0000000..51d723d --- /dev/null +++ b/public/service-worker.js @@ -0,0 +1,15 @@ +self.addEventListener('install', event => { + self.skipWaiting(); +}); + +self.addEventListener('activate', event => { + event.waitUntil(self.clients.claim()); +}); + +self.addEventListener('fetch', event => { + event.respondWith( + caches.match(event.request).then(response => { + return response || fetch(event.request); + }) + ); +}); diff --git a/src/main.tsx b/src/main.tsx index eb07ffb..2a9ee59 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,7 +1,15 @@ + import { createRoot } from "react-dom/client"; import App from "./app/App.tsx"; import "./styles/index.css"; + // Register service worker for PWA installability + if ('serviceWorker' in navigator) { + window.addEventListener('load', () => { + navigator.serviceWorker.register('/service-worker.js'); + }); + } + createRoot(document.getElementById("root")!).render(); \ No newline at end of file