Skip to content

Commit a33e7fc

Browse files
committed
vambora
1 parent 68dc41f commit a33e7fc

File tree

7 files changed

+37
-1
lines changed

7 files changed

+37
-1
lines changed

index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
<head>
55
<meta charset="UTF-8" />
6-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<link rel="manifest" href="/open-latex/manifest.json">
7+
<link rel="icon" type="image/svg+xml" href="/open-latex/favicon.png" />
78
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
89
<title>open-latex</title>
910
</head>

public/favicon.png

1.5 KB
Loading

public/icons/icon-192.png

5.5 KB
Loading

public/icons/icon-512.png

10.8 KB
Loading

public/manifest.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "OpenLatex",
3+
"short_name": "OpenLatex",
4+
"description": "OpenLatex",
5+
"start_url": "/OpenLatex/",
6+
"display": "standalone",
7+
"background_color": "#333333",
8+
"theme_color": "#333333",
9+
"icons": [
10+
{
11+
"src": "icons/icon-192.png",
12+
"sizes": "192x192",
13+
"type": "image/png"
14+
},
15+
{
16+
"src": "icons/icon-512.png",
17+
"sizes": "512x512",
18+
"type": "image/png"
19+
}
20+
]
21+
}

public/sw.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
self.addEventListener('install', event => {
2+
self.skipWaiting();
3+
});
4+
5+
self.addEventListener('fetch', event => {
6+
// PWA mínimo: apenas responde normalmente
7+
});

src/main.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ import { createRoot } from 'react-dom/client';
33
import './index.css';
44
import App from './App.tsx';
55

6+
if ('serviceWorker' in navigator) {
7+
window.addEventListener('load', () => {
8+
navigator.serviceWorker.register('/open-latex/sw.js')
9+
.catch(err => console.error('error on registering SW', err));
10+
});
11+
}
12+
613
createRoot(document.getElementById('root')!).render(
714
<StrictMode>
815
<App />

0 commit comments

Comments
 (0)