fix: Default to light theme for all first-time visitors

First-time visitors now always see light theme (paper aesthetic)
regardless of their system dark mode preference.

Users can still switch to dark or auto mode, and their preference
is saved to localStorage for future visits.

This maintains the professional CV paper appearance as the default
experience while giving users full control over their preference.
This commit is contained in:
juanatsap
2025-11-30 09:35:31 +00:00
parent eb92f64e93
commit c834919a3c
2 changed files with 6 additions and 14 deletions
+3 -11
View File
@@ -71,17 +71,9 @@
</style>
<script>
(function() {
let theme = localStorage.getItem('color-theme-mode');
// If no saved preference, set default based on device type
if (!theme) {
// Mobile devices default to light theme, desktop to auto
// Check multiple properties for better detection
const width = window.innerWidth || document.documentElement.clientWidth || screen.width;
const isMobile = width <= 768;
theme = isMobile ? 'light' : 'auto';
}
// First-time visitors ALWAYS get light theme (paper aesthetic)
// Users can switch to dark/auto and their preference is saved
let theme = localStorage.getItem('color-theme-mode') || 'light';
document.documentElement.setAttribute('data-color-theme', theme);
})();
</script>