Initial Code
First Commit
BIN
public/.DS_Store
vendored
Executable file
BIN
public/favicon/apple-touch-icon.png
Executable file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
public/favicon/favicon-96x96.png
Executable file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
public/favicon/favicon.ico
Executable file
|
After Width: | Height: | Size: 15 KiB |
1
public/favicon/favicon.svg
Executable file
|
After Width: | Height: | Size: 105 KiB |
21
public/favicon/site.webmanifest
Executable file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "Eira Personal AI Assistant",
|
||||
"short_name": "Eira",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/web-app-manifest-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
},
|
||||
{
|
||||
"src": "/web-app-manifest-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
}
|
||||
],
|
||||
"theme_color": "#6f42c1",
|
||||
"background_color": "#ffffff",
|
||||
"display": "standalone"
|
||||
}
|
||||
BIN
public/favicon/web-app-manifest-192x192.png
Executable file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
public/favicon/web-app-manifest-512x512.png
Executable file
|
After Width: | Height: | Size: 30 KiB |
17
public/index.html
Executable file
@@ -0,0 +1,17 @@
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<link rel="icon" type="image/png" href="/favicon/favicon-96x96.png" sizes="96x96" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon/favicon.svg" />
|
||||
<link rel="shortcut icon" href="/favicon/favicon.ico" />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png" />
|
||||
<meta name="apple-mobile-web-app-title" content="Eira" />
|
||||
<link rel="manifest" href="/favicon/site.webmanifest" />
|
||||
<title>Eira - Personal AI Assistant</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<!-- Bootstrap Bundle JS (includes Popper.js) -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
BIN
public/logo.png
Executable file
|
After Width: | Height: | Size: 78 KiB |
49
public/sw.js
Executable file
@@ -0,0 +1,49 @@
|
||||
self.addEventListener('push', event => {
|
||||
let data = {
|
||||
title: 'Eira',
|
||||
body: 'You have a new notification',
|
||||
icon: '/icons/eira-icon.png',
|
||||
badge: '/icons/eira-badge.png',
|
||||
data: {
|
||||
url: '/' // default fallback
|
||||
}
|
||||
};
|
||||
|
||||
if (event.data) {
|
||||
try {
|
||||
const json = event.data.json();
|
||||
data.title = json.title || data.title;
|
||||
data.body = json.body || data.body;
|
||||
data.icon = json.icon || data.icon;
|
||||
data.badge = json.badge || data.badge;
|
||||
data.data.url = json.data.url || data.data.url;
|
||||
} catch (e) {
|
||||
console.error('Error parsing push event data:', e);
|
||||
}
|
||||
}
|
||||
|
||||
event.waitUntil(self.registration.showNotification(data.title, {
|
||||
body: data.body,
|
||||
icon: data.icon,
|
||||
badge: data.badge,
|
||||
data: { url: data.data.url }
|
||||
}));
|
||||
});
|
||||
|
||||
self.addEventListener('notificationclick', event => {
|
||||
event.notification.close();
|
||||
|
||||
const urlToOpen = event.notification.data.url || '/';
|
||||
|
||||
event.waitUntil(clients.matchAll({ type: 'window', includeUncontrolled: true })
|
||||
.then(windowClients => {
|
||||
for (const client of windowClients) {
|
||||
if (client.url === urlToOpen && 'focus' in client) {
|
||||
return client.focus();
|
||||
}
|
||||
}
|
||||
if (clients.openWindow) {
|
||||
return clients.openWindow(urlToOpen);
|
||||
}
|
||||
}));
|
||||
});
|
||||