diff --git a/components/PageReader.tsx b/components/PageReader.tsx index 2097796..3197f56 100644 --- a/components/PageReader.tsx +++ b/components/PageReader.tsx @@ -82,6 +82,10 @@ export function PageReader({ // Guards progress writes so an empty session (opened chapter, never // scrolled) doesn't overwrite prior bookmark for a different chapter. const hasScrolledRef = useRef(false); + const [canHover, setCanHover] = useState(false); + useEffect(() => { + setCanHover(window.matchMedia("(hover: hover)").matches); + }, []); const imagesRef = useRef(images); const chapterMetasRef = useRef(chapterMetas); @@ -539,10 +543,18 @@ export function PageReader({ return (
+ {canHover && !showUI && ( +
setShowUI(true)} + /> + )}
setShowUI(true) : undefined} + onMouseLeave={canHover ? () => setShowUI(false) : undefined} >