-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.html
More file actions
53 lines (50 loc) · 1.61 KB
/
app.html
File metadata and controls
53 lines (50 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title></title>
<style>
html,
body {
margin: 0;
width: 100vw;
height: 100vh;
}
</style>
</head>
<body>
<div id="weixin"
style="display: none;width: 100vw;height: 100vh;background-image: url(openbrowser.png);background-color: #37474F;background-repeat: no-repeat;background-size: contain;background-position-x: right;">
</div>
<div id="iphone" style="display: none;">
<a href="itms-services:///?action=download-manifest&url=https://caocong1.github.io/app.plist">点击下载并安装</a>
</div>
<div id="android" style="display: none;">
<a href="#">点击下载并安装APK</a>
</div>
<script>
const isWeiXin = () => {
var ua = window.navigator.userAgent.toLowerCase()
return ua.match(/micromessenger/i) == 'micromessenger'
}
const isiPhone = () => {
var ua = window.navigator.userAgent.toLowerCase()
return ua.match(/iphone/i) == 'iphone'
}
const isAndroid = () => {
var ua = window.navigator.userAgent.toLowerCase()
return ua.match(/android/i) == 'android'
}
if (isWeiXin()) {
document.getElementById('weixin').style.display = 'block'
} else if (isiPhone()) {
document.getElementById('iphone').style.display = 'block'
} else if (isAndroid()) {
document.getElementById('android').style.display = 'block'
}
</script>
</body>
</html>