Skip to content

Commit

Permalink
everything added
Browse files Browse the repository at this point in the history
  • Loading branch information
Soumik committed Aug 10, 2024
1 parent f52eafa commit 85f790b
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docs/assets/index-BMTndMwK.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/assets/index-DRYsq2w4.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Attendance Manager</title>
<script type="module" crossorigin src="/assets/index-BMTndMwK.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DRYsq2w4.css">
</head>
<body>
<div id="root"></div>
<script>
if('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('./serviceworker.js')
.then((reg) => console.log('Success: ', reg.scope))
.catch((err) => console.log('Failure: ', err));
})
}
</script>
</body>
</html>
12 changes: 12 additions & 0 deletions docs/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "Attendance Manager",
"icons":
[{"src": "/vite.svg","type": "image/svg+xml",
"sizes": "1024x1024",
"purpose": "any maskable"}],
"start_url": ".",
"short_name": "Attendance",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
Empty file added docs/offline.html
Empty file.
30 changes: 30 additions & 0 deletions docs/serviceworker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const CACHE_NAME = "version-1";
const urlsToCache = [ 'index.html', 'offline.html' ];const self = this;// Install SW
self.addEventListener('install', (event) => {
event.waitUntil(
caches.open(CACHE_NAME)
.then((cache) => {
console.log('Opened cache');return cache.addAll(urlsToCache);
})
)
});// Listen for requests
self.addEventListener('fetch', (event) => {
event.respondWith(
caches.match(event.request)
.then(() => {
return fetch(event.request)
.catch(() => caches.match('offline.html'))
})
)
});// Activate the SW
self.addEventListener('activate', (event) => {
const cacheWhitelist = [];
cacheWhitelist.push(CACHE_NAME);event.waitUntil(
caches.keys().then((cacheNames) => Promise.all(
cacheNames.map((cacheName) => {
if(!cacheWhitelist.includes(cacheName)) {
return caches.delete(cacheName);
}
})
)))
});
1 change: 1 addition & 0 deletions docs/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 85f790b

Please sign in to comment.