Add files via upload

This commit is contained in:
Serverlele30 authored and GitHub committed 2025-12-30 19:28:19 +01:00
1 parent b30d083677
commit cc1e661862
5 files changed
+1651

No files matched your search

BIN
View File
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

+1556
View File
File diff suppressed because it is too large. Load diff
+26
View File
@@ -0,0 +1,26 @@
{
"name": "VBB Netz Status",
"short_name": "VBB Status",
"description": "Echtzeit-Abfahrtsmonitor für den Verkehrsverbund Berlin-Brandenburg - by Aaron K.",
"start_url": "/",
"display": "standalone",
"background_color": "#000000",
"theme_color": "#000000",
"orientation": "portrait",
"icons": [
{
"src": "images/favicon.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any maskable"
},
{
"src": "images/favicon.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any maskable"
}
],
"categories": ["travel", "navigation"],
"lang": "de-DE"
}
+69
View File
@@ -0,0 +1,69 @@
const CACHE_NAME = 'vbb-status-v3';
const urlsToCache = [
'/',
'/index.html',
'/manifest.json',
'/DotMatrix.ttf',
'/images/favicon.png'
];
// Installation
self.addEventListener('install', event => {
event.waitUntil(
caches.open(CACHE_NAME)
.then(cache => {
console.log('Cache geöffnet');
return cache.addAll(urlsToCache);
})
);
self.skipWaiting();
});
// Aktivierung
self.addEventListener('activate', event => {
event.waitUntil(
caches.keys().then(cacheNames => {
return Promise.all(
cacheNames.map(cacheName => {
if (cacheName !== CACHE_NAME) {
console.log('Alter Cache wird gelöscht:', cacheName);
return caches.delete(cacheName);
}
})
);
})
);
self.clients.claim();
});
// Fetch
self.addEventListener('fetch', event => {
event.respondWith(
caches.match(event.request)
.then(response => {
// Cache hit - return response
if (response) {
return response;
}
return fetch(event.request).then(
response => {
// Check if valid response
if (!response || response.status !== 200 || response.type !== 'basic') {
return response;
}
// Clone the response
const responseToCache = response.clone();
caches.open(CACHE_NAME)
.then(cache => {
cache.put(event.request, responseToCache);
});
return response;
}
);
})
);
});