Merge branch 'master' into timer
This commit is contained in:
commit
113d42ab16
|
|
@ -114,13 +114,16 @@ export function FavoriteBar({teams}) {
|
||||||
scrollTo.classList.add('scroll-to-highlight');
|
scrollTo.classList.add('scroll-to-highlight');
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
scrollTo.classList.remove('scroll-to-highlight');
|
scrollTo.classList.remove('scroll-to-highlight');
|
||||||
}, 2000);
|
}, 1005);
|
||||||
window.removeEventListener('scroll', handleScroll);
|
window.removeEventListener('scroll', handleScroll);
|
||||||
}, 100);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
scrollTo.scrollIntoView({behavior: 'smooth', block: 'center'}); // Smoothly scroll to the target element
|
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
|
// Add a scroll event listener to start the highlighting after scrolling only
|
||||||
window.addEventListener('scroll', handleScroll);
|
window.addEventListener('scroll', handleScroll);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue