Add PWA: manifest, icons

This commit is contained in:
Anders Englöf Ytterström 2025-02-12 23:14:51 +01:00
parent 026b090426
commit b34bb19fb8
6 changed files with 4818 additions and 16 deletions

View file

@ -2,8 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <meta name="viewport" content="width=device-width" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Strand</title> <title>Strand</title>
</head> </head>
<body> <body>

4773
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -17,7 +17,8 @@
"svelte": "^5.15.0", "svelte": "^5.15.0",
"svelte-check": "^4.1.1", "svelte-check": "^4.1.1",
"typescript": "~5.6.2", "typescript": "~5.6.2",
"vite": "^6.0.5" "vite": "^6.0.5",
"vite-plugin-pwa": "^0.21.1"
}, },
"dependencies": { "dependencies": {
"svelte-persisted-store": "^0.12.0" "svelte-persisted-store": "^0.12.0"

BIN
public/icon512_maskable.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
public/icon512_rounded.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View file

@ -1,7 +1,38 @@
import { defineConfig } from 'vite' import { defineConfig } from "vite";
import { svelte } from '@sveltejs/vite-plugin-svelte' import { VitePWA } from "vite-plugin-pwa";
import { svelte } from "@sveltejs/vite-plugin-svelte";
// https://vite.dev/config/ // https://vite.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [svelte()], plugins: [
}) svelte(),
VitePWA({
injectRegister: "auto",
includeAssets: ["icon512_rounded.png", "icon512_maskable.png"],
manifest: {
theme_color: "#8936FF",
background_color: "#2EC6FE",
icons: [
{
purpose: "maskable",
sizes: "512x512",
src: "icon512_maskable.png",
type: "image/png",
},
{
purpose: "any",
sizes: "512x512",
src: "icon512_rounded.png",
type: "image/png",
},
],
orientation: "portrait",
display: "standalone",
dir: "auto",
lang: "sv-SE",
name: "Strand",
short_name: "strand",
},
}),
],
});