diff --git a/index.html b/index.html index 3c7e141..b17a305 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,7 @@ MyCloset +
diff --git a/public/manifest.json b/public/manifest.json new file mode 100644 index 0000000..026a67e --- /dev/null +++ b/public/manifest.json @@ -0,0 +1,15 @@ +{ + "name": "MyCloset", + "short_name": "MyCloset", + "start_url": "/", + "display": "standalone", + "background_color": "#ffffff", + "theme_color": "#4F46E5", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + } + ] +} diff --git a/public/sw.js b/public/sw.js new file mode 100644 index 0000000..e4301e9 --- /dev/null +++ b/public/sw.js @@ -0,0 +1 @@ +self.addEventListener('fetch', function(event) {}); diff --git a/src/main.jsx b/src/main.jsx index b4296e8..ee5e78f 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -3,6 +3,14 @@ import ReactDOM from 'react-dom/client' import App from './App.jsx' import './index.css' +if ('serviceWorker' in navigator) { + window.addEventListener('load', () => { + navigator.serviceWorker.register('/sw.js').catch(err => { + console.error('Service worker registration failed', err); + }); + }); +} + ReactDOM.createRoot(document.getElementById('root')).render(