diff --git a/static/js/app.js b/static/js/app.js index a49e780..32bdeee 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -2924,8 +2924,17 @@ const _IMM_DELAY = 5000; const _IMM_EDGE = 60; // px from top/bottom edge function _immMouseMove(e) { - const atTop = e.clientY < _IMM_EDGE; - const atBottom = e.clientY > window.innerHeight - _IMM_EDGE; + // When bars are already showing, extend threshold to cover their actual height + const topThreshold = _immTopShowing + ? (document.querySelector('.navbar')?.offsetHeight ?? 0) + + (document.querySelector('.reader-header')?.offsetHeight ?? 0) + 12 + : _IMM_EDGE; + const bottomThreshold = _immBottomShowing + ? (document.querySelector('.now-playing-bar')?.offsetHeight ?? 0) + 12 + : _IMM_EDGE; + + const atTop = e.clientY < topThreshold; + const atBottom = e.clientY > window.innerHeight - bottomThreshold; if (atTop !== _immTopShowing) { _immTopShowing = atTop; document.body.classList.toggle('reader-show-top', atTop);