925a95c1b4
- Created keyboard._hs as reference documentation (inline handler in body tag) - Externalized 9 hamburger menu navigation links to scrollToSection() - Added scrollToSection() as JavaScript function (CSP-safe, no eval needed) - Restored original keyboard handler format in body tag (working correctly) - Removed problematic navigation._hs (had syntax/CSP issues) - Added Rule 4 to HYPERSCRIPT-RULES.md on event handler externalization - Updated PROJECT-MEMORY.md with externalization guidelines Key learnings: - Complex event handlers that inspect event properties must stay inline - JavaScript functions avoid CSP unsafe-eval restrictions - Navigation successfully externalized: 9 links → 1 function (91% reduction)
197 lines
11 KiB
HTML
197 lines
11 KiB
HTML
{{define "hamburger-menu"}}
|
|
<!-- Navigation Menu (Hidden by default) -->
|
|
<nav id="navigation-menu" class="navigation-menu no-print" role="navigation" aria-label="CV sections">
|
|
<div class="menu-content">
|
|
<!-- CV Sections - Quick Navigation -->
|
|
<div class="menu-item-submenu">
|
|
<a href="#" class="menu-item has-submenu">
|
|
<iconify-icon icon="mdi:menu" width="20" height="20"></iconify-icon>
|
|
<span>{{if eq .Lang "es"}}Secciones CV{{else}}CV Sections{{end}}</span>
|
|
<iconify-icon icon="mdi:chevron-right" width="16" height="16" class="submenu-arrow"></iconify-icon>
|
|
</a>
|
|
<div class="submenu-content">
|
|
<a href="#education" class="menu-item"
|
|
_="on click call scrollToSection(event, 'education')">
|
|
<iconify-icon icon="mdi:school" width="20" height="20"></iconify-icon>
|
|
<span>{{if eq .Lang "es"}}Formación{{else}}Training{{end}}</span>
|
|
</a>
|
|
<a href="#skills" class="menu-item"
|
|
_="on click call scrollToSection(event, 'skills')">
|
|
<iconify-icon icon="mdi:brain" width="20" height="20"></iconify-icon>
|
|
<span>{{if eq .Lang "es"}}Competencias{{else}}Skills{{end}}</span>
|
|
</a>
|
|
<a href="#experience" class="menu-item"
|
|
_="on click call scrollToSection(event, 'experience')">
|
|
<iconify-icon icon="mdi:office-building" width="20" height="20"></iconify-icon>
|
|
<span>{{if eq .Lang "es"}}Experiencia{{else}}Experience{{end}}</span>
|
|
</a>
|
|
<a href="#awards" class="menu-item"
|
|
_="on click call scrollToSection(event, 'awards')">
|
|
<iconify-icon icon="mdi:trophy" width="20" height="20"></iconify-icon>
|
|
<span>{{if eq .Lang "es"}}Premios y Reconocimientos{{else}}Awards{{end}}</span>
|
|
</a>
|
|
<a href="#projects" class="menu-item"
|
|
_="on click call scrollToSection(event, 'projects')">
|
|
<iconify-icon icon="mdi:web" width="20" height="20"></iconify-icon>
|
|
<span>{{if eq .Lang "es"}}Proyectos Personales / Freelance{{else}}Personal / Freelance Projects{{end}}</span>
|
|
</a>
|
|
<a href="#courses" class="menu-item"
|
|
_="on click call scrollToSection(event, 'courses')">
|
|
<iconify-icon icon="mdi:school" width="20" height="20"></iconify-icon>
|
|
<span>{{if eq .Lang "es"}}Cursos Realizados{{else}}Courses{{end}}</span>
|
|
</a>
|
|
<a href="#languages" class="menu-item"
|
|
_="on click call scrollToSection(event, 'languages')">
|
|
<iconify-icon icon="mdi:translate" width="20" height="20"></iconify-icon>
|
|
<span>{{if eq .Lang "es"}}Idiomas{{else}}Languages{{end}}</span>
|
|
</a>
|
|
<a href="#references" class="menu-item"
|
|
_="on click call scrollToSection(event, 'references')">
|
|
<iconify-icon icon="mdi:link-variant" width="20" height="20"></iconify-icon>
|
|
<span>{{if eq .Lang "es"}}Referencias{{else}}References{{end}}</span>
|
|
</a>
|
|
<a href="#other" class="menu-item"
|
|
_="on click call scrollToSection(event, 'other')">
|
|
<iconify-icon icon="mdi:information" width="20" height="20"></iconify-icon>
|
|
<span>{{if eq .Lang "es"}}Otros{{else}}Other{{end}}</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Quick Actions Section -->
|
|
<div class="menu-section-wrapper">
|
|
<div class="menu-item menu-item-header">
|
|
<iconify-icon icon="mdi:cog-outline" width="20" height="20"></iconify-icon>
|
|
<span>{{if eq .Lang "es"}}Acciones Rápidas{{else}}Quick Actions{{end}}</span>
|
|
</div>
|
|
|
|
<a href="#" class="menu-item menu-item-action" onclick="collapseAllSections(event)">
|
|
<iconify-icon icon="mdi:arrow-collapse-all" width="20" height="20"></iconify-icon>
|
|
<span>{{if eq .Lang "es"}}Colapsar Todo{{else}}Collapse All{{end}}</span>
|
|
</a>
|
|
<a href="#" class="menu-item menu-item-action" onclick="expandAllSections(event)">
|
|
<iconify-icon icon="mdi:arrow-expand-all" width="20" height="20"></iconify-icon>
|
|
<span>{{if eq .Lang "es"}}Expandir Todo{{else}}Expand All{{end}}</span>
|
|
</a>
|
|
<a href="#" id="show-zoom-menu-btn" class="menu-item menu-item-action zoom-hidden">
|
|
<iconify-icon icon="mdi:magnify" width="20" height="20"></iconify-icon>
|
|
<span>{{if eq .Lang "es"}}Zoom{{else}}Zoom{{end}}</span>
|
|
</a>
|
|
</div>
|
|
|
|
<!-- View Controls in menu (visible only on mobile < 900px) -->
|
|
<div class="menu-controls-section">
|
|
<div class="menu-item menu-item-header">
|
|
<iconify-icon icon="mdi:tune-variant" width="20" height="20"></iconify-icon>
|
|
<span>{{if eq .Lang "es"}}Controles de Vista{{else}}View Controls{{end}}</span>
|
|
</div>
|
|
|
|
<!-- CV Length toggle -->
|
|
<div class="menu-control-item" id="mobile-length-toggle">
|
|
<label class="menu-control-label">
|
|
<iconify-icon icon="mdi:file-document-outline" width="20" height="20"></iconify-icon>
|
|
<span>{{if eq .Lang "es"}}Longitud{{else}}Length{{end}}</span>
|
|
</label>
|
|
<div style="display: flex; align-items: center; gap: 8px;">
|
|
<label class="icon-toggle">
|
|
<input type="checkbox"
|
|
id="lengthToggleMenu"
|
|
{{if eq .CVLengthClass "cv-long"}}checked{{end}}
|
|
hx-post="/toggle/length?lang={{.Lang}}"
|
|
hx-swap="none"
|
|
_="on change call toggleCVLength(my.checked)">
|
|
<span class="icon-toggle-slider">
|
|
<iconify-icon icon="mdi:file-document-outline" width="16" height="16" class="icon-left"></iconify-icon>
|
|
<iconify-icon icon="mdi:file-document-multiple-outline" width="16" height="16" class="icon-right"></iconify-icon>
|
|
</span>
|
|
</label>
|
|
<iconify-icon icon="mdi:loading"
|
|
class="htmx-indicator spinning small dark"
|
|
width="14"
|
|
height="14"
|
|
aria-label="Saving"></iconify-icon>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Icon toggle -->
|
|
<div class="menu-control-item" id="mobile-icon-toggle">
|
|
<label class="menu-control-label">
|
|
<iconify-icon icon="mdi:image-multiple-outline" width="20" height="20"></iconify-icon>
|
|
<span>{{if eq .Lang "es"}}Iconos{{else}}Icons{{end}}</span>
|
|
</label>
|
|
<div style="display: flex; align-items: center; gap: 8px;">
|
|
<label class="icon-toggle">
|
|
<input type="checkbox"
|
|
id="iconToggleMenu"
|
|
{{if .ShowIcons}}checked{{end}}
|
|
hx-post="/toggle/icons?lang={{.Lang}}"
|
|
hx-swap="none"
|
|
_="on change call toggleIcons(my.checked)">
|
|
<span class="icon-toggle-slider">
|
|
<iconify-icon icon="mdi:image-off-outline" width="16" height="16" class="icon-left"></iconify-icon>
|
|
<iconify-icon icon="mdi:image-multiple-outline" width="16" height="16" class="icon-right"></iconify-icon>
|
|
</span>
|
|
</label>
|
|
<iconify-icon icon="mdi:loading"
|
|
class="htmx-indicator spinning small dark"
|
|
width="14"
|
|
height="14"
|
|
aria-label="Saving"></iconify-icon>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Theme toggle -->
|
|
<div class="menu-control-item" id="mobile-theme-toggle">
|
|
<label class="menu-control-label">
|
|
<iconify-icon icon="mdi:page-layout-sidebar-left" width="20" height="20"></iconify-icon>
|
|
<span>{{if eq .Lang "es"}}Vista{{else}}View{{end}}</span>
|
|
</label>
|
|
<div style="display: flex; align-items: center; gap: 8px;">
|
|
<label class="icon-toggle">
|
|
<input type="checkbox"
|
|
id="themeToggleMenu"
|
|
{{if .ThemeClean}}checked{{end}}
|
|
hx-post="/toggle/theme?lang={{.Lang}}"
|
|
hx-swap="none"
|
|
_="on change call toggleTheme(my.checked)">
|
|
<span class="icon-toggle-slider">
|
|
<iconify-icon icon="mdi:page-layout-sidebar-left" width="16" height="16" class="icon-left"></iconify-icon>
|
|
<iconify-icon icon="mdi:page-layout-body" width="16" height="16" class="icon-right"></iconify-icon>
|
|
</span>
|
|
</label>
|
|
<iconify-icon icon="mdi:loading"
|
|
class="htmx-indicator spinning small dark"
|
|
width="14"
|
|
height="14"
|
|
aria-label="Saving"></iconify-icon>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Action Buttons in menu (visible only on mobile < 900px) -->
|
|
<div class="menu-actions-section">
|
|
<div class="menu-item menu-item-header">
|
|
<iconify-icon icon="mdi:lightning-bolt" width="20" height="20"></iconify-icon>
|
|
<span>{{if eq .Lang "es"}}Acciones{{else}}Actions{{end}}</span>
|
|
</div>
|
|
|
|
<button class="menu-action-btn menu-pdf-btn"
|
|
onclick="document.getElementById('pdf-modal').showModal()"
|
|
_="on mouseenter call syncPdfHover(true)
|
|
on mouseleave call syncPdfHover(false)">
|
|
<iconify-icon icon="catppuccin:pdf" width="20" height="20"></iconify-icon>
|
|
<span>{{if eq .Lang "es"}}Descargar como PDF{{else}}Download as PDF{{end}}</span>
|
|
</button>
|
|
|
|
<button class="menu-action-btn menu-print-btn"
|
|
_="on click call printFriendly()
|
|
on mouseenter call syncPrintHover(true)
|
|
on mouseleave call syncPrintHover(false)">
|
|
<iconify-icon icon="mdi:leaf" width="20" height="20"></iconify-icon>
|
|
<span>{{if eq .Lang "es"}}Imprimir amigable{{else}}Print Friendly{{end}}</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
{{end}}
|