pwa
This commit is contained in:
parent
f8415c3441
commit
a1dbb328e0
7 changed files with 61 additions and 0 deletions
BIN
frontend/apple-touch-icon.png
Normal file
BIN
frontend/apple-touch-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
BIN
frontend/icon-192.png
Normal file
BIN
frontend/icon-192.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
BIN
frontend/icon-512.png
Normal file
BIN
frontend/icon-512.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
|
|
@ -4,6 +4,11 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
|
||||
<meta name="theme-color" content="#0a0a0c">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<title>Antigravity Agent Dashboard</title>
|
||||
<link rel="stylesheet" href="/src/style.css">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
|
|
|
|||
21
frontend/manifest.json
Normal file
21
frontend/manifest.json
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"name": "Antigravity Agency Dashboard",
|
||||
"short_name": "Agency",
|
||||
"description": "Autonomous AI Agent Dashboard",
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#0a0a0c",
|
||||
"theme_color": "#5d5dff",
|
||||
"icons": [
|
||||
{
|
||||
"src": "icon-192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "icon-512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -797,3 +797,12 @@ if (window.location.pathname === '/callback' || window.location.search.includes(
|
|||
} else {
|
||||
initializeApp();
|
||||
}
|
||||
|
||||
// Register Service Worker for PWA
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', () => {
|
||||
navigator.serviceWorker.register('/sw.js')
|
||||
.then(reg => console.log('SW registered', reg))
|
||||
.catch(err => console.error('SW registration failed', err));
|
||||
});
|
||||
}
|
||||
|
|
|
|||
26
frontend/sw.js
Normal file
26
frontend/sw.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
const CACHE_NAME = 'agency-cache-v1';
|
||||
const ASSETS = [
|
||||
'/',
|
||||
'/index.html',
|
||||
'/src/main.js',
|
||||
'/src/style.css',
|
||||
'/manifest.json',
|
||||
'/icon-192.png',
|
||||
'/icon-512.png'
|
||||
];
|
||||
|
||||
self.addEventListener('install', (event) => {
|
||||
event.waitUntil(
|
||||
caches.open(CACHE_NAME).then((cache) => {
|
||||
return cache.addAll(ASSETS);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
self.addEventListener('fetch', (event) => {
|
||||
event.respondWith(
|
||||
caches.match(event.request).then((response) => {
|
||||
return response || fetch(event.request);
|
||||
})
|
||||
);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue