3c49f8f7cf
Replace verbose document.getElementById() and document.querySelectorAll()
with cleaner hyperscript syntax:
- #id for ID selectors
- .class and the first .class for class selectors
- <selector/> query literals for complex selectors
- #{variable} for dynamic ID interpolation
Files changed:
- utils._hs: scrollHeight, details, footer buttons, scrollToSection
- zoom._hs: all zoom control element selectors (14 changes)
- pdf-modal._hs: modal selector
- keyboard._hs: dynamic toggle and modal selectors
- contact-modal.html: response div and modal close
- index.html: ninja-keys bar selector
71 lines
3.1 KiB
HTML
71 lines
3.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="{{if eq .Lang "es"}}es{{else}}en{{end}}">
|
|
{{template "head" .}}
|
|
<body {{if .ThemeClean}}class="theme-clean"{{end}}
|
|
_="on load call initScrollBehavior()
|
|
on scroll from window call handleScroll()
|
|
on keydown
|
|
set tag to event.target.tagName
|
|
set ninjaKeys to #cmd-k-bar
|
|
set ninjaOpen to (ninjaKeys is not null and ninjaKeys.opened)
|
|
set skip to (tag is 'INPUT' or tag is 'TEXTAREA' or ninjaOpen)
|
|
set noMod to (not event.ctrlKey and not event.metaKey and not event.altKey)
|
|
if event.key is '?' and noMod and not skip then halt the event then call openModalShortcut('shortcuts-modal') end
|
|
if (event.key is 'l' or event.key is 'L') and noMod and not skip then halt the event then call handleToggleShortcut('lengthToggle', 'lengthToggleMenu') end
|
|
if (event.key is 'i' or event.key is 'I') and noMod and not skip then halt the event then call handleToggleShortcut('iconToggle', 'iconToggleMenu') end
|
|
if (event.key is 'v' or event.key is 'V') and noMod and not skip then halt the event then call handleToggleShortcut('themeToggle', 'themeToggleMenu') end
|
|
end">
|
|
|
|
<!-- ============================================ -->
|
|
<!-- TOP NAVIGATION & CONTROLS -->
|
|
<!-- ============================================ -->
|
|
<div id="top"></div>
|
|
{{template "action-bar" .}}
|
|
{{template "hamburger-menu" .}}
|
|
{{template "color-theme-switcher" .}}
|
|
|
|
<!-- ============================================ -->
|
|
<!-- MAIN CV CONTENT -->
|
|
<!-- ============================================ -->
|
|
<div id="zoom-wrapper" class="zoom-wrapper">
|
|
<div class="cv-container">
|
|
{{template "cv-content.html" .}}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ============================================ -->
|
|
<!-- PAGE FOOTER & NOTIFICATIONS -->
|
|
<!-- ============================================ -->
|
|
{{template "page-footer" .}}
|
|
{{template "error-toast" .}}
|
|
{{template "pdf-toast" .}}
|
|
|
|
<!-- ============================================ -->
|
|
<!-- FLOATING BUTTONS -->
|
|
<!-- ============================================ -->
|
|
<div class="fixed-buttons-backdrop no-print"></div>
|
|
{{template "back-to-top" .}}
|
|
{{template "info-button" .}}
|
|
{{template "download-button" .}}
|
|
{{template "print-friendly-button" .}}
|
|
{{template "contact-button" .}}
|
|
{{template "zoom-toggle-button" .}}
|
|
{{template "shortcuts-button" .}}
|
|
{{template "cmd-k-button" .}}
|
|
|
|
<!-- ============================================ -->
|
|
<!-- MODALS -->
|
|
<!-- ============================================ -->
|
|
{{template "info-modal" .}}
|
|
{{template "shortcuts-modal" .}}
|
|
{{template "pdf-modal" .}}
|
|
{{template "contact-modal" .}}
|
|
{{template "zoom-control" .}}
|
|
|
|
<!-- ============================================ -->
|
|
<!-- SCRIPTS & ANALYTICS -->
|
|
<!-- ============================================ -->
|
|
{{template "body-scripts" .}}
|
|
</body>
|
|
</html>
|