feat: no vertical swipe on reader
This commit is contained in:
@@ -150,7 +150,7 @@ export function BookReader({ book, pages, onClose }: BookReaderProps) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="fixed inset-0 bg-background/95 backdrop-blur-sm z-50">
|
<div className="fixed inset-0 bg-background/95 backdrop-blur-sm z-50 overflow-hidden touch-none">
|
||||||
<div
|
<div
|
||||||
className="relative h-full flex flex-col items-center justify-center"
|
className="relative h-full flex flex-col items-center justify-center"
|
||||||
onClick={() => setShowControls(!showControls)}
|
onClick={() => setShowControls(!showControls)}
|
||||||
|
|||||||
@@ -101,9 +101,13 @@ export const usePageNavigation = ({
|
|||||||
if (touchStartXRef.current === null) return;
|
if (touchStartXRef.current === null) return;
|
||||||
|
|
||||||
const touchEndX = event.changedTouches[0].clientX;
|
const touchEndX = event.changedTouches[0].clientX;
|
||||||
|
const touchEndY = event.changedTouches[0].clientY;
|
||||||
const deltaX = touchEndX - touchStartXRef.current;
|
const deltaX = touchEndX - touchStartXRef.current;
|
||||||
|
const deltaY = Math.abs(touchEndY - event.touches[0].clientY);
|
||||||
const minSwipeDistance = 50;
|
const minSwipeDistance = 50;
|
||||||
|
|
||||||
|
if (deltaY > Math.abs(deltaX)) return;
|
||||||
|
|
||||||
if (Math.abs(deltaX) > minSwipeDistance) {
|
if (Math.abs(deltaX) > minSwipeDistance) {
|
||||||
if (deltaX > 0) {
|
if (deltaX > 0) {
|
||||||
handlePreviousPage();
|
handlePreviousPage();
|
||||||
|
|||||||
Reference in New Issue
Block a user