mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-20 07:05:05 -04:00
Merge pull request #374 from schlagmichdoch/pwa_standalone
Enable standalone mode for PWA
This commit is contained in:
commit
eca41f36c7
5 changed files with 12 additions and 5 deletions
|
@ -10,6 +10,7 @@
|
|||
<meta name="theme-color" content="#3367d6">
|
||||
<meta name="color-scheme" content="dark light">
|
||||
<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="application-name" content="PairDrop">
|
||||
<!-- Descriptions -->
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
}
|
||||
],
|
||||
"background_color": "#efefef",
|
||||
"display": "minimal-ui",
|
||||
"display": "standalone",
|
||||
"theme_color": "#3367d6",
|
||||
"screenshots" : [
|
||||
{
|
||||
|
|
|
@ -81,7 +81,7 @@ class PairDrop {
|
|||
}
|
||||
|
||||
onPwaInstallable(e) {
|
||||
if (!window.matchMedia('(display-mode: minimal-ui)').matches) {
|
||||
if (!window.matchMedia('(display-mode: standalone)').matches) {
|
||||
// only display install btn when not installed
|
||||
this.$headerInstallBtn.removeAttribute('hidden');
|
||||
this.$headerInstallBtn.addEventListener('click', () => {
|
||||
|
|
|
@ -357,7 +357,6 @@ class BackgroundCanvas {
|
|||
this.w = document.documentElement.clientWidth;
|
||||
this.h = document.documentElement.clientHeight;
|
||||
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
|
||||
|
||||
|
|
|
@ -899,7 +899,7 @@ x-peers:empty~x-instructions {
|
|||
|
||||
@media screen and (min-height: 800px) {
|
||||
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 */
|
||||
|
||||
:root {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue