refactor: remove dark mode implementation and theme toggle logic

This commit is contained in:
sebvtl728 2026-05-21 20:48:47 +02:00
parent e0927229ee
commit 2be3317b0b

View File

@ -60,46 +60,6 @@
--color-a-dark: hsl(36, 95%, 22%);
}
/* Dark Mode Custom Overrides */
body.dark-mode {
--bg-primary: #090d16;
--bg-secondary: #111827;
--bg-tertiary: #1f2937;
--primary-light: hsl(247, 40%, 16%);
--primary-dark: hsl(247, 85%, 80%);
--color-text-primary: #f8fafc;
--color-text-secondary: #94a3b8;
--color-text-tertiary: #64748b;
--color-border-primary: #1e293b;
--color-border-secondary: #334155;
--color-border-tertiary: #1f2937;
/* Purple theme dark */
--color-p-bg: hsl(250, 45%, 12%);
--color-p-border: hsl(250, 40%, 20%);
--color-p-accent: hsl(250, 80%, 68%);
--color-p-dark: hsl(250, 90%, 85%);
/* Teal theme dark */
--color-t-bg: hsl(162, 45%, 10%);
--color-t-border: hsl(162, 40%, 18%);
--color-t-accent: hsl(162, 70%, 46%);
--color-t-dark: hsl(162, 85%, 80%);
/* Amber theme dark */
--color-a-bg: hsl(36, 45%, 11%);
--color-a-border: hsl(36, 40%, 19%);
--color-a-accent: hsl(36, 85%, 58%);
--color-a-dark: hsl(36, 90%, 82%);
--shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
--shadow-lg: 0 12px 20px -3px rgba(0, 0, 0, 0.5);
}
* {
box-sizing: border-box;
margin: 0;
@ -120,13 +80,6 @@
radial-gradient(at 50% 100%, hsla(36, 90%, 45%, 0.03) 0px, transparent 50%);
background-attachment: fixed;
}
body.dark-mode {
background-image:
radial-gradient(at 0% 0%, hsla(247, 80%, 62%, 0.08) 0px, transparent 50%),
radial-gradient(at 100% 0%, hsla(162, 75%, 34%, 0.06) 0px, transparent 50%),
radial-gradient(at 50% 100%, hsla(36, 90%, 45%, 0.05) 0px, transparent 50%);
}
.wrap {
max-width: 1240px;
@ -1120,28 +1073,6 @@
localStorage.removeItem(`textarea_triptyque_${index}`);
});
}
// Light / Dark Theme Toggle Logic
function toggleTheme() {
const isDark = document.body.classList.toggle('dark-mode');
localStorage.setItem('theme_triptyque', isDark ? 'dark' : 'light');
updateThemeIcon(isDark);
}
function updateThemeIcon(isDark) {
const icon = document.getElementById('theme-icon');
if (icon) {
icon.className = isDark ? 'ti ti-sun' : 'ti ti-moon';
}
}
// Initialize Theme (Default to Light Mode unless explicitly saved as dark)
const savedTheme = localStorage.getItem('theme_triptyque');
if (savedTheme === 'dark') {
document.body.classList.add('dark-mode');
updateThemeIcon(true);
} else {
updateThemeIcon(false);
}
</script>
</body>