-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
34 lines (34 loc) · 1.3 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>y</title>
<script>
// set font size of root element for rem
(function (doc, win) {
var docEl = doc.documentElement,
resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
recalc = function () {
var clientWidth = docEl.clientWidth;
if (!clientWidth) return;
// use 1600px as max width
clientWidth = clientWidth > 750 ? 750 : clientWidth;
docEl.style.fontSize = 100 * (clientWidth / 750) + 'px';
};
// add event listener to recalculate
win.addEventListener(resizeEvt, recalc);
// calculate when DOMContentLoaded
doc.addEventListener('DOMContentLoaded', function () {
recalc();
// show body after calculating to avoid user see the calculation process
doc.getElementsByTagName('body')[0].setAttribute('style', 'display: block;');
});
})(document, window);
</script>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>