-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
51 lines (48 loc) 路 2.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="alternate icon" href="/favicon.ico">
<link rel="icon" type="image/svg+xml" href="/logo.svg">
<!-- 棰勮姹俽eact-simple-editor缁勪欢鐨刢ss鏂囦欢 -->
<!-- <link rel="preload" href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css" as="style" /> -->
<meta name="description" content="馃殏 Make terminal great again, chat to creation and action, power by chat-llm and langChain."/>
<link rel="apple-touch-icon" href="/icon192.png" />
<title>Acker - AI Hacker Arena</title>
</head>
<body class="font-sans bg-gray-100 dark:bg-[#17191f]">
<div id="app"></div>
<script>
const changeTheme = (theme) => {
const html = document.getElementsByTagName('html')[0];
html.classList.remove(theme === 'light' ? 'dark' : 'light');
html.classList.add(theme);
html.style.colorScheme = theme;
document.body.setAttribute('theme-mode', theme);
if (theme === 'light' && document.body.hasAttribute('theme-mode')) {
document.body.removeAttribute('theme-mode');
}
};
(function () {
const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
const setting = localStorage.getItem('theme') || 'auto';
if (setting === 'dark' || (prefersDark && setting !== 'light')) {
document.documentElement.classList.toggle('dark', true);
document.body.setAttribute('theme-mode', 'dark');
}
if (setting === 'auto' && typeof window.matchMedia === 'function') {
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (event) => {
const currentMode = event.matches ? 'dark' : 'light';
if (currentMode === 'dark') {
changeTheme('dark');
} else {
changeTheme('light');
}
});
}
})();
</script>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>