Math.abs(dy) && Math.abs(dx) > 10) { dragging = true }
if (dragging) { touchDelta = dx; swiping = true }
"
@touchend="
if (swiping && Math.abs(touchDelta) > 50) { touchDelta < 0 ? next() : prev() }
touchDelta = 0; swiping = false; dragging = false
"
@mousedown.prevent="touchStartX = $event.clientX; touchStartY = $event.clientY; dragging = false; touchDelta = 0"
@mousemove="
if (touchStartX === 0 && touchStartY === 0) return;
let dx = $event.clientX - touchStartX;
let dy = $event.clientY - touchStartY;
if (!dragging && Math.abs(dx) > Math.abs(dy) && Math.abs(dx) > 10) { dragging = true }
if (dragging) { touchDelta = dx; swiping = true }
"
@mouseup="
if (swiping && Math.abs(touchDelta) > 50) { touchDelta < 0 ? next() : prev() }
if (dragging) { let a = $el.closest('a'); a.__dragged = true; setTimeout(() => a.__dragged = false, 50) }
touchDelta = 0; swiping = false; dragging = false; touchStartX = 0; touchStartY = 0
"
@mouseleave="
if (swiping) {
if (Math.abs(touchDelta) > 50) { touchDelta < 0 ? next() : prev() }
}
if (dragging) { let a = $el.closest('a'); a.__dragged = true; setTimeout(() => a.__dragged = false, 50) }
touchDelta = 0; swiping = false; dragging = false; touchStartX = 0; touchStartY = 0
"
>