-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
32 lines (32 loc) · 1.04 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/src/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>大屏可视化项目</title>
<script src="https://api.map.baidu.com/api?v=2.0&ak=FoPM9NctsHqa46SCMg1P9kTmx5k2pH5G"></script>
<script>
const clientWidth = document.documentElement.clientWidth;
const clientHeight = document.documentElement.clientHeight;
window.pageWidth =
clientWidth / clientHeight > 16 / 9
? clientHeight * (16 / 9)
: clientWidth;
window.pageHight = pageWidth / (16 / 9);
document.write(`
<style>html{font-size: ${pageWidth / 100}px}</style>
`);
</script>
</head>
<body>
<div id="root"></div>
<script>
const root = document.querySelector("#root");
root.style.width = pageWidth + "px";
root.style.height = pageHight + "px";
root.style.marginTop = (clientHeight - pageHight) / 2 + "px";
</script>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>