feat: server group

This commit is contained in:
hamster1963
2024-11-24 01:45:33 +08:00
parent 0fb3f4a6cf
commit fb38b0eb8a
10 changed files with 167 additions and 109 deletions

View File

@@ -5,13 +5,16 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script>
(function() {
const storageKey = 'vite-ui-theme';
const theme = localStorage.getItem(storageKey) || 'system';
(function () {
const storageKey = "vite-ui-theme";
const theme = localStorage.getItem(storageKey) || "system";
const root = document.documentElement;
if (theme === 'system') {
const systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
if (theme === "system") {
const systemTheme = window.matchMedia("(prefers-color-scheme: dark)")
.matches
? "dark"
: "light";
root.classList.add(systemTheme);
} else {
root.classList.add(theme);