add manifest and service-worker

pull/408/head
Dmitriy Aleksandrovich Chernukho 7 months ago
parent 2be09ed965
commit b80a00b290

3
.gitignore vendored

@ -13,4 +13,5 @@ idea/
/appendix/04/index.html
/09/test.html
.vscode
.vscode
node_modules

@ -17,5 +17,22 @@
ga("create", "UA-18824436-2", "auto");
ga("send", "pageview");
</script>
<script>
if ("serviceWorker" in navigator) {
// Register a service worker hosted at the root of the
// site using the default scope.
navigator.serviceWorker.register('pwa-sw.js').then(
(registration) => {
console.log("Service worker registration succeeded:", registration);
},
(error) => {
console.error(`Service worker registration failed: ${error}`);
},
);
} else {
console.error("Service workers are not supported.");
}
</script>
</body>
</html>

@ -1,4 +1,5 @@
<?php
// ob_start();
$path = ".";
$subtitle = "";
$README = "README";
@ -22,4 +23,7 @@
echo '</div>';
include("footer.php");
// $output = ob_get_contents();
// file_put_contents("index.html", $output);
?>

@ -0,0 +1,48 @@
{
"name": "TheBookOfShaders",
"short_name": "TheBookOfShaders",
"start_url": "/",
"display": "standalone",
"description": "This is a gentle step-by-step guide through the abstract and complex universe of Fragment Shaders.",
"lang": "en",
"dir": "auto",
"theme_color": "#000000",
"background_color": "#000000",
"orientation": "any",
"icons": [
{
"src": "https://www.pwabuilder.com/assets/icons/icon_512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "https://www.pwabuilder.com/assets/icons/icon_192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any"
}
],
"screenshots": [
{
"src": "https://www.pwabuilder.com/assets/screenshots/screen1.png",
"sizes": "2880x1800",
"type": "image/png",
"description": "A screenshot of the home page"
}
],
"related_applications": [
{
"platform": "windows",
"url": " The URL to your app in that app store"
}
],
"prefer_related_applications": false,
"shortcuts": [
{
"name": "The name you would like to be displayed for your shortcut",
"url": "The url you would like to open when the user chooses this shortcut. This must be a URL local to your PWA. For example: If my start_url is /, this URL must be something like /shortcut",
"description": "A description of the functionality of this shortcut"
}
]
}

2808
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,13 @@
{
"scripts": {
"build": "browserify pwabuilder-adv-sw.js -p esmify > pwa-sw.js"
},
"type": "module",
"dependencies": {
"workbox-precaching": "^7.0.0"
},
"devDependencies": {
"browserify": "^17.0.0",
"esmify": "^2.1.1"
}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,23 @@
import { precacheAndRoute } from "workbox-precaching/precacheAndRoute";
const revision = "abc1";
precacheAndRoute([
{
revision: "8d24eb7547812ba1d1a8895cff7db72e",
url: "04/three_js/index.html",
},
{ revision: "bf6c14925e66edb1526b6c9489b3c042", url: "css/github.css" },
{ revision: "e10b985f11be01a7e447a1f801055446", url: "css/style-ch.css" },
{ revision: "88aaf868b203111dc4f250c57cd8f2aa", url: "css/style-jp.css" },
{ revision: "ce095c53c74db756db3f96a62889d4c1", url: "css/style.css" },
{ revision: "a1260fc23f929cc5109bf721e192655a", url: "graph.html" },
{
revision: "b2b8d5f83423e2954b146b4c891d0654",
url: "src/highlight.min.js",
},
{ revision: "46438811d0e87fc6c287b4152a2adf96", url: "src/main.js" },
{ revision, url: "/" },
{ revision, url: "/00/*" },
{ revision, url: "/01/*" },
{ revision, url: "/02/*" },
]);
Loading…
Cancel
Save