diff --git a/client/index.html b/client/index.html index b536956..3696385 100644 --- a/client/index.html +++ b/client/index.html @@ -2,7 +2,7 @@ - + zKube - zKube + + + + + + + + + + + +
diff --git a/client/public/assets/apple-icon-157x157.png b/client/public/assets/apple-icon-157x157.png new file mode 100644 index 0000000..1e465d5 Binary files /dev/null and b/client/public/assets/apple-icon-157x157.png differ diff --git a/client/public/assets/apple-icon-167x167.png b/client/public/assets/apple-icon-167x167.png new file mode 100644 index 0000000..2e3e576 Binary files /dev/null and b/client/public/assets/apple-icon-167x167.png differ diff --git a/client/public/assets/apple-icon-180x180.png b/client/public/assets/apple-icon-180x180.png new file mode 100644 index 0000000..3ed5557 Binary files /dev/null and b/client/public/assets/apple-icon-180x180.png differ diff --git a/client/public/assets/pwa-192x192.png b/client/public/assets/pwa-192x192.png new file mode 100644 index 0000000..9875486 Binary files /dev/null and b/client/public/assets/pwa-192x192.png differ diff --git a/client/public/assets/pwa-512x512.png b/client/public/assets/pwa-512x512.png new file mode 100644 index 0000000..5ab1f96 Binary files /dev/null and b/client/public/assets/pwa-512x512.png differ diff --git a/client/public/assets/pwa-maskable-192x192.png b/client/public/assets/pwa-maskable-192x192.png new file mode 100644 index 0000000..9875486 Binary files /dev/null and b/client/public/assets/pwa-maskable-192x192.png differ diff --git a/client/public/assets/pwa-maskable-512x512.png b/client/public/assets/pwa-maskable-512x512.png new file mode 100644 index 0000000..5ab1f96 Binary files /dev/null and b/client/public/assets/pwa-maskable-512x512.png differ diff --git a/client/vite.config.ts b/client/vite.config.ts index 0aca012..b74e8c2 100644 --- a/client/vite.config.ts +++ b/client/vite.config.ts @@ -20,18 +20,69 @@ export default defineConfig({ }, includeAssets: [ "/assets/favicon.ico", - "/assets/apple-touch-icon.png", - "/assets/masked-icon.svg", + "/assets/pwa-192x192.png", + "/assets/pwa-512x512.png", + "/assets/pwa-maskable-192x192.png", + "/assets/pwa-maskable-512x512.png", + "/assets/apple-icon-152x152.png", + "/assets/apple-icon-167x167.png", + "/assets/apple-icon-180x180.png", ], manifest: { name: "zKube", short_name: "zKube", description: "Solo strategy block game.", - theme_color: "#000000", - icons: [], + theme_color: "#080414", + background_color: "#080414", + display: "standalone", // hides browser UI elements + orientation: "portrait", + icons: [ + { + src: "/assets/pwa-192x192.png", + sizes: "192x192", + type: "image/png", + purpose: "any", + }, + { + src: "/assets/pwa-512x512.png", + sizes: "512x512", + type: "image/png", + purpose: "any", + }, + { + src: "/assets/pwa-maskable-192x192.png", + sizes: "192x192", + type: "image/png", + purpose: "maskable", + }, + { + src: "/assets/pwa-maskable-512x512.png", + sizes: "512x512", + type: "image/png", + purpose: "maskable", + }, + { + src: "/assets/apple-icon-152x152.png", + sizes: "152x152", + type: "image/png", + }, + { + src: "/assets/apple-icon-167x167.png", + sizes: "167x167", + type: "image/png", + }, + { + src: "/assets/apple-icon-180x180.png", + sizes: "180x180", + type: "image/png", + }, + ], + start_url: "/", + id: "zkube", }, workbox: { maximumFileSizeToCacheInBytes: 5 * 1024 * 1024, // Set to 5 MiB + globPatterns: ["**/*.{js,css,html,ico,png,svg,woff,woff2,ttf,eot}"], runtimeCaching: [ { urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i, @@ -61,6 +112,54 @@ export default defineConfig({ }, }, }, + { + urlPattern: /\.(?:png|jpg|jpeg|svg|gif|webp)$/, + handler: "StaleWhileRevalidate", + options: { + cacheName: "images", + expiration: { + maxEntries: 60, + maxAgeSeconds: 30 * 24 * 60 * 60, // 30 days + }, + }, + }, + { + urlPattern: /\.(?:js|css)$/, + handler: "StaleWhileRevalidate", + options: { + cacheName: "static-resources", + expiration: { + maxEntries: 60, + maxAgeSeconds: 24 * 60 * 60, // 24 hours + }, + }, + }, + { + urlPattern: /^https:\/\/api\./, + handler: "NetworkFirst", + options: { + cacheName: "api-cache", + networkTimeoutSeconds: 10, + expiration: { + maxEntries: 50, + maxAgeSeconds: 5 * 60, // 5 minutes + }, + cacheableResponse: { + statuses: [0, 200], + }, + }, + }, + { + urlPattern: /.*/, // Fallback for everything else + handler: "StaleWhileRevalidate", + options: { + cacheName: "fallback-cache", + expiration: { + maxEntries: 50, + maxAgeSeconds: 24 * 60 * 60, // 24 hours + }, + }, + }, ], }, }),