fix: remove overlay cap during swipe-up so NP slides smoothly without stopping
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 <noreply@anthropic.com>
This commit is contained in:
1 parent
b0fb1b200d
commit
43312be65d
1 file changed
+5
-3
+5
-3
@@ -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});
|
||||
|
||||
|
||||
Reference in new issue
Block a user