feat: add manifest.json for pwa (#144)

* chore: update `i18nStore`

* feat: add pwa `manifest.json`
This commit is contained in:
XQ 2022-08-12 21:30:59 +08:00 committed by GitHub
parent 87f5ac8b71
commit dfac877957
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 0 deletions

View file

@ -5,10 +5,18 @@
<link rel="icon" href="/logo.png" type="image/*" />
<meta name="theme-color" content="#f6f5f4" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel="manifest" href="/manifest.json" />
<title>Memos</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<script>
window.addEventListener("load", () => {
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("/sw.js");
}
});
</script>
</body>
</html>

18
web/public/manifest.json Normal file
View file

@ -0,0 +1,18 @@
{
"short_name": "Memos",
"name": "Memos",
"icons": [
{
"src": "/logo.png",
"type": "image/png",
"sizes": "200x200"
}
],
"start_url": "/",
"background_color": "#f6f5f4",
"display": "standalone",
"scope": "/",
"theme_color": "#f6f5f4",
"description": "usememos/memos"
}

10
web/public/sw.js Normal file
View file

@ -0,0 +1,10 @@
self.addEventListener("install", (event) => {
event.waitUntil((async () => {})());
});
self.addEventListener("activate", (event) => {
event.waitUntil((async () => {})());
});
self.addEventListener("fetch", (event) => {});