diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 85c0a31..3d4fd57 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -92,7 +92,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo @@ -145,7 +145,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo /> diff --git a/src/components/reader/PhotoswipeReader.tsx b/src/components/reader/PhotoswipeReader.tsx index de6ac85..8656a06 100644 --- a/src/components/reader/PhotoswipeReader.tsx +++ b/src/components/reader/PhotoswipeReader.tsx @@ -46,6 +46,15 @@ export function PhotoswipeReader({ book, pages, onClose, nextBook }: BookReaderP currentPageRef.current = currentPage; }, [currentPage]); + // Activer le zoom dans le reader en enlevant la classe no-pinch-zoom + useEffect(() => { + document.body.classList.remove('no-pinch-zoom'); + + return () => { + document.body.classList.add('no-pinch-zoom'); + }; + }, []); + // Auto double page en paysage useEffect(() => { setIsDoublePage(isLandscape); @@ -393,7 +402,7 @@ export function PhotoswipeReader({ book, pages, onClose, nextBook }: BookReaderP return (
setShowControls(!showControls)} >
diff --git a/src/styles/globals.css b/src/styles/globals.css index 41fbc09..b704bfa 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -7,6 +7,12 @@ body { overscroll-behavior: none; } +/* Bloque le zoom partout sauf reader */ +body.no-pinch-zoom, +body.no-pinch-zoom * { + touch-action: pan-x pan-y; +} + /* Ajout des règles pour gérer le safe-area-inset sur iOS @supports (padding-top: env(safe-area-inset-top)) { body { @@ -92,6 +98,13 @@ body { body { @apply text-foreground; } + + /* Empêche le zoom automatique iOS sur les inputs */ + input, + textarea, + select { + font-size: 16px; + } } @layer utilities {