f7cda5dba3
CSS Restructuring: - Reorganize monolithic main.css into modular architecture - Create foundation/ (reset, variables, typography, themes) - Create layout/ (container, page, grid, paper) - Create components/ (8 component files) - Create interactive/ (toggles, remaining for future split) - Create effects/ (skeleton loading) - Create contexts/ (print styles) Theme Support Fixes: - Replace all hardcoded text colors with CSS variables - Fix .section-title: rgb(51,51,51) → var(--text-primary) - Fix .cv-name, .intro-text: hardcoded → theme-aware - Fix .experience-period, .duration-text: #555/#aaa → variables - Fix course/project/experience text colors - Support proper light/dark theme text contrast Icon & Layout Fixes: - Standardize all icon sizes to 80×80px - Change all icon backgrounds to transparent - Fix award section layout (missing flexbox) - Update HTML templates (experience.html, awards.html) to width='80' - Fix default icon sizing conflicts View Switcher Fix: - Fix toggleTheme() to target .cv-container instead of body - Ensures clean/default theme toggle works correctly Files: 40+ CSS files modularized, 3 templates updated, 7 tests added
74 lines
2.8 KiB
Plaintext
74 lines
2.8 KiB
Plaintext
-- ==============================================================================
|
|
-- CV Site - Toggle Functions
|
|
-- ==============================================================================
|
|
-- Toggle functions for CV customization (length, icons, theme)
|
|
-- Migrated from JavaScript (cv-functions.js) after confirming no def limit
|
|
|
|
-- ==============================================================================
|
|
-- CV LENGTH TOGGLE
|
|
-- ==============================================================================
|
|
|
|
def toggleCVLength(isLong)
|
|
set paper to the first .cv-paper
|
|
set actionBarToggle to #lengthToggle
|
|
set menuToggle to #lengthToggleMenu
|
|
|
|
if isLong is true
|
|
remove .cv-short from paper
|
|
add .cv-long to paper
|
|
call localStorage.setItem('cv-length', 'long')
|
|
if actionBarToggle exists then set actionBarToggle's checked to true end
|
|
if menuToggle exists then set menuToggle's checked to true end
|
|
else
|
|
remove .cv-long from paper
|
|
add .cv-short to paper
|
|
call localStorage.setItem('cv-length', 'short')
|
|
if actionBarToggle exists then set actionBarToggle's checked to false end
|
|
if menuToggle exists then set menuToggle's checked to false end
|
|
end
|
|
end
|
|
|
|
-- ==============================================================================
|
|
-- ICONS TOGGLE
|
|
-- ==============================================================================
|
|
|
|
def toggleIcons(showIcons)
|
|
set paper to the first .cv-paper
|
|
set actionBarToggle to #iconToggle
|
|
set menuToggle to #iconToggleMenu
|
|
|
|
if showIcons is true
|
|
add .show-icons to paper
|
|
call localStorage.setItem('cv-icons', 'true')
|
|
if actionBarToggle exists then set actionBarToggle's checked to true end
|
|
if menuToggle exists then set menuToggle's checked to true end
|
|
else
|
|
remove .show-icons from paper
|
|
call localStorage.setItem('cv-icons', 'false')
|
|
if actionBarToggle exists then set actionBarToggle's checked to false end
|
|
if menuToggle exists then set menuToggle's checked to false end
|
|
end
|
|
end
|
|
|
|
-- ==============================================================================
|
|
-- THEME TOGGLE
|
|
-- ==============================================================================
|
|
|
|
def toggleTheme(isClean)
|
|
set container to the first .cv-container
|
|
set actionBarToggle to #themeToggle
|
|
set menuToggle to #themeToggleMenu
|
|
|
|
if isClean is true
|
|
add .theme-clean to container
|
|
call localStorage.setItem('cv-theme', 'clean')
|
|
if actionBarToggle exists then set actionBarToggle's checked to true end
|
|
if menuToggle exists then set menuToggle's checked to true end
|
|
else
|
|
remove .theme-clean from container
|
|
call localStorage.setItem('cv-theme', 'default')
|
|
if actionBarToggle exists then set actionBarToggle's checked to false end
|
|
if menuToggle exists then set menuToggle's checked to false end
|
|
end
|
|
end
|