feat: Basic frontend

This commit is contained in:
2024-05-03 18:23:21 +01:00
parent a61eb0734d
commit ee375e34a8
25 changed files with 3241 additions and 84 deletions
+11
View File
@@ -0,0 +1,11 @@
{
"name": "Hyperdeck Monitor",
"short_name": "Hyperdeck Monitor",
"icons": [],
"lang": "en-GB",
"id": "/index.html",
"start_url": "./index.html",
"display": "standalone",
"background_color": "white",
"theme_color": "white"
}
+25
View File
@@ -0,0 +1,25 @@
var cacheName = 'hyperdeck-monitor-pwa';
var filesToCache = [
'./',
'./index.html',
'./hyperdeck_monitor.js',
'./hyperdeck_monitor_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);
})
);
});