Merge pull request #374 from schlagmichdoch/pwa_standalone

Enable standalone mode for PWA
This commit is contained in:
schlagmichdoch 2025-02-15 00:00:15 +01:00 committed by GitHub
commit eca41f36c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 12 additions and 5 deletions

View file

@ -10,6 +10,7 @@
<meta name="theme-color" content="#3367d6"> <meta name="theme-color" content="#3367d6">
<meta name="color-scheme" content="dark light"> <meta name="color-scheme" content="dark light">
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="PairDrop"> <meta name="apple-mobile-web-app-title" content="PairDrop">
<meta name="application-name" content="PairDrop"> <meta name="application-name" content="PairDrop">
<!-- Descriptions --> <!-- Descriptions -->

View file

@ -26,7 +26,7 @@
} }
], ],
"background_color": "#efefef", "background_color": "#efefef",
"display": "minimal-ui", "display": "standalone",
"theme_color": "#3367d6", "theme_color": "#3367d6",
"screenshots" : [ "screenshots" : [
{ {

View file

@ -81,7 +81,7 @@ class PairDrop {
} }
onPwaInstallable(e) { onPwaInstallable(e) {
if (!window.matchMedia('(display-mode: minimal-ui)').matches) { if (!window.matchMedia('(display-mode: standalone)').matches) {
// only display install btn when not installed // only display install btn when not installed
this.$headerInstallBtn.removeAttribute('hidden'); this.$headerInstallBtn.removeAttribute('hidden');
this.$headerInstallBtn.addEventListener('click', () => { this.$headerInstallBtn.addEventListener('click', () => {

View file

@ -357,7 +357,6 @@ class BackgroundCanvas {
this.w = document.documentElement.clientWidth; this.w = document.documentElement.clientWidth;
this.h = document.documentElement.clientHeight; this.h = document.documentElement.clientHeight;
this.offset = this.$footer.offsetHeight - 27; this.offset = this.$footer.offsetHeight - 27;
if (this.h >= 800) this.offset += 10;
if (oldW === this.w && oldH === this.h && oldOffset === this.offset) return; // nothing has changed if (oldW === this.w && oldH === this.h && oldOffset === this.offset) return; // nothing has changed

View file

@ -899,7 +899,7 @@ x-peers:empty~x-instructions {
@media screen and (min-height: 800px) { @media screen and (min-height: 800px) {
footer { footer {
margin-bottom: 16px; padding-bottom: 10px;
} }
} }
@ -909,6 +909,13 @@ x-peers:empty~x-instructions {
} }
} }
/* PWA Standalone styles */
@media all and (display-mode: standalone) {
footer {
padding-bottom: 34px;
}
}
/* Constants */ /* Constants */
:root { :root {