Skip to content

Commit eca41f3

Browse files
Merge pull request #374 from schlagmichdoch/pwa_standalone
Enable standalone mode for PWA
2 parents 8826893 + 1d0d3d0 commit eca41f3

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

public/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<meta name="theme-color" content="#3367d6">
1111
<meta name="color-scheme" content="dark light">
1212
<meta name="apple-mobile-web-app-capable" content="yes">
13+
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
1314
<meta name="apple-mobile-web-app-title" content="PairDrop">
1415
<meta name="application-name" content="PairDrop">
1516
<!-- Descriptions -->
@@ -841,4 +842,4 @@ <h3>PairDrop works only with JavaScript</h3>
841842
</x-noscript>
842843
</noscript>
843844
</body>
844-
</html>
845+
</html>

public/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
}
2727
],
2828
"background_color": "#efefef",
29-
"display": "minimal-ui",
29+
"display": "standalone",
3030
"theme_color": "#3367d6",
3131
"screenshots" : [
3232
{

public/scripts/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class PairDrop {
8181
}
8282

8383
onPwaInstallable(e) {
84-
if (!window.matchMedia('(display-mode: minimal-ui)').matches) {
84+
if (!window.matchMedia('(display-mode: standalone)').matches) {
8585
// only display install btn when not installed
8686
this.$headerInstallBtn.removeAttribute('hidden');
8787
this.$headerInstallBtn.addEventListener('click', () => {

public/scripts/ui-main.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,6 @@ class BackgroundCanvas {
357357
this.w = document.documentElement.clientWidth;
358358
this.h = document.documentElement.clientHeight;
359359
this.offset = this.$footer.offsetHeight - 27;
360-
if (this.h >= 800) this.offset += 10;
361360

362361
if (oldW === this.w && oldH === this.h && oldOffset === this.offset) return; // nothing has changed
363362

public/styles/styles-main.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ x-peers:empty~x-instructions {
899899

900900
@media screen and (min-height: 800px) {
901901
footer {
902-
margin-bottom: 16px;
902+
padding-bottom: 10px;
903903
}
904904
}
905905

@@ -909,6 +909,13 @@ x-peers:empty~x-instructions {
909909
}
910910
}
911911

912+
/* PWA Standalone styles */
913+
@media all and (display-mode: standalone) {
914+
footer {
915+
padding-bottom: 34px;
916+
}
917+
}
918+
912919
/* Constants */
913920

914921
:root {

0 commit comments

Comments
 (0)