more htmx

This commit is contained in:
juanatsap
2025-11-14 21:38:09 +00:00
parent 15b73a915d
commit 06eb490950
32 changed files with 2517 additions and 354 deletions
@@ -2,16 +2,25 @@
<!-- Center: View controls with labels -->
<div class="view-controls-center">
<!-- CV Length toggle -->
<div class="selector-group">
<div class="selector-group" id="desktop-length-toggle">
<label class="selector-label">{{if eq .Lang "es"}}Longitud{{else}}Length{{end}}:</label>
<label class="icon-toggle">
<input type="checkbox"
id="lengthToggle"
{{if eq .CVLengthClass "cv-long"}}checked{{end}}
hx-post="/toggle/length"
hx-target=".cv-paper"
hx-swap="outerHTML show:none"
hx-indicator="#loading">
hx-post="/toggle/length?lang={{.Lang}}"
hx-target="#desktop-length-toggle"
hx-swap="outerHTML"
_="on htmx:afterRequest
if my.checked
remove .cv-short from .cv-paper
add .cv-long to .cv-paper
set localStorage['cv-length'] to 'long'
else
remove .cv-long from .cv-paper
add .cv-short to .cv-paper
set localStorage['cv-length'] to 'short'
end">
<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>
@@ -20,16 +29,23 @@
</div>
<!-- Logo toggle -->
<div class="selector-group">
<div class="selector-group" id="desktop-logo-toggle">
<label class="selector-label">{{if eq .Lang "es"}}Logos{{else}}Logos{{end}}:</label>
<label class="icon-toggle">
<input type="checkbox"
id="logoToggle"
{{if .ShowLogos}}checked{{end}}
hx-post="/toggle/logos"
hx-target=".cv-paper"
hx-swap="outerHTML show:none"
hx-indicator="#loading">
hx-post="/toggle/logos?lang={{.Lang}}"
hx-target="#desktop-logo-toggle"
hx-swap="outerHTML"
_="on htmx:afterRequest
if my.checked
add .show-logos to .cv-paper
set localStorage['cv-logos'] to 'true'
else
remove .show-logos from .cv-paper
set localStorage['cv-logos'] to 'false'
end">
<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>
@@ -38,16 +54,23 @@
</div>
<!-- Theme toggle -->
<div class="selector-group">
<div class="selector-group" id="desktop-theme-toggle">
<label class="selector-label">{{if eq .Lang "es"}}Vista{{else}}View{{end}}:</label>
<label class="icon-toggle">
<input type="checkbox"
id="themeToggle"
{{if .ThemeClean}}checked{{end}}
hx-post="/toggle/theme"
hx-target="body"
hx-swap="outerHTML show:none"
hx-indicator="#loading">
hx-post="/toggle/theme?lang={{.Lang}}"
hx-target="#desktop-theme-toggle"
hx-swap="outerHTML"
_="on htmx:afterRequest
if my.checked
add .theme-clean to the body
set localStorage['cv-theme'] to 'clean'
else
remove .theme-clean from the body
set localStorage['cv-theme'] to 'default'
end">
<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>