more htmx
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
{{define "back-to-top"}}
|
||||
<!-- Back to Top Link - Native anchor with CSS smooth scroll -->
|
||||
<a href="#top" id="back-to-top" class="back-to-top no-print" aria-label="{{if eq .Lang "es"}}Volver arriba{{else}}Back to top{{end}}" style="display: none;">
|
||||
<!-- Back to Top Link - Hyperscript smooth scroll without URL pollution -->
|
||||
<button id="back-to-top"
|
||||
class="back-to-top no-print"
|
||||
aria-label="{{if eq .Lang "es"}}Volver arriba{{else}}Back to top{{end}}"
|
||||
style="display: none;"
|
||||
_="on click
|
||||
call event.preventDefault()
|
||||
set window.scrollTo({top: 0, behavior: 'smooth'})">
|
||||
<iconify-icon icon="mdi:arrow-up" width="24" height="24"></iconify-icon>
|
||||
</a>
|
||||
</button>
|
||||
{{end}}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
send input to #zoom-slider
|
||||
end
|
||||
set isVisible to localStorage.getItem('cv-zoom-visible')
|
||||
if isVisible === 'false'
|
||||
if isVisible is 'false'
|
||||
add { display: 'none' } to me
|
||||
remove { display: 'none' } from #show-zoom-menu-btn
|
||||
end
|
||||
@@ -36,7 +36,7 @@
|
||||
halt the event
|
||||
|
||||
on mousemove(clientX, clientY) from document
|
||||
if not isDragging exit end
|
||||
if isDragging is not true exit end
|
||||
|
||||
halt the event
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
set my *transform to 'none'
|
||||
|
||||
on mouseup from document
|
||||
if not isDragging exit end
|
||||
if isDragging is not true exit end
|
||||
|
||||
set isDragging to false
|
||||
set my *transition to 'all 0.3s ease'
|
||||
@@ -70,7 +70,7 @@
|
||||
_="on click
|
||||
add { display: 'none' } to #zoom-control
|
||||
remove { display: 'none' } from #show-zoom-menu-btn
|
||||
set localStorage.cv-zoom-visible to 'false'">
|
||||
set localStorage['cv-zoom-visible'] to 'false'">
|
||||
<iconify-icon icon="mdi:close" width="16" height="16"></iconify-icon>
|
||||
</button>
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
set my @aria-valuetext to `${zoomValue}%`
|
||||
|
||||
-- Toggle reset button class
|
||||
if zoomValue !== 100
|
||||
if zoomValue is not 100
|
||||
add .zoom-not-default to #zoom-reset
|
||||
else
|
||||
remove .zoom-not-default from #zoom-reset
|
||||
@@ -125,23 +125,23 @@
|
||||
set #info-button's *zoom to inverseZoom
|
||||
|
||||
-- Save to localStorage
|
||||
set localStorage.cv-zoom to zoomValue
|
||||
set localStorage['cv-zoom'] to zoomValue
|
||||
|
||||
on keydown[ctrlKey or metaKey] from document
|
||||
if event.shiftKey exit end
|
||||
if event.key === '+' or event.key === '='
|
||||
if event.key is '+' or event.key is '='
|
||||
halt the event
|
||||
set currentZoom to my value as a Number
|
||||
set newZoom to Math.min(175, currentZoom + 10)
|
||||
set my value to newZoom
|
||||
send input to me
|
||||
else if event.key === '-'
|
||||
else if event.key is '-'
|
||||
halt the event
|
||||
set currentZoom to my value as a Number
|
||||
set newZoom to Math.max(25, currentZoom - 10)
|
||||
set my value to newZoom
|
||||
send input to me
|
||||
else if event.key === '0'
|
||||
else if event.key is '0'
|
||||
halt the event
|
||||
set my value to 100
|
||||
send input to me
|
||||
|
||||
Reference in New Issue
Block a user