✨ feat(pwabuilder-sw.js): Ajoute une page de repli hors ligne et améliore la gestion du cache.
🎨 style(about.twig): Supprime la mention du photographe (déplacé dans la page d'accueil).
This commit is contained in:
BIN
public/assets/css/fa-solid-900.woff2
Normal file
BIN
public/assets/css/fa-solid-900.woff2
Normal file
Binary file not shown.
@@ -1,18 +1,54 @@
|
||||
// This is the "Offline copy of pages" service worker
|
||||
// This is the service worker with the combined offline experience (Offline page + Offline copy of pages)
|
||||
|
||||
const CACHE = "pwabuilder-offline";
|
||||
const CACHE = "pwabuilder-offline-page";
|
||||
|
||||
importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.1.2/workbox-sw.js');
|
||||
|
||||
// TODO: replace the following with the correct offline fallback page i.e.: const offlineFallbackPage = "offline.html";
|
||||
const offlineFallbackPage = "offline.html";
|
||||
|
||||
self.addEventListener("message", (event) => {
|
||||
if (event.data && event.data.type === "SKIP_WAITING") {
|
||||
self.skipWaiting();
|
||||
}
|
||||
});
|
||||
|
||||
self.addEventListener('install', async (event) => {
|
||||
event.waitUntil(
|
||||
caches.open(CACHE)
|
||||
.then((cache) => cache.add(offlineFallbackPage))
|
||||
);
|
||||
});
|
||||
|
||||
if (workbox.navigationPreload.isSupported()) {
|
||||
workbox.navigationPreload.enable();
|
||||
}
|
||||
|
||||
workbox.routing.registerRoute(
|
||||
new RegExp('/*'),
|
||||
new workbox.strategies.StaleWhileRevalidate({
|
||||
cacheName: CACHE
|
||||
})
|
||||
);
|
||||
|
||||
self.addEventListener('fetch', (event) => {
|
||||
if (event.request.mode === 'navigate') {
|
||||
event.respondWith((async () => {
|
||||
try {
|
||||
const preloadResp = await event.preloadResponse;
|
||||
|
||||
if (preloadResp) {
|
||||
return preloadResp;
|
||||
}
|
||||
|
||||
const networkResp = await fetch(event.request);
|
||||
return networkResp;
|
||||
} catch (error) {
|
||||
|
||||
const cache = await caches.open(CACHE);
|
||||
const cachedResp = await cache.match(offlineFallbackPage);
|
||||
return cachedResp;
|
||||
}
|
||||
})());
|
||||
}
|
||||
});
|
||||
|
||||
@@ -169,7 +169,6 @@
|
||||
<h3 class="text-xl font-bold text-blue-800">ShokoCosplay</h3>
|
||||
<p class="text-teal-600 font-semibold mb-2">{{'about_founder_shoko_role'|trans}}</p>
|
||||
<p class="text-sm text-gray-700 mb-2">{{'about_email_label'|trans}}: <a href="mailto:shoko-cosplay@e-cosplay.fr" class="text-blue-600 hover:underline">shoko-cosplay@e-cosplay.fr</a></p>
|
||||
<div class="text-sm text-gray-600 mb-2">{{'about_photographer_label'|trans}}: dystopix_photography</div>
|
||||
<div class="social-icons" style="justify-content: center">
|
||||
<a href="https://www.instagram.com/cosplay_shoko/" target="_blank" aria-label="{{'about_shoko_instagram_aria'|trans}}"><i class="fab fa-instagram fa-lg"></i></a>
|
||||
<a href="https://www.tiktok.com/@cosshoko?lang=fr" target="_blank" aria-label="{{'about_shoko_tiktok_aria'|trans}}"><i class="fab fa-tiktok fa-lg"></i></a>
|
||||
|
||||
Reference in New Issue
Block a user