Add full PWA support

This commit is contained in:
LittleSheep 2024-03-30 12:06:19 +08:00
parent a2beb45302
commit d187ca0a88
7 changed files with 37 additions and 48 deletions

2
.gitignore vendored
View File

@ -29,3 +29,5 @@ coverage
*.tsbuildinfo
*.lockb
*dist

View File

@ -2,7 +2,8 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/xml+svg" href="/favicon.png" />
<link rel="icon" type="image/png" href="/favicon.png" />
<link rel="apple-touch-icon" type="image/png" href="/apple-touch-icon.png" sizes="1024x1024">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<title>Solian</title>
</head>

BIN
public/apple-touch-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

View File

@ -1,46 +0,0 @@
{
"icons": [
{
"src": "../icons/icon-48.webp",
"type": "image/png",
"sizes": "48x48",
"purpose": "any maskable"
},
{
"src": "../icons/icon-72.webp",
"type": "image/png",
"sizes": "72x72",
"purpose": "any maskable"
},
{
"src": "../icons/icon-96.webp",
"type": "image/png",
"sizes": "96x96",
"purpose": "any maskable"
},
{
"src": "../icons/icon-128.webp",
"type": "image/png",
"sizes": "128x128",
"purpose": "any maskable"
},
{
"src": "../icons/icon-192.webp",
"type": "image/png",
"sizes": "192x192",
"purpose": "any maskable"
},
{
"src": "../icons/icon-256.webp",
"type": "image/png",
"sizes": "256x256",
"purpose": "any maskable"
},
{
"src": "../icons/icon-512.webp",
"type": "image/png",
"sizes": "512x512",
"purpose": "any maskable"
}
]
}

2
public/robots.txt Normal file
View File

@ -0,0 +1,2 @@
User-agent: *
Allow: /

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 KiB

View File

@ -16,11 +16,41 @@ export default defineConfig({
registerType: "autoUpdate",
useCredentials: true,
manifest: {
name: "Solian",
name: "Solar Network Agent",
short_name: "Solian",
description: "The Solar Network entrypoint.",
theme_color: "#4b5094",
display: "standalone",
icons: [
{
src: "apple-touch-icon.png",
sizes: "1024x1024",
type: "image/png",
purpose: "any"
},
{
src: "favicon.png",
sizes: "1024x1024",
type: "image/png",
purpose: "maskable"
},
],
screenshots: [
{
src: "screenshots/solarplaza.png",
sizes: "2992x1714",
type: "image/png",
form_factor: "wide",
label: "Exploring the Solar Network Plaza"
}
]
},
workbox: {
globPatterns: ["**/*.{js,css,ico,png,svg}"]
},
devOptions: {
enabled: true,
}
})
],
resolve: {