pwa install stuff
This commit is contained in:
@@ -1,10 +1,14 @@
|
|||||||
<!DOCTYPE html><html><head>
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
<base href="/">
|
<base href="/">
|
||||||
|
|
||||||
<!-- APP Description -->
|
<!-- APP Description -->
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
|
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
|
||||||
<meta name="description" content="Digitizing Mzansi one process at a time. Discover essential Mzansi apps to streamline your personal and professional life. Simplify your daily tasks with our user-friendly solutions.">
|
<meta name="description"
|
||||||
|
content="Digitizing Mzansi one process at a time. Discover essential Mzansi apps to streamline your personal and professional life. Simplify your daily tasks with our user-friendly solutions.">
|
||||||
|
|
||||||
<!-- iOS meta tags & icons -->
|
<!-- iOS meta tags & icons -->
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
@@ -27,9 +31,40 @@
|
|||||||
|
|
||||||
|
|
||||||
<!-- Splash screen -->
|
<!-- Splash screen -->
|
||||||
|
|
||||||
|
|
||||||
<script src="install_pwa.js" defer=""></script>
|
<!-- <script src="install_pwa.js" defer=""></script> -->
|
||||||
|
<!-- Capture PWA install prompt event -->
|
||||||
|
<script>
|
||||||
|
let deferredPrompt;
|
||||||
|
|
||||||
|
window.addEventListener('beforeinstallprompt', (e) => {
|
||||||
|
deferredPrompt = e;
|
||||||
|
});
|
||||||
|
|
||||||
|
function promptInstall() {
|
||||||
|
deferredPrompt.prompt();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Listen for app install event
|
||||||
|
window.addEventListener('appinstalled', () => {
|
||||||
|
deferredPrompt = null;
|
||||||
|
appInstalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Track how PWA was launched (either from browser or as PWA)
|
||||||
|
function getLaunchMode() {
|
||||||
|
const isStandalone = window.matchMedia('(display-mode: standalone)').matches;
|
||||||
|
if (deferredPrompt) hasPrompt();
|
||||||
|
if (document.referrer.startsWith('android-app://')) {
|
||||||
|
appLaunchedAsTWA();
|
||||||
|
} else if (navigator.standalone || isStandalone) {
|
||||||
|
appLaunchedAsPWA();
|
||||||
|
} else {
|
||||||
|
window.appLaunchedInBrowser();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
<!-- Splash screen -->
|
<!-- Splash screen -->
|
||||||
<!-- <script>
|
<!-- <script>
|
||||||
var dartPdfJsBaseUrl = "https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.2.146/";
|
var dartPdfJsBaseUrl = "https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.2.146/";
|
||||||
@@ -44,7 +79,7 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
background-color: #3A4454;
|
background-color: #3A4454;
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.center {
|
.center {
|
||||||
@@ -57,19 +92,22 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.contain {
|
.contain {
|
||||||
display:block;
|
display: block;
|
||||||
width:100%; height:100%;
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stretch {
|
.stretch {
|
||||||
display:block;
|
display: block;
|
||||||
width:100%; height:100%;
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cover {
|
.cover {
|
||||||
display:block;
|
display: block;
|
||||||
width:100%; height:100%;
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,17 +142,25 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<picture id="splash-branding">
|
<picture id="splash-branding">
|
||||||
<source srcset="splash/img/branding-1x.png 1x, splash/img/branding-2x.png 2x, splash/img/branding-3x.png 3x, splash/img/branding-4x.png 4x" media="(prefers-color-scheme: light)">
|
<source
|
||||||
<source srcset="splash/img/branding-dark-1x.png 1x, splash/img/branding-dark-2x.png 2x, splash/img/branding-dark-3x.png 3x, splash/img/branding-dark-4x.png 4x" media="(prefers-color-scheme: dark)">
|
srcset="splash/img/branding-1x.png 1x, splash/img/branding-2x.png 2x, splash/img/branding-3x.png 3x, splash/img/branding-4x.png 4x"
|
||||||
|
media="(prefers-color-scheme: light)">
|
||||||
|
<source
|
||||||
|
srcset="splash/img/branding-dark-1x.png 1x, splash/img/branding-dark-2x.png 2x, splash/img/branding-dark-3x.png 3x, splash/img/branding-dark-4x.png 4x"
|
||||||
|
media="(prefers-color-scheme: dark)">
|
||||||
<img class="bottom" aria-hidden="true" src="splash/img/branding-1x.png" alt="">
|
<img class="bottom" aria-hidden="true" src="splash/img/branding-1x.png" alt="">
|
||||||
</picture>
|
</picture>
|
||||||
<picture id="splash">
|
<picture id="splash">
|
||||||
<source srcset="splash/img/light-1x.png 1x, splash/img/light-2x.png 2x, splash/img/light-3x.png 3x, splash/img/light-4x.png 4x" media="(prefers-color-scheme: light)">
|
<source
|
||||||
<source srcset="splash/img/dark-1x.png 1x, splash/img/dark-2x.png 2x, splash/img/dark-3x.png 3x, splash/img/dark-4x.png 4x" media="(prefers-color-scheme: dark)">
|
srcset="splash/img/light-1x.png 1x, splash/img/light-2x.png 2x, splash/img/light-3x.png 3x, splash/img/light-4x.png 4x"
|
||||||
<img class="center" aria-hidden="true" src="splash/img/light-1x.png" alt="">
|
media="(prefers-color-scheme: light)">
|
||||||
|
<source
|
||||||
|
srcset="splash/img/dark-1x.png 1x, splash/img/dark-2x.png 2x, splash/img/dark-3x.png 3x, splash/img/dark-4x.png 4x"
|
||||||
|
media="(prefers-color-scheme: dark)">
|
||||||
|
<img class="center" aria-hidden="true" src="splash/img/light-1x.png" alt="">
|
||||||
</picture>
|
</picture>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Versioning -->
|
<!-- Versioning -->
|
||||||
<!-- <script src="flutter.js" defer></script> -->
|
<!-- <script src="flutter.js" defer></script> -->
|
||||||
@@ -248,8 +294,11 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script id="pdfjs-lib" src="//cdnjs.cloudflare.com/ajax/libs/pdf.js/3.2.146/pdf.min.js" defer=""></script>
|
<script id="pdfjs-lib" src="//cdnjs.cloudflare.com/ajax/libs/pdf.js/3.2.146/pdf.min.js" defer=""></script>
|
||||||
<script id="pdfjs-worker" type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/pdf.js/3.2.146/pdf.worker.min.js" defer=""></script>
|
<script id="pdfjs-worker" type="text/javascript"
|
||||||
<!--------------------->
|
src="//cdnjs.cloudflare.com/ajax/libs/pdf.js/3.2.146/pdf.worker.min.js" defer=""></script>
|
||||||
|
<!--------------------->
|
||||||
|
|
||||||
</body><!-- File Picker & PDF viewer --></html>
|
</body><!-- File Picker & PDF viewer -->
|
||||||
|
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user