mirror of
https://github.com/yibaiba/hideck.git
synced 2026-12-05 08:01:10 +00:00
Add a locale catalog and switcher. The console language is stored in the browser; the sidebar gear toggles it, and the login page keeps a dedicated control.
50 lines
1.1 KiB
HTML
50 lines
1.1 KiB
HTML
<!doctype html>
|
|
<html lang="zh-CN">
|
|
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>HiDeck</title>
|
|
<script>
|
|
try {
|
|
const theme = localStorage.getItem('theme')
|
|
const dark = theme === 'dark' || theme === 'navy-night' || theme === 'classic'
|
|
document.documentElement.classList.toggle('dark', dark)
|
|
document.documentElement.classList.toggle('classic', theme === 'classic')
|
|
const locale = localStorage.getItem('hideck_locale')
|
|
document.documentElement.lang = locale === 'en' || locale === 'en-US' || locale === 'en-GB' ? 'en' : 'zh-CN'
|
|
} catch { }
|
|
</script>
|
|
<style>
|
|
:root {
|
|
color-scheme: light dark;
|
|
}
|
|
|
|
html,
|
|
body {
|
|
height: 100%;
|
|
margin: 0;
|
|
}
|
|
|
|
body {
|
|
background: #FBF9F6;
|
|
}
|
|
|
|
html.dark body {
|
|
background: #0B1420;
|
|
}
|
|
|
|
html.classic body {
|
|
background: #0d1518;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="app"></div>
|
|
<script type="module" src="/src/main.ts"></script>
|
|
</body>
|
|
|
|
</html>
|