-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
83 lines (82 loc) · 2.48 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<!-- <script>
function patch(s){
var re= /\?/ig
var m = s.match(re)
if (m) {
return m.length
} else {
return 0
}
}
var href = window.location.href
if (window.location.href.indexOf('version') == -1) {
var toHref = ''
var patchLength = patch(href)
if (/singlemessage|groupmessage|timeline/g.test(href)) {
// weixin
if(patchLength == 1) {
toHref = href + '?version=' + new Date().getTime()
} else {
toHref = href + '&version=' + new Date().getTime()
}
} else {
if(patchLength == 1) {
toHref = href + '&version=' + new Date().getTime()
} else {
toHref = href + '?version=' + new Date().getTime()
}
}
window.location.replace(decodeURIComponent(toHref))
}
</script> -->
<script>
(function (doc, win) {
var docEl = doc.documentElement,
resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
recalc = function () {
var clientWidth = docEl.clientWidth;
if (!clientWidth) return;
if(clientWidth>=750){
docEl.style.fontSize = '50px';
}else{
docEl.style.fontSize = 100 * (clientWidth / 750) + 'px';
}
};
if (!doc.addEventListener) return;
win.addEventListener(resizeEvt, recalc, false);
doc.addEventListener('DOMContentLoaded', recalc, false);
})(document, window);
var isAndroid = window.navigator.appVersion.match(/android/gi);
var isIPhone = window.navigator.appVersion.match(/iphone/gi);
var dpr = 1
var devicePixelRatio = window.devicePixelRatio;
if (isIPhone) {
if (devicePixelRatio >= 3 && (!dpr || dpr >= 3)) {
dpr = 3;
} else if (devicePixelRatio >= 2 && (!dpr || dpr >= 2)){
dpr = 2;
} else {
dpr = 1;
}
} else {
dpr = 1;
}
if (isIPhone) {
document.documentElement.className = 'ios'
document.documentElement.setAttribute('data-dpr', dpr)
}
window.sessionStorage.clear()
</script>
<title>牛霸霸屏</title>
</head>
<body>
<div id="app-box"></div>
<!-- built files will be auto injected -->
<script src="https://cdn.bootcss.com/zepto/1.2.0/zepto.min.js"></script>
</body>
</html>