2022-08-06 20:25:26 +02:00
|
|
|
{{ define "main" }}
|
|
|
|
<div class="main-content">
|
|
|
|
<section class="component download pb-0">
|
|
|
|
<div class="container h-100">
|
|
|
|
<picture class="download-mobile-image d-block d-lg-none">
|
2022-08-06 21:19:03 +02:00
|
|
|
<img class="download-mobile-image" src="{{site.BaseURL}}/assets/img/favicon.png" title="{{site.Params.appName}} App" alt="{{site.Params.appName}}-App Smartphone" loading="lazy" />
|
2022-08-06 20:25:26 +02:00
|
|
|
</picture>
|
|
|
|
<div class="row align-items-end align-items-lg-center justify-content-lg-between h-100">
|
|
|
|
<div class="col col-12 col-lg-6 bg-white p-3">
|
|
|
|
<h1 class="headline headline-heavy" id="headline">{{ .Title }}</h1>
|
|
|
|
<h1 class="headline headline-heavy d-none" id="infoUnsupported">{{ i18n "infoUnsupported" site.Params.appName }}</h1>
|
|
|
|
<div class="lead d-none" id="lead">
|
|
|
|
{{ .Content }}
|
|
|
|
</div>
|
2022-08-06 22:21:36 +02:00
|
|
|
<p class="warning d-none" id="warning-ios">{{ i18n "warningIOS" }}</p>
|
|
|
|
<p class="warning d-none" id="warning-android">{{ i18n "warningAndroid" }}</p>
|
|
|
|
<h1 class="headline headline-heavy d-none" id="info-ios">{{ i18n "infoIOS" }}</h1>
|
|
|
|
<h1 class="headline headline-heavy d-none" id="info-android">{{ i18n "infoAndroid" }}</h1>
|
2022-08-06 20:25:26 +02:00
|
|
|
<a class="d-none originalUrl" id="directUrl" href="" target="_blank" rel="noopener noreferrer">{{ i18n "directUrl" site.Params.appName }}</a>
|
|
|
|
<a class="d-none originalUrl" id="alternativeUrl" href="" target="_blank" rel="noopener noreferrer">{{ default (i18n "alternativeUrl") .Page.Params.alternativeUrlDescription }}</a>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<p class="lead d-none" id="downloadInfo">{{ i18n "downloadInfo" }}</p>
|
|
|
|
{{ range site.Params.stores }}
|
|
|
|
<div class="col col-12 col-md-6 mb-3" id="store_{{ .id }}">
|
|
|
|
<a href="{{ .url }}" target="_blank" rel="noopener noreferrer">
|
|
|
|
<img class="img-fluid w-100" src="{{ .badge }}" alt="{{ .name }} Icon" />
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col col-12 col-sm-12 col-md-12 col-lg-5 d-none d-lg-block">
|
2022-08-06 21:19:03 +02:00
|
|
|
<img class="section-main-image" src="{{site.BaseURL}}/assets/img/favicon.png" title="{{site.Params.appName}} App" alt="{{site.Params.appName}}-App Smartphone" loading="lazy" />
|
2022-08-06 20:25:26 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
|
2022-08-06 21:21:31 +02:00
|
|
|
<script src="{{site.BaseURL}}/assets/js/ua-parser.pack.js"></script>
|
2022-08-06 20:25:26 +02:00
|
|
|
|
|
|
|
<script>
|
2022-08-06 22:21:36 +02:00
|
|
|
const Platforms = { "android": "android", "ios": "ios", "Unsupported": "Unsupported" };
|
2022-08-06 20:25:26 +02:00
|
|
|
Object.freeze(Platforms);
|
|
|
|
const DirectLinkingCompatibility = { "Full": "Full", "Manual": "Manual", "None": "None" };
|
|
|
|
Object.freeze(DirectLinkingCompatibility);
|
|
|
|
|
|
|
|
document.addEventListener("DOMContentLoaded", () => {
|
|
|
|
let parser = new UAParser();
|
|
|
|
|
|
|
|
let platform;
|
2022-08-06 22:22:49 +02:00
|
|
|
if (Platforms.hasOwnProperty(parser.getOS().name.toLowerCase()))
|
2022-08-06 22:21:36 +02:00
|
|
|
platform = parser.getOS().name.toLowerCase();
|
2022-08-06 20:25:26 +02:00
|
|
|
else
|
|
|
|
platform = Platforms.Unsupported;
|
|
|
|
|
|
|
|
console.log("Detected platform: ", platform);
|
|
|
|
console.log("Detected browser: ", parser.getBrowser().name);
|
|
|
|
|
|
|
|
const directLinkingCompatibility = {
|
2022-08-06 22:21:36 +02:00
|
|
|
"android": parser.getBrowser().name === "Chrome" ?
|
2022-08-06 20:25:26 +02:00
|
|
|
DirectLinkingCompatibility.Full :
|
|
|
|
(parser.getBrowser().name === "Firefox" ?
|
|
|
|
DirectLinkingCompatibility.Manual :
|
|
|
|
DirectLinkingCompatibility.None),
|
|
|
|
|
2022-08-06 22:21:36 +02:00
|
|
|
"ios": parser.getBrowser().name === "Mobile Safari" ?
|
2022-08-06 20:25:26 +02:00
|
|
|
DirectLinkingCompatibility.Manual :
|
|
|
|
DirectLinkingCompatibility.None,
|
|
|
|
|
|
|
|
"Unsupported": DirectLinkingCompatibility.None
|
|
|
|
}[platform];
|
|
|
|
|
|
|
|
console.log("Direct linking compatibility: ", directLinkingCompatibility);
|
|
|
|
|
|
|
|
const originalQuery = sessionStorage.getItem('originalQuery');
|
2022-08-06 21:26:01 +02:00
|
|
|
console.log("Original query:", originalQuery);
|
2022-08-06 20:25:26 +02:00
|
|
|
sessionStorage.removeItem('originalQuery');
|
|
|
|
let directUrl;
|
|
|
|
let alternativeUrl;
|
|
|
|
if (originalQuery) {
|
2022-08-06 21:19:03 +02:00
|
|
|
directUrl = "{{ site.BaseURL }}/" + originalQuery;
|
|
|
|
alternativeUrl = "{{ site.Params.alternativeUrl }}/" + originalQuery;
|
2022-08-06 20:25:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
window.history.replaceState({}, document.title, window.location.protocol + "//" + window.location.host + "/" + (originalQuery ? originalQuery:""));
|
|
|
|
|
|
|
|
if (directUrl && directLinkingCompatibility !== DirectLinkingCompatibility.None) {
|
|
|
|
const directUrlElement = document.getElementById("directUrl");
|
|
|
|
directUrlElement.classList.remove("d-none");
|
|
|
|
directUrlElement.href = directUrl;
|
|
|
|
|
|
|
|
if (directLinkingCompatibility === DirectLinkingCompatibility.Manual)
|
2022-08-06 22:21:36 +02:00
|
|
|
document.getElementById("info-" + platform).classList.remove("d-none");
|
2022-08-06 20:25:26 +02:00
|
|
|
|
|
|
|
document.getElementById("downloadInfo").classList.remove("d-none");
|
|
|
|
document.getElementById("headline").classList.add("d-none");
|
|
|
|
}
|
|
|
|
else if (directUrl && platform !== Platforms.Unsupported && directLinkingCompatibility === DirectLinkingCompatibility.None) {
|
2022-08-06 22:21:36 +02:00
|
|
|
document.getElementById("warning-" + platform).classList.remove("d-none");
|
2022-08-06 20:25:26 +02:00
|
|
|
document.getElementById("downloadInfo").classList.remove("d-none");
|
|
|
|
document.getElementById("headline").classList.add("d-none");
|
|
|
|
}
|
|
|
|
else if (directUrl && platform === Platforms.Unsupported) {
|
|
|
|
const alternativeUrlElement = document.getElementById("alternativeUrl");
|
|
|
|
alternativeUrlElement.classList.remove("d-none");
|
|
|
|
alternativeUrlElement.href = alternativeUrl;
|
|
|
|
document.getElementById("infoUnsupported").classList.remove("d-none");
|
|
|
|
document.getElementById("headline").classList.add("d-none");
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (platform) {
|
2022-08-06 22:21:36 +02:00
|
|
|
case Platforms.ios:
|
|
|
|
document.getElementById("store_google").classList.add("d-none");
|
2022-08-06 20:25:26 +02:00
|
|
|
break;
|
2022-08-06 22:21:36 +02:00
|
|
|
case Platforms.android:
|
2022-08-06 20:25:26 +02:00
|
|
|
document.getElementById("store_apple").classList.add("d-none");
|
|
|
|
break;
|
|
|
|
case Platforms.Unsupported:
|
|
|
|
document.getElementById("lead").classList.remove("d-none");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
{{ end }}
|