-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathindex.html
50 lines (43 loc) · 1.51 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<link rel="icon" type="image/svg+xml" href="/static/images/logo/logo64x64.ico"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>ES 3D Editor</title>
</head>
<body>
<div id="app"></div>
<script src="/sdk/msy.umd.cjs"></script>
<script type="module" src="/src/main.ts"></script>
<script>
window.URL = window.URL || window.webkitURL;
window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder;
Number.prototype.format = function () {
return this.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,');
};
/*添加自执行函数,为rem设置自适应的根DOM字体大小,1920px下默认1rem = 20px */
(function () {
change();
function change() {
const w = document.documentElement.clientWidth > 1280 ? document.documentElement.clientWidth : 1280;
document.documentElement.style.fontSize = w * 20 / 1920 + "px";
}
/*监听窗口大小的改变*/
window.addEventListener("resize", change, false);
})()
//屏蔽选中
document.onselectstart = function (event) {
if (window.event) {
event = window.event;
}
try {
const the = event.srcElement;
return (the.tagName === "INPUT" && the.type.toLowerCase() === "text") || the.tagName === "TEXTAREA";
} catch (e) {
return false;
}
}
</script>
</body>
</html>