k
This commit is contained in:
@@ -1100,9 +1100,11 @@ window.cancelAnimFrame = (function () {
|
||||
targetThumb.classList.add('onara-active');
|
||||
const rect = targetThumb.getBoundingClientRect();
|
||||
const navbarH = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--navbar-h')) || 50;
|
||||
const isInView = rect.top >= navbarH && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight);
|
||||
if (!isInView) {
|
||||
targetThumb.scrollIntoView({ block: 'center', inline: 'nearest', behavior: 'instant' });
|
||||
const vh = window.innerHeight || document.documentElement.clientHeight;
|
||||
// If any part of the thumbnail is already visible in the viewport, do not scroll
|
||||
const isVisible = rect.bottom > navbarH && rect.top < vh;
|
||||
if (!isVisible) {
|
||||
targetThumb.scrollIntoView({ block: 'nearest', inline: 'nearest', behavior: 'instant' });
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1216,6 +1218,7 @@ window.cancelAnimFrame = (function () {
|
||||
'.nav-prev',
|
||||
'.nav-next',
|
||||
'#random',
|
||||
'.steuerung',
|
||||
'.location',
|
||||
'.item_title',
|
||||
'.blahlol',
|
||||
|
||||
Reference in New Issue
Block a user