-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.html
More file actions
42 lines (42 loc) · 1.04 KB
/
app.html
File metadata and controls
42 lines (42 loc) · 1.04 KB
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
<!DOCTYPE html>
<html {{ HTML_ATTRS }}>
<head>
{{ HEAD }}
<script>
let uaInfo = navigator.userAgent
let agents = ['Android', 'iPhone',
'SymbianOS', 'Windows Phone',
'iPod']
let flag = true
for (let v = 0; v < agents.length; v++) {
if (uaInfo.indexOf(agents[v]) > 0) {
flag = false
break
}
}
if (!flag) {
window.isResponsive = true
} else {
window.isResponsive = false
}
</script>
<script>
function resize () {
function r () {
let rootSize = document.documentElement.clientWidth / 375 * 100
document.documentElement.style.fontSize = rootSize + 'px'
}
r()
window.addEventListener('orientationchange' in window ? 'orientationchange' : 'resize', r, false)
}
if (window.isResponsive) {
resize()
} else {
document.documentElement.style.fontSize = '100px'
}
</script>
</head>
<body {{ BODY_ATTRS }}>
{{ APP }}
</body>
</html>