diff --git a/README.md b/README.md index 76e9e0e..556c6af 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,12 @@ docker compose up -d --build # open http://localhost:18093 ``` +### Install as an app (PWA) + +DungeonCraft is a progressive web app: browsers offer to install it (Chrome/Edge: install icon in the address bar or "Install app" in the menu; Android: "Add to home screen"; iOS Safari: Share → "Add to Home Screen"). The installed game starts in full screen and also works offline (the savegame list on the server then falls back to savegame files). + +Browsers only allow the installation over **HTTPS** (or on `localhost`), so a public installation needs a reverse proxy with a certificate in front of port 18093. + ### Building without Docker Requirements: Rust with the `wasm32-unknown-unknown` target. diff --git a/nginx.conf b/nginx.conf index 9ca393c..bd349a0 100644 --- a/nginx.conf +++ b/nginx.conf @@ -7,6 +7,11 @@ server { location / { try_files $uri $uri/ =404; } + # installable app (PWA) + location ~ \.webmanifest$ { + default_type application/manifest+json; + try_files $uri =404; + } # savegame service (server/). Resolved at request time, so the game still starts without it; # the game then falls back to savegame files. location /api/ { diff --git a/www/icons/apple-touch-icon.png b/www/icons/apple-touch-icon.png new file mode 100644 index 0000000..5aec7c5 Binary files /dev/null and b/www/icons/apple-touch-icon.png differ diff --git a/www/icons/icon-192.png b/www/icons/icon-192.png new file mode 100644 index 0000000..ec49239 Binary files /dev/null and b/www/icons/icon-192.png differ diff --git a/www/icons/icon-512.png b/www/icons/icon-512.png new file mode 100644 index 0000000..98d180c Binary files /dev/null and b/www/icons/icon-512.png differ diff --git a/www/icons/maskable-512.png b/www/icons/maskable-512.png new file mode 100644 index 0000000..9e30af4 Binary files /dev/null and b/www/icons/maskable-512.png differ diff --git a/www/index.html b/www/index.html index 234c41a..227a4e3 100644 --- a/www/index.html +++ b/www/index.html @@ -3,7 +3,14 @@ DungeonCraft - + + + + + + + +