initial commit

This commit is contained in:
Трошин Антон Валерьевич
2026-07-12 02:18:43 +03:00
parent bdb097756e
commit 3055b785be
8 changed files with 1694 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
const CACHE_NAME = 'numnum-v30';
const ASSETS = [
'/',
'/index.html',
'/styles.css',
'/app.js',
'/numerals.js',
'/manifest.json',
'/icon.svg',
];
self.addEventListener('install', (e) => {
e.waitUntil(
caches.open(CACHE_NAME).then(cache => cache.addAll(ASSETS))
);
self.skipWaiting();
});
self.addEventListener('activate', (e) => {
e.waitUntil(
caches.keys().then(keys =>
Promise.all(keys.filter(k => k !== CACHE_NAME).map(k => caches.delete(k)))
)
);
self.clients.claim();
});
self.addEventListener('fetch', (e) => {
e.respondWith(
caches.match(e.request).then(r => r || fetch(e.request))
);
});