Working application

This commit is contained in:
elvis
2025-10-17 21:42:41 +02:00
parent 3472a31584
commit 617af61d7c
35 changed files with 8725 additions and 0 deletions

View File

@ -0,0 +1,25 @@
var cacheName = 'egui-template-pwa';
var filesToCache = [
'./',
'./index.html',
'./reaction_systems_gui.js',
'./reaction_systems_gui_bg.wasm',
];
/* Start the service worker and cache all of the app's content */
self.addEventListener('install', function (e) {
e.waitUntil(
caches.open(cacheName).then(function (cache) {
return cache.addAll(filesToCache);
})
);
});
/* Serve cached content when offline */
self.addEventListener('fetch', function (e) {
e.respondWith(
caches.match(e.request).then(function (response) {
return response || fetch(e.request);
})
);
});