Deploy Life of Mellow PWA

This commit is contained in:
mosaic 2026-07-22 13:41:47 +00:00
parent 0f46afd829
commit cb004ca019
5 changed files with 2716 additions and 0 deletions

BIN
icon-192.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
icon-512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

2669
index.html Normal file

File diff suppressed because it is too large Load Diff

17
manifest.json Normal file
View File

@ -0,0 +1,17 @@
{
"name": "Life of Mellow",
"short_name": "Mellow",
"description": "A cozy village sim — guide your Mellows to gather, build and thrive through the seasons.",
"start_url": "./",
"scope": "./",
"display": "standalone",
"orientation": "any",
"background_color": "#bfe0f0",
"theme_color": "#8db26a",
"categories": ["games", "entertainment"],
"icons": [
{ "src": "icon-192.png", "sizes": "192x192", "type": "image/png", "purpose": "any" },
{ "src": "icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "any" },
{ "src": "icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" }
]
}

30
sw.js Normal file
View File

@ -0,0 +1,30 @@
/* Life of Mellow — service worker (offline app shell) */
const CACHE = 'mellow-v1';
const ASSETS = ['./', './index.html', './manifest.json', './icon-192.png', './icon-512.png'];
self.addEventListener('install', (e) => {
e.waitUntil(
caches.open(CACHE).then((c) => c.addAll(ASSETS)).then(() => self.skipWaiting())
);
});
self.addEventListener('activate', (e) => {
e.waitUntil(
caches.keys()
.then((keys) => Promise.all(keys.filter((k) => k !== CACHE).map((k) => caches.delete(k))))
.then(() => self.clients.claim())
);
});
self.addEventListener('fetch', (e) => {
if (e.request.method !== 'GET') return;
e.respondWith(
caches.match(e.request).then((hit) =>
hit || fetch(e.request).then((res) => {
const copy = res.clone();
caches.open(CACHE).then((c) => c.put(e.request, copy)).catch(() => {});
return res;
}).catch(() => caches.match('./index.html'))
)
);
});