Upgrade maps to MapLibre GL JS; compact header; move search to settings
- Replace Leaflet with MapLibre GL JS v4.7.1 across all map instances - CARTO dark/light and Esri satellite raster basemaps (no API key) - All overlays (hurricane, wildfire, SPC, wind arrows) ported to GeoJSON sources/layers - AQI, alert, temp, sun/moon markers via maplibregl.Marker with custom HTML - Radar animation pre-loads all frames on load for smoother playback - Compact loc-header: tighter padding and font sizes, all info preserved - Search bar moved from header to Settings tab under Location section - Service worker bumped to weather-v7 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
1863f6784b
commit
a25864d9ed
6 files changed
+1732
-343
No files matched your search
+32
-1
@@ -4,7 +4,7 @@ self.addEventListener('message', event => {
|
||||
if (event.data === 'skipWaiting') self.skipWaiting();
|
||||
});
|
||||
|
||||
const CACHE = 'weather-v5';
|
||||
const CACHE = 'weather-v7';
|
||||
|
||||
// App shell cached on install for offline resilience.
|
||||
const PRECACHE = [
|
||||
@@ -31,6 +31,37 @@ self.addEventListener('activate', event => {
|
||||
);
|
||||
});
|
||||
|
||||
self.addEventListener('push', event => {
|
||||
if (!event.data) return;
|
||||
let payload;
|
||||
try { payload = event.data.json(); } catch { payload = { title: 'NeCloud Weather', body: event.data.text() }; }
|
||||
event.waitUntil(
|
||||
self.registration.showNotification(payload.title || 'NeCloud Weather', {
|
||||
body: payload.body || '',
|
||||
icon: '/icons/icon-192.png',
|
||||
badge: '/icons/icon-192.png',
|
||||
tag: payload.tag || 'weather-alert',
|
||||
data: { url: payload.url || '/' },
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
self.addEventListener('notificationclick', event => {
|
||||
event.notification.close();
|
||||
const url = event.notification.data?.url || '/';
|
||||
event.waitUntil(
|
||||
clients.matchAll({ type: 'window', includeUncontrolled: true }).then(wins => {
|
||||
for (const w of wins) {
|
||||
if (w.url.startsWith(self.registration.scope) && 'focus' in w) {
|
||||
w.navigate(url);
|
||||
return w.focus();
|
||||
}
|
||||
}
|
||||
return clients.openWindow(url);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
self.addEventListener('fetch', event => {
|
||||
const { request } = event;
|
||||
const url = new URL(request.url);
|
||||
|
||||
Reference in new issue
Block a user