Merge branch 'master' into timer

This commit is contained in:
Daniel Schädler 2025-03-19 16:19:35 +01:00
commit 113d42ab16
1 changed files with 4 additions and 1 deletions

View File

@ -114,13 +114,16 @@ export function FavoriteBar({teams}) {
scrollTo.classList.add('scroll-to-highlight');
setTimeout(() => {
scrollTo.classList.remove('scroll-to-highlight');
}, 2000);
}, 1005);
window.removeEventListener('scroll', handleScroll);
}, 100);
};
scrollTo.scrollIntoView({behavior: 'smooth', block: 'center'}); // Smoothly scroll to the target element
// scroll up a tiny amount to reset the scroll event listener if user is already on the element
window.scrollBy(0, 1);
// Add a scroll event listener to start the highlighting after scrolling only
window.addEventListener('scroll', handleScroll);
};