[code] created app.js and service-worker.js, these files are key for offline and PWA functionality, also updated all project HTML files to reflect these new files and their relevant links.

This commit is contained in:
2026-04-23 20:52:06 +01:00
parent 5d5daf535c
commit 8ffd91564f
5 changed files with 51 additions and 0 deletions

8
app.js Normal file
View File

@@ -0,0 +1,8 @@
if ('serviceWorker' in navigator) { // Setup — initialises and adds service worker to page
window.addEventListener('load', () => {
navigator.serviceWorker
.register('/service-worker.js')
.then(reg => console.log('Service worker registered:', reg.scope))
.catch(err => console.error('Registration failed:', err));
});
}