mirror of
https://github.com/usememos/memos.git
synced 2024-12-26 23:22:47 +08:00
feat: add manifest.json
for pwa (#144)
* chore: update `i18nStore` * feat: add pwa `manifest.json`
This commit is contained in:
parent
87f5ac8b71
commit
dfac877957
3 changed files with 36 additions and 0 deletions
|
@ -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
18
web/public/manifest.json
Normal 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
10
web/public/sw.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
self.addEventListener("install", (event) => {
|
||||
event.waitUntil((async () => {})());
|
||||
});
|
||||
|
||||
self.addEventListener("activate", (event) => {
|
||||
event.waitUntil((async () => {})());
|
||||
});
|
||||
|
||||
self.addEventListener("fetch", (event) => {});
|
||||
|
Loading…
Reference in a new issue