From c0c486a53eb4137847230e226bb98e65f2da1c3d Mon Sep 17 00:00:00 2001 From: Youwes09 Date: Thu, 16 Apr 2026 00:29:46 -0500 Subject: [PATCH] Feat: Double-Tap for Reader Bar (#29) --- src/components/reader/Reader.svelte | 26 ++++++++++++++++++++++--- src/components/settings/Settings.svelte | 4 ++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/components/reader/Reader.svelte b/src/components/reader/Reader.svelte index 9f35690..d3472ca 100644 --- a/src/components/reader/Reader.svelte +++ b/src/components/reader/Reader.svelte @@ -181,7 +181,8 @@ const zoom = $derived(store.settings.readerZoom ?? 1.0); const autoNext = $derived(store.settings.autoNextChapter ?? false); const markOnNext = $derived(store.settings.markReadOnNext ?? true); - const overlayBars = $derived(store.settings.overlayBars ?? false); + const overlayBars = $derived(store.settings.overlayBars ?? false); + const tapToToggleBar = $derived(store.settings.tapToToggleBar ?? false); const lastPage = $derived(store.pageUrls.length); const effectiveWidth = $derived(containerWidth > 0 ? Math.round(containerWidth * zoom) : undefined); const zoomPct = $derived(Math.round(zoom * 100)); @@ -776,7 +777,18 @@ function showUi() { uiVisible = true; if (hideTimer) clearTimeout(hideTimer); - hideTimer = setTimeout(() => { if (!markerOpen && !winOpen) uiVisible = false; }, 3000); + if (!tapToToggleBar) { + hideTimer = setTimeout(() => { if (!markerOpen && !winOpen) uiVisible = false; }, 3000); + } + } + + function toggleUiVisibility() { + if (uiVisible) { + if (hideTimer) { clearTimeout(hideTimer); hideTimer = null; } + uiVisible = false; + } else { + uiVisible = true; + } } $effect(() => { @@ -786,6 +798,13 @@ } }); + $effect(() => { + if (tapToToggleBar) { + if (hideTimer) { clearTimeout(hideTimer); hideTimer = null; } + uiVisible = true; + } + }); + const INSPECT_ZOOM_STEP = 0.15; const INSPECT_ZOOM_MAX = 8; @@ -940,7 +959,7 @@ }); -