swipe bug fix

This commit is contained in:
2026-03-28 10:00:52 -04:00
parent f50f2aaba1
commit abd4574ee3
3 changed files with 18 additions and 8 deletions

View File

@@ -59,7 +59,9 @@ if ('serviceWorker' in navigator) {
document.addEventListener('touchmove', function (e) {
if (e.touches.length === 2 && pinchStartDist !== null) {
// Two-finger pinch: scale fonts, not viewport
// Two-finger pinch: scale fonts, not viewport.
// Skip when a lightbox is open — let the browser handle pinch natively there.
if (document.documentElement.dataset.lightboxOpen) return;
e.preventDefault();
const ratio = getTouchDist(e) / pinchStartDist;
const newScale = Math.min(MAX_SCALE, Math.max(MIN_SCALE, pinchStartScale * ratio));