This commit is contained in:
2026-09-10 18:44:46 +02:00
parent dbdf8b0d8b
commit d30693cdef
2 changed files with 7 additions and 3 deletions
+6 -3
View File
@@ -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',