-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
53 lines (51 loc) · 1.46 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
53
<!--
* @Description:
* @Author: 欧阳承珺
* @LastEditors: 欧阳承珺
* @Date: 2024-10-25 10:38:30
* @LastEditTime: 2024-10-28 15:37:53
-->
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>贵安新区全域数字化赋能门户</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
<script>
;(function (window, document) {
function resize() {
var ww = window.innerWidth
var dpr = window.devicePixelRatio
var scale = 1
// 适配2K
if (ww * dpr >= 1680) {
scale = Math.max(Math.min(dpr, 1.25), 1)
}
// 适配4K
if (ww * dpr >= 3800) {
scale = Math.max(Math.min(dpr, 2.5), 1)
}
// 苹果设备处理
var isMac = /macintosh|mac os x/i.test(window.navigator.userAgent)
var cardinal = 100
if (dpr >= 2 && isMac) {
cardinal = 160
}
document.documentElement.style.fontSize = (scale * cardinal) / dpr + 'px'
}
resize()
window.addEventListener('resize', resize)
window.addEventListener('pageshow', function (e) {
if (e.presisted) {
resize()
}
})
})(window, document)
</script>
</body>
</html>