优化渲染逻辑
This commit is contained in:
@@ -9,6 +9,15 @@
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="/css/style.css">
|
||||
<script>
|
||||
// Prevent theme flicker
|
||||
(function() {
|
||||
const savedTheme = localStorage.getItem('theme');
|
||||
if (savedTheme === 'light') {
|
||||
document.documentElement.classList.add('light-theme');
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Animated Background -->
|
||||
|
||||
@@ -129,6 +129,11 @@
|
||||
fetchMetrics();
|
||||
fetchNetworkHistory();
|
||||
loadSiteSettings();
|
||||
|
||||
// Initial icon check based on early head script
|
||||
const currentTheme = document.documentElement.classList.contains('light-theme') ? 'light' : 'dark';
|
||||
updateThemeIcons(currentTheme);
|
||||
|
||||
setInterval(fetchMetrics, REFRESH_INTERVAL);
|
||||
setInterval(fetchNetworkHistory, NETWORK_HISTORY_INTERVAL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user