Skip to content

Commit

Permalink
Create index.htm
Browse files Browse the repository at this point in the history
  • Loading branch information
bjarteolsen committed Dec 9, 2024
1 parent 499a551 commit 0fe0e4a
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions public/download/index.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />


<script>
function getMobileOperatingSystem() {
var userAgent = navigator.userAgent || navigator.vendor || window.opera;

if (/android/i.test(userAgent)) {
return "Android";
}

// iOS detection from: http://stackoverflow.com/a/9039885/177710
if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
return "iOS";
}

return "unknown";
}</script>

<script>
function DetectAndServe(){
let os = getMobileOperatingSystem();
if (os == "Android") {
window.location.href = "https://play.google.com/store/apps/details?id=com.kjellhaaland.matlat";
} else if (os == "iOS") {
window.location.href = "https://apps.apple.com/us/app/matlat/id6450923842";
} else {
window.location.href = "https://matlat.no";
}
}
</script>
</head>
<body onload="DetectAndServe()">
</body>
</html>

0 comments on commit 0fe0e4a

Please sign in to comment.