add minimal info for PWA

This commit is contained in:
Simon Vieille 2023-11-17 18:25:26 +01:00
parent dd24fda35b
commit 3533ea4dfe
Signed by: deblan
GPG key ID: 579388D585F70417
6 changed files with 93 additions and 23 deletions

File diff suppressed because one or more lines are too long

BIN
static/img/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -296,6 +296,10 @@ var bootstrap = function() {
createWebSocketConnection();
addListeners();
documentHashHandler();
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("/static/service_worker.js");
}
}
$(function() {

17
static/manifest.json Normal file
View file

@ -0,0 +1,17 @@
{
"short_name": "RWM",
"name": "Remote i3-wm",
"theme_color": "#1e3650",
"background_color": "#ffffff",
"display": "fullscreen",
"Scope": "/",
"orientation": "portrait",
"icons": [
{
"src": "/static/img/icon.png",
"type": "image/png",
"sizes": "96x96"
}
],
"start_url": "/"
}

3
static/service_worker.js Normal file
View file

@ -0,0 +1,3 @@
self.addEventListener("install", (e) => {
console.log("[Service Worker] Install");
});

View file

@ -6,6 +6,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<link rel="stylesheet" href="/static/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="/static/main.css" type="text/css">
<link rel="manifest" href="/static/manifest.json">
<link rel="icon" type="image/png" href="/static/img/icon.png">
<title>Remote i3-wm</title>
</head>
<body>