mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-09 02:24:11 +08:00
- Introduce Lucide Icons via CDN for consistent SVG icons - Replace emoji icons with Lucide SVG icons in sidebar navigation - Fix Sessions/Explorer icon confusion (📁/📂 → history/folder-tree) - Update top bar icons (logo, theme toggle, search, refresh) - Update stats section icons with colored Lucide icons - Add icon animations support (animate-spin for loading states) - Update Explorer view with Lucide folder/file icons - Support dark/light theme icon adaptation Icon mapping: - Explorer: folder-tree (was 📂) - Sessions: history (was 📁) - Overview: bar-chart-3 - Active: play-circle - Archived: archive - Lite Plan: file-edit - Lite Fix: wrench - MCP Servers: plug - Hooks: webhook
50 lines
1.5 KiB
JavaScript
50 lines
1.5 KiB
JavaScript
// ==========================================
|
|
// THEME MANAGEMENT
|
|
// ==========================================
|
|
|
|
function initTheme() {
|
|
const saved = localStorage.getItem('theme') || 'light';
|
|
document.documentElement.setAttribute('data-theme', saved);
|
|
updateThemeIcon(saved);
|
|
updateHljsTheme(saved);
|
|
|
|
document.getElementById('themeToggle').addEventListener('click', () => {
|
|
const current = document.documentElement.getAttribute('data-theme');
|
|
const next = current === 'light' ? 'dark' : 'light';
|
|
document.documentElement.setAttribute('data-theme', next);
|
|
localStorage.setItem('theme', next);
|
|
updateThemeIcon(next);
|
|
updateHljsTheme(next);
|
|
});
|
|
}
|
|
|
|
function updateThemeIcon(theme) {
|
|
const darkIcon = document.querySelector('.theme-icon-dark');
|
|
const lightIcon = document.querySelector('.theme-icon-light');
|
|
if (darkIcon && lightIcon) {
|
|
if (theme === 'light') {
|
|
darkIcon.classList.remove('hidden');
|
|
lightIcon.classList.add('hidden');
|
|
} else {
|
|
darkIcon.classList.add('hidden');
|
|
lightIcon.classList.remove('hidden');
|
|
}
|
|
}
|
|
}
|
|
|
|
function updateHljsTheme(theme) {
|
|
// Toggle highlight.js theme stylesheets
|
|
const darkTheme = document.getElementById('hljs-theme-dark');
|
|
const lightTheme = document.getElementById('hljs-theme-light');
|
|
|
|
if (darkTheme && lightTheme) {
|
|
if (theme === 'dark') {
|
|
darkTheme.disabled = false;
|
|
lightTheme.disabled = true;
|
|
} else {
|
|
darkTheme.disabled = true;
|
|
lightTheme.disabled = false;
|
|
}
|
|
}
|
|
}
|