-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
30 lines (30 loc) · 1.05 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
<!DOCTYPE html>
<html style="position:relative; height:100%;font-size:100px">
<head>
<meta charset="utf-8">
<meta name="viewport"
content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>introduce myself</title>
</head>
<body style="position:relative; height:100%;">
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<script>
(function (doc, win) { // 这里以苹果6为基准做的
let [docEl, resizeEvt] = [doc.documentElement, 'orientationchange' in window ? 'orientationchange' : 'resize']
let recalc = function () {
let clientWidth = docEl.clientWidth
if (!clientWidth) return
if (clientWidth >= 750) {
docEl.style.fontSize = '100px'
} else {
docEl.style.fontSize = 100 * clientWidth / 750 + 'px'
}
}
if (!doc.addEventListener) return
win.addEventListener(resizeEvt, recalc, false)
doc.addEventListener('DOMContentLoaded', recalc, false)
})(document, window)
</script>