- Use Tauri native theme APIs with Linux desktop preference support - Fall back to WebView theme detection for startup and browser preview - Add a follow-system option to both standard and beginner modes - Persist preferences and handle resume events and async race conditions - Add translations and theme behavior and UI regression tests
28 lines
898 B
HTML
28 lines
898 B
HTML
<!doctype html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<script>
|
|
(() => {
|
|
let savedTheme;
|
|
try {
|
|
savedTheme = localStorage.getItem('easy-cli-proxy-api.theme');
|
|
} catch {
|
|
}
|
|
const theme = savedTheme === 'light' || savedTheme === 'dark'
|
|
? savedTheme
|
|
: window.matchMedia?.('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
document.documentElement.dataset.theme = theme;
|
|
document.documentElement.style.colorScheme = theme;
|
|
document.documentElement.style.backgroundColor = theme === 'dark' ? '#111412' : '#f6f7f5';
|
|
})();
|
|
</script>
|
|
<title>EasyCLIProxyAPI</title>
|
|
</head>
|
|
<body>
|
|
<div id="root"></div>
|
|
<script type="module" src="/src/main.tsx"></script>
|
|
</body>
|
|
</html>
|