-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
41 lines (40 loc) · 1.14 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>十周年</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
<meta name="screen-orientation" content="portrait">
<meta name="x5-orientation" content="portrait">
<script type="text/javascript">
var docEl = document.documentElement,dpr;
if(window.devicePixelRatio >=2 ){
dpr = 2
}
if(docEl.clientHeight / docEl.clientWidth < 1.4){
window.pageWidth = docEl.clientHeight * 375 / 667;
}else {
window.pageWidth = docEl.clientWidth
}
var fontSize = window.pageWidth * dpr / 10;
console.log(dpr)
docEl.style.fontSize = fontSize + 'px';
window.addEventListener("orientationchange",function(){
if(window.orientation == 0) // Portrait
{
//alert("Portrait");
location.reload();
}
else // Landscape
{
//alert("Landscape");
location.reload();
}
});
</script>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>