This commit is contained in:
2026-05-21 10:11:10 +01:00
parent 40bfbf7c11
commit 33278214fd
4 changed files with 25 additions and 0 deletions

View File

@@ -4,6 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MyCloset</title>
<link rel="manifest" href="/manifest.json" />
</head>
<body>
<div id="root"></div>

15
public/manifest.json Normal file
View File

@@ -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"
}
]
}

1
public/sw.js Normal file
View File

@@ -0,0 +1 @@
self.addEventListener('fetch', function(event) {});

View File

@@ -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(
<React.StrictMode>
<App />