-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
59 lines (52 loc) · 1.79 KB
/
index.html
File metadata and controls
59 lines (52 loc) · 1.79 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
54
55
56
57
58
59
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ready2go :)</title>
<link rel="shortcut icon" href="/img/box.png" />
<style>
*{
margin: 0;
padding: 0;
}
body {
width: 100vw;
height: 100vh;
background-color: #f7f6f2;
display: flex;
flex-direction: column;
}
</style>
</head>
<body>
<!-- pc -->
<iframe src="https://johnnyorzjh.github.io/Ready2go_pc/" frameborder="0" style="width: 100%;height: 100%;display: none;" id="pc"></iframe>
<!-- phone -->
<iframe src="https://johnnyorzjh.github.io/Ready2go/" frameborder="0" style="width: 100%;height: 100%;display: none;" id="phone"></iframe>
<script>
function IsPC(){
// navigator浏览器变量 userAgent参数:主要告诉服务器,是什么设备
var userAgentInfo = navigator.userAgent;
var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");
// flag默认为pc模式 flag变量做判断用
var flag = true;
for (var v = 0; v < Agents.length; v++) {
if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; }
}
return flag;
}
let pc = document.getElementById('pc')
let phone = document.getElementById('phone')
if(IsPC())
{
pc.style.display = 'block'
}
else
{
phone.style.display = 'block'
}
</script>
</body>
</html>