-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
22 lines (19 loc) · 834 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
document.addEventListener('DOMContentLoaded', function () {
const userAgent = navigator.userAgent || navigator.vendor || window.opera;
const appStoreButton = document.getElementById('appStoreButton');
const androidButton = document.getElementById('androidButton');
const webButton = document.getElementById('webButton');
const iosImg = document.getElementById('iosImg');
const androidImg = document.getElementById('androidImg');
const webImg = document.getElementById('webImg');
if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
appStoreButton.style.display = 'flex';
iosImg.style.display = 'block';
} else if (/android/i.test(userAgent)) {
androidButton.style.display = 'flex';
androidImg.style.display = 'block';
} else {
webButton.style.display = 'flex';
webImg.style.display = 'block';
}
});