From 0ac58c3349c8b14f2e3ade57d267b1a7e02a0ea2 Mon Sep 17 00:00:00 2001 From: Jason Halvorson <47071224+JasonHalvorson@users.noreply.github.com> Date: Mon, 8 Apr 2024 20:22:15 -0700 Subject: [PATCH] Add basic PWA support --- index.css | 6 ++++++ index.html | 17 ++++++++++++++++- manifest.json | 16 ++++++++++++++++ service-worker.js | 3 +++ 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 manifest.json create mode 100644 service-worker.js diff --git a/index.css b/index.css index 0d7e671c720..73d6a91db24 100644 --- a/index.css +++ b/index.css @@ -41,6 +41,12 @@ body { z-index: 3; } +@media (orientation: portrait) { + #dpad, #apad { + bottom: calc(1rem + env(safe-area-inset-bottom)); + } +} + #dpad { left: 1rem; } diff --git a/index.html b/index.html index 531efc2cc4c..4d3fe513570 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@ - + + + diff --git a/manifest.json b/manifest.json new file mode 100644 index 00000000000..434cf75a5fd --- /dev/null +++ b/manifest.json @@ -0,0 +1,16 @@ +{ + "name": "PokéRogue", + "short_name": "PokéRogue", + "description": "A Pokémon fangame heavily inspired by the roguelite genre. Battle endlessly while gathering stacking items, exploring many different biomes, and reaching Pokémon stats you never thought possible.", + "start_url": "/", + "display": "standalone", + "background_color": "#8c8c8c", + "theme_color": "#8c8c8c", + "icons": [ + { + "src": "../logo.png", + "sizes": "128x128", + "type": "image/png" + } + ] +} diff --git a/service-worker.js b/service-worker.js new file mode 100644 index 00000000000..b45d2484709 --- /dev/null +++ b/service-worker.js @@ -0,0 +1,3 @@ +self.addEventListener('install', function () { + console.log('Service worker installing...'); +});