-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
112 lines (104 loc) · 3.67 KB
/
index.html
File metadata and controls
112 lines (104 loc) · 3.67 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
/>
<meta
http-equiv="Content-Security-Policy"
content="default-src *;
img-src * 'self' data: blob:; script-src 'self' 'unsafe-inline' 'unsafe-eval' *;
style-src 'self' 'unsafe-inline' *"
/>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<meta http-equiv="Expires" content="0" />
<meta http-equiv="Pragma" content="no-store" />
<meta http-equiv="Cache-control" content="no-store no-cache, no-store must-revalidate" />
<meta http-equiv="Cache" content="no-store " />
<!-- <link rel="alternate icon" href="/favicon.ico" type="image/png" sizes="16x16" /> -->
<link rel="apple-touch-icon" href="/apple-touch-icon.png" sizes="180x180" />
<link rel="mask-icon" href="pwa-512x512.png" color="#FFFFFF" />
<meta name="theme-color" content="#ffffff" />
<title>IDChat | Decentralized Messenger Built on Bitcoin</title>
<meta
name="description"
content="IDChat | Decentralized Messenger Built on Bitcoin"
/>
<meta
name="keywords"
content="IDChat | Decentralized Messenger Built on Bitcoin"
/>
<!-- 要动态更改 icon 所以不初始化设置 -->
<!-- <link rel="icon" key="favicon" href="/favicon.ico" /> -->
<style>
@font-face {
font-family: 'SF-Pro-Regular';
src: url('./public/fonts/SF_PRO_Regular.ttf');
}
@font-face {
font-family: 'J20';
src: url('./public/fonts/Jersey20-Regular.ttf');
}
</style>
<script>
function rem(doc, win, designSize, htmlFontSize) {
var docEl = doc.documentElement,
isIOS = navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
dpr = isIOS ? Math.min(win.devicePixelRatio, 3) : 1,
dpr = window.top === window.self ? dpr : 1, //被iframe引用时,禁止缩放
resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'
docEl.dataset.dpr = dpr
var recalc = function() {
var width = docEl.clientWidth
if (width / dpr > designSize) {
width = designSize * dpr
}
docEl.dataset.width = width
docEl.dataset.percent = htmlFontSize * (width / designSize)
var fontSize = htmlFontSize * (width / designSize)
let minFontSize = 90
var agent = navigator.userAgent.toLowerCase()
// 微信浏览器
if (agent.match(/MicroMessenger/i) == 'micromessenger') {
minFontSize = 62
}
if (fontSize < minFontSize) {
fontSize = minFontSize
}
docEl.style.fontSize = fontSize + 'px'
}
recalc()
if (!doc.addEventListener) return
win.addEventListener(resizeEvt, recalc, false)
}
rem(document, window, parseFloat("1920"), 100)
</script>
<script>
if (
localStorage.theme === 'dark' ||
(!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)
) {
document.documentElement.classList.add('dark')
} else {
document.documentElement.classList.remove('dark')
}
// 计算屏幕宽度
function calculateVh() {
var vh = window.innerHeight * 0.01
document.documentElement.style.setProperty('--vh', vh + 'px')
}
// Initial calculation
calculateVh()
// Re-calculate on resize
window.addEventListener('resize', calculateVh)
// Re-calculate on device orientation change
window.addEventListener('orientationchange', calculateVh)
</script>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>