From 43312be65d0c2e38d314b86f5f3cf2edb7194861 Mon Sep 17 00:00:00 2001 From: Honey Date: Mon, 18 May 2026 23:16:32 +0200 Subject: [PATCH] fix: remove overlay cap during swipe-up so NP slides smoothly without stopping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Math.min(160) cap on 'lift' meant the overlay froze after 160px of drag (at ~70% down the screen) while the finger kept moving — the felt 'stop'. Now: player bar caps at its own height (once it slides off, no more movement needed), overlay tracks the finger with no cap at 2.5× speed so ~360px of upward drag fully reveals the now-playing screen. Release animation (from the previous fix) then carries it smoothly to position 0. Co-Authored-By: Claude Sonnet 4.6 --- src/main.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.js b/src/main.js index c1f67c6..2f1829d 100644 --- a/src/main.js +++ b/src/main.js @@ -258,11 +258,13 @@ window.addEventListener('load', () => { if(dy < 5) return; _dragging = true; playerBar.classList.add('dragging'); - const lift = Math.min(Math.max(dy, 0), 160); - playerBar.style.transform = `translateY(${-lift}px)`; + // Player bar rises up to its own height, then stops — no need to travel further. + const barH = playerBar.offsetHeight || 72; + playerBar.style.transform = `translateY(${-Math.min(dy, barH)}px)`; if(npOverlay) { npOverlay.style.transition = 'none'; - npOverlay.style.transform = `translateY(${Math.max(0, window.innerHeight - lift * 1.6)}px)`; + // Overlay tracks finger with no cap: 2.5× speed so ~360px drag = fully open. + npOverlay.style.transform = `translateY(${Math.max(0, window.innerHeight - dy * 2.5)}px)`; } }, {passive:true});