-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
38 lines (38 loc) · 1.52 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="常磐大逃杀是一款多人在线文字游戏,玩家需要制定战术并在危机四伏的世界中生存。在常磐大逃杀迎接你的终极冒险吧!" />
<link rel="stylesheet" id="css-color" href="/css/purple.css">
<link rel="stylesheet" id="css-theme" href="/css/light.css">
<title>常磐大逃杀</title>
</head>
<body class="bg-surface">
<script>
const setTheme = (type, value) => {
if (type === 'font') {
document.documentElement.style.fontFamily = value
}
if (type === 'size') {
document.documentElement.style.fontSize = `${value}px`
}
if (type === 'theme') {
const cssFile = document.querySelector('link[id="css-theme"]')
cssFile?.setAttribute('href', `/css/${value}.css`)
}
if (type === 'color') {
const cssFile = document.querySelector('link[id="css-color"]')
cssFile?.setAttribute('href', `/css/${value}.css`)
}
}
const setting = JSON.parse(localStorage.getItem('setting') || '{}')
Object.keys(setting).forEach(key => {
setTheme(key, setting[key])
})
</script>
<div id="app" class="overflow-x-hidden <md:(select-none touch-none h-screen)"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>