forked from Louiszhai/canvas-draw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
25 lines (25 loc) · 790 Bytes
/
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
<title>canvas-draw</title>
</head>
<body>
<div id="app"></div>
</body>
<script>
(function(defaultFontSize, defaultScreenWidth) {
var htmlNode = document.getElementsByTagName('html')[0];
function resize() {
var screenWidth = document.body.offsetWidth;
var fontSize = (screenWidth / defaultScreenWidth) * defaultFontSize;
htmlNode.style.fontSize = fontSize + 'px';
}
document.addEventListener('DOMContentLoaded', function() {
resize();
});
window.addEventListener('resize', resize);
})(10, 375);
</script>
</html>