added support to use as a PWA
parent
dc0e4d5c57
commit
19a955525e
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"background_color": "#242424",
|
"background_color": "#242424",
|
||||||
"description": "",
|
|
||||||
"dir": "ltr",
|
"dir": "ltr",
|
||||||
"display": "standalone",
|
"display": "standalone",
|
||||||
"name": "Generator Status",
|
"name": "Generator Status",
|
||||||
|
@ -9,7 +8,4 @@
|
||||||
"short_name": "Generator Status",
|
"short_name": "Generator Status",
|
||||||
"start_url": "/",
|
"start_url": "/",
|
||||||
"theme_color": "#242424",
|
"theme_color": "#242424",
|
||||||
"categories": [],
|
|
||||||
"screenshots": [],
|
|
||||||
"shortcuts": []
|
|
||||||
}
|
}
|
||||||
|
|
5
off.html
5
off.html
|
@ -3,6 +3,11 @@
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="manifest" href="/manifest.json">
|
<link rel="manifest" href="/manifest.json">
|
||||||
|
<script type="module">
|
||||||
|
import 'https://cdn.jsdelivr.net/npm/@pwabuilder/pwaupdate';
|
||||||
|
const el = document.createElement('pwa-update');
|
||||||
|
document.body.appendChild(el);
|
||||||
|
</script>
|
||||||
<title>Generator Status...</title>
|
<title>Generator Status...</title>
|
||||||
<style>
|
<style>
|
||||||
* {
|
* {
|
||||||
|
|
|
@ -0,0 +1,80 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link rel="manifest" href="/manifest.json">
|
||||||
|
<script type="module">
|
||||||
|
import 'https://cdn.jsdelivr.net/npm/@pwabuilder/pwaupdate';
|
||||||
|
const el = document.createElement('pwa-update');
|
||||||
|
document.body.appendChild(el);
|
||||||
|
</script>
|
||||||
|
<title>Generator Status...</title>
|
||||||
|
<style>
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
font-family: "Source Sans Pro", "SF Pro Display", sans-serif;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: inherit;
|
||||||
|
}
|
||||||
|
b {
|
||||||
|
font-weight: bolder;
|
||||||
|
}
|
||||||
|
.title-bg {
|
||||||
|
background-color: dimgray;
|
||||||
|
height: auto;
|
||||||
|
display: block;
|
||||||
|
text-align: center;
|
||||||
|
align-content: center;
|
||||||
|
padding: 50px 50px 10px 50px;
|
||||||
|
}
|
||||||
|
.title-text {
|
||||||
|
color: white;
|
||||||
|
padding: 10px 5px;
|
||||||
|
font-size: 40px;
|
||||||
|
}
|
||||||
|
.credits {
|
||||||
|
padding: 10px 5px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 15px;
|
||||||
|
color: gray;
|
||||||
|
}
|
||||||
|
.credits a {
|
||||||
|
color: #555555;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
.credits a:hover {
|
||||||
|
color: #3c5c68;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
.date-time-updated {
|
||||||
|
padding: 5px 5px;
|
||||||
|
color: #dddddd;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.date-time-updated b {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="title-bg">
|
||||||
|
<div class="title-text">
|
||||||
|
<p>You're Offline</p>
|
||||||
|
</div>
|
||||||
|
<div class="date-time-updated">
|
||||||
|
<p>please check your internet connection</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="credits">
|
||||||
|
<p>Made with ❤️ | Source Code: <a href="https://git.sandcastle.eu.org/thebiblelover7/generator-status">Gitea</a>
|
||||||
|
<br>
|
||||||
|
Thanks to <a href="https://matrix.to/#/@junyong_chung:tchncs.de">Junyong Chung</a> for the hardware and <a href="https://meu.edu.lb">MEU</a> for providing the domain.</p>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
5
on.html
5
on.html
|
@ -3,6 +3,11 @@
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="manifest" href="/manifest.json">
|
<link rel="manifest" href="/manifest.json">
|
||||||
|
<script type="module">
|
||||||
|
import 'https://cdn.jsdelivr.net/npm/@pwabuilder/pwaupdate';
|
||||||
|
const el = document.createElement('pwa-update');
|
||||||
|
document.body.appendChild(el);
|
||||||
|
</script>
|
||||||
<title>Generator Status...</title>
|
<title>Generator Status...</title>
|
||||||
<style>
|
<style>
|
||||||
* {
|
* {
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
// This is the "Offline page" service worker
|
||||||
|
|
||||||
|
importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.1.2/workbox-sw.js');
|
||||||
|
|
||||||
|
const CACHE = "pwabuilder-page";
|
||||||
|
|
||||||
|
// 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();
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
})());
|
||||||
|
}
|
||||||
|
});
|
|
@ -3,6 +3,11 @@
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="manifest" href="/manifest.json">
|
<link rel="manifest" href="/manifest.json">
|
||||||
|
<script type="module">
|
||||||
|
import 'https://cdn.jsdelivr.net/npm/@pwabuilder/pwaupdate';
|
||||||
|
const el = document.createElement('pwa-update');
|
||||||
|
document.body.appendChild(el);
|
||||||
|
</script>
|
||||||
<title>Generator Status...</title>
|
<title>Generator Status...</title>
|
||||||
<style>
|
<style>
|
||||||
* {
|
* {
|
||||||
|
|
Loading…
Reference in New Issue