diff --git a/internal/handlers/cv_helpers.go b/internal/handlers/cv_helpers.go index 6c14923..0942cb4 100644 --- a/internal/handlers/cv_helpers.go +++ b/internal/handlers/cv_helpers.go @@ -352,6 +352,19 @@ func (h *CVHandler) prepareTemplateData(lang string) (map[string]interface{}, er } } + // Scan background photos (dev only) + var bgPhotos []string + if !isProduction { + bgDir := filepath.Join(c.DirStatic, "images", "backgrounds") + entries, _ := os.ReadDir(bgDir) + for _, e := range entries { + name := e.Name() + if !e.IsDir() && (strings.HasSuffix(name, ".jpg") || strings.HasSuffix(name, ".png") || strings.HasSuffix(name, ".webp")) { + bgPhotos = append(bgPhotos, "/static/images/backgrounds/"+name) + } + } + } + // Prepare template data data := map[string]interface{}{ "CV": &cv, @@ -366,6 +379,7 @@ func (h *CVHandler) prepareTemplateData(lang string) (map[string]interface{}, er "AlternateEN": "https://juan.andres.morenorub.io/?lang=en", "AlternateES": "https://juan.andres.morenorub.io/?lang=es", "ChatEnabled": h.chatEnabled, + "BgPhotos": bgPhotos, } return data, nil diff --git a/static/css/01-foundation/_reset.css b/static/css/01-foundation/_reset.css index 3fc9950..2aeb1fb 100644 --- a/static/css/01-foundation/_reset.css +++ b/static/css/01-foundation/_reset.css @@ -12,23 +12,25 @@ /* Body base */ body { background-color: var(--page-bg, #d6d6d6); - - /* OLD PATTERN - Keep for reference (can be restored anytime) */ - /* background-image: - linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px), - linear-gradient(180deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px), - linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px), - linear-gradient(180deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px); - background-size: 50px 50px, 50px 50px, 10px 10px, 10px 10px; */ - - /* NEW TEST PATTERNS - Theme-specific (woven fabric for light, diagonal grid for dark) */ background-image: var(--page-bg-pattern, none); - background-size: 40px 40px; /* For dark theme diagonal grid */ + background-size: 40px 40px; background-attachment: fixed; max-width: 100vw; /* Prevent horizontal overflow */ overflow-x: clip; /* Clip prevents horizontal scroll WITHOUT breaking position: sticky */ } +/* Background photo layer — activated via JS in dev mode */ +body.bg-photo { + background-image: + var(--page-bg-pattern, none), + linear-gradient(var(--page-bg-tint, rgba(214,214,214,0.85)), var(--page-bg-tint, rgba(214,214,214,0.85))), + var(--bg-photo-url, none); + background-size: auto, auto, cover; + background-position: 0 0, 0 0, center; + background-repeat: repeat, repeat, no-repeat; + background-attachment: fixed; +} + /* Smooth scrolling */ html { scroll-behavior: smooth; diff --git a/static/css/01-foundation/_themes.css b/static/css/01-foundation/_themes.css index 4de8814..fc9ddc1 100644 --- a/static/css/01-foundation/_themes.css +++ b/static/css/01-foundation/_themes.css @@ -62,6 +62,9 @@ /* Sidebar (for non-clean theme) */ --sidebar-bg: #d1d4d2; + /* Background photo tint — controls how much of the photo shows through */ + --page-bg-tint: rgba(214, 214, 214, 0.85); + /* Legacy CV content variables - theme-aware overrides */ --text-dark: #1a1a1a; /* Dark text for light background */ --text-gray: #333333; /* Secondary text for light background */ @@ -116,6 +119,9 @@ /* Sidebar (for non-clean theme) - darker than light theme but lighter than main content */ --sidebar-bg: #3a3d3e; + /* Background photo tint — darker overlay for dark theme */ + --page-bg-tint: rgba(58, 58, 58, 0.85); + /* Legacy CV content variables - theme-aware overrides */ --text-dark: #e0e0e0; /* Light text for dark background */ --text-gray: #d0d0d0; /* Secondary text for dark background */ @@ -171,6 +177,9 @@ /* Sidebar (for non-clean theme) - matches explicit dark theme */ --sidebar-bg: #3a3d3e; + /* Background photo tint — darker overlay for dark theme */ + --page-bg-tint: rgba(58, 58, 58, 0.85); + /* Legacy CV content variables - theme-aware overrides */ --text-dark: #e0e0e0; /* Light text for dark background */ --text-gray: #d0d0d0; /* Secondary text for dark background */ diff --git a/static/css/04-interactive/_buttons.css b/static/css/04-interactive/_buttons.css index ba3ec12..8cd0d1e 100644 --- a/static/css/04-interactive/_buttons.css +++ b/static/css/04-interactive/_buttons.css @@ -124,6 +124,39 @@ color: #27ae60; /* Green icon when at bottom */ } +/* Background Photo Toggle (Dev Only - above download button) */ +.bg-photo-btn { + position: fixed; + bottom: 30rem; + left: 2rem; + width: 50px; + height: 50px; + background: var(--black-bar, #2b2b2b); + color: white; + border: none; + border-radius: 50%; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); + transition: all 0.3s ease; + z-index: 999; + opacity: 0.6; +} + +.bg-photo-btn:hover { + opacity: 1; + transform: translateY(-3px); + box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); + background: #8e6b3e !important; /* Earthy brown — Lanzarote vibes */ +} + +.bg-photo-btn.at-bottom { + opacity: 1; + background: #8e6b3e !important; +} + /* Download Button (TOP POSITION - now first button after cmd-k removed) */ .download-btn { position: fixed; diff --git a/static/images/backgrounds/1.jpg b/static/images/backgrounds/1.jpg new file mode 100644 index 0000000..228d730 Binary files /dev/null and b/static/images/backgrounds/1.jpg differ diff --git a/static/images/backgrounds/2.jpg b/static/images/backgrounds/2.jpg new file mode 100644 index 0000000..98f50e2 Binary files /dev/null and b/static/images/backgrounds/2.jpg differ diff --git a/static/images/backgrounds/3.jpg b/static/images/backgrounds/3.jpg new file mode 100644 index 0000000..abc4c41 Binary files /dev/null and b/static/images/backgrounds/3.jpg differ diff --git a/templates/index.html b/templates/index.html index 748463b..02dfd78 100644 --- a/templates/index.html +++ b/templates/index.html @@ -50,6 +50,7 @@ {{template "contact-button" .}} {{template "zoom-toggle-button" .}} {{template "shortcuts-button" .}} + {{template "bg-photo-toggle" .}} diff --git a/templates/partials/widgets/bg-photo-toggle.html b/templates/partials/widgets/bg-photo-toggle.html new file mode 100644 index 0000000..a29a61e --- /dev/null +++ b/templates/partials/widgets/bg-photo-toggle.html @@ -0,0 +1,52 @@ +{{define "bg-photo-toggle"}} +{{if not .IsProduction}} + + + +{{end}} +{{end}}