-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
52 lines (48 loc) · 1.58 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1.0,user-scalable=no,minimal-ui">
<script>
window.desginWidth = 750;
window.refresh = 1;
! function (e, t, n) {
function r() {
var e = s.getBoundingClientRect().width;
e > 640 && (e = 640);
var t = 100 * e / desginWidth;
s.style.fontSize = t + "px", a.rem = t;
var n = parseFloat(window.getComputedStyle(document.documentElement)["font-size"]);
if (n !== t && n > 0 && Math.abs(n - t) > 1) {
var r = t * t / n;
s.style.fontSize = r + "px"
}
}
function i() {
clearTimeout(o), o = setTimeout(r, 100)
}
var o, a = {},
s = e.document.documentElement;
n && e.addEventListener("resize", function () {
i()
}, !1), n && e.addEventListener("pageshow", function (e) {
e.persisted && i()
}, !1), r(), a.refreshRem = r, a.rem2px = function (e) {
var t = parseFloat(e) * this.rem;
return "string" == typeof e && e.match(/rem$/) && (t += "px"), t
}, a.px2rem = function (e) {
var t = parseFloat(e) / this.rem;
return "string" == typeof e && e.match(/px$/) && (t += "rem"), t
}, e.remCalc = a
}(window, window.desginWidth, window.refresh);
</script>
</head>
<body>
<a href="#/">目录</a>
<div id="main">
<div class="container" id="container">
</div>
</div>
<script src="https://cdn.bootcss.com/Director/1.2.8/director.min.js"></script>
</body>
</html>