diff --git a/astro-church-website/public/icons/app-icon.svg b/astro-church-website/public/icons/app-icon.svg new file mode 100644 index 0000000..9828bfc --- /dev/null +++ b/astro-church-website/public/icons/app-icon.svg @@ -0,0 +1,32 @@ + \ No newline at end of file diff --git a/astro-church-website/public/manifest.json b/astro-church-website/public/manifest.json new file mode 100644 index 0000000..e61e935 --- /dev/null +++ b/astro-church-website/public/manifest.json @@ -0,0 +1,63 @@ +{ + "name": "Rockville Tolland SDA Church", + "short_name": "RTSDA Church", + "description": "Official website and app for Rockville Tolland Seventh-day Adventist Church", + "start_url": "/", + "display": "standalone", + "background_color": "#1a1a1a", + "theme_color": "#d4af37", + "orientation": "portrait-primary", + "categories": ["religion", "lifestyle", "education"], + "lang": "en-US", + "scope": "/", + "icons": [ + { + "src": "/favicon.svg", + "sizes": "72x72", + "type": "image/svg+xml", + "purpose": "any" + }, + { + "src": "/favicon.svg", + "sizes": "96x96", + "type": "image/svg+xml", + "purpose": "any" + }, + { + "src": "/favicon.svg", + "sizes": "128x128", + "type": "image/svg+xml", + "purpose": "any" + }, + { + "src": "/favicon.svg", + "sizes": "144x144", + "type": "image/svg+xml", + "purpose": "any" + }, + { + "src": "/favicon.svg", + "sizes": "152x152", + "type": "image/svg+xml", + "purpose": "any" + }, + { + "src": "/favicon.svg", + "sizes": "192x192", + "type": "image/svg+xml", + "purpose": "any maskable" + }, + { + "src": "/favicon.svg", + "sizes": "384x384", + "type": "image/svg+xml", + "purpose": "any" + }, + { + "src": "/favicon.svg", + "sizes": "512x512", + "type": "image/svg+xml", + "purpose": "any maskable" + } + ] +} \ No newline at end of file diff --git a/astro-church-website/public/sw.js b/astro-church-website/public/sw.js new file mode 100644 index 0000000..2939e13 --- /dev/null +++ b/astro-church-website/public/sw.js @@ -0,0 +1,43 @@ +const CACHE_NAME = 'rtsda-church-v1'; +const urlsToCache = [ + '/', + '/about', + '/contact', + '/sermons', + '/events', + '/live', + '/manifest.json' +]; + +self.addEventListener('install', (event) => { + event.waitUntil( + caches.open(CACHE_NAME) + .then((cache) => { + return cache.addAll(urlsToCache); + }) + ); +}); + +self.addEventListener('fetch', (event) => { + event.respondWith( + caches.match(event.request) + .then((response) => { + // Return cached version or fetch from network + return response || fetch(event.request); + }) + ); +}); + +self.addEventListener('activate', (event) => { + event.waitUntil( + caches.keys().then((cacheNames) => { + return Promise.all( + cacheNames.map((cacheName) => { + if (cacheName !== CACHE_NAME) { + return caches.delete(cacheName); + } + }) + ); + }) + ); +}); \ No newline at end of file diff --git a/astro-church-website/src/components/Footer.astro b/astro-church-website/src/components/Footer.astro index 9497b12..d4ca144 100644 --- a/astro-church-website/src/components/Footer.astro +++ b/astro-church-website/src/components/Footer.astro @@ -149,7 +149,11 @@ const currentYear = new Date().getFullYear(); {address && (