mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
fix nav bar color change onscroll
This commit is contained in:
@ -270,8 +270,21 @@ export const TitleBar = (props: TitleBarProps) => {
|
||||
|
||||
// tracking mouse position
|
||||
window.addEventListener('mousemove', listener);
|
||||
const ytmusicAppLayout = document.querySelector<HTMLElement>('#layout');
|
||||
ytmusicAppLayout?.addEventListener("scroll",()=>{
|
||||
const scrollValue = ytmusicAppLayout.scrollTop;
|
||||
if (scrollValue > 20){
|
||||
ytmusicAppLayout.classList.add("content-scrolled");
|
||||
}
|
||||
else{
|
||||
ytmusicAppLayout.classList.remove("content-scrolled");
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
createEffect(() => {
|
||||
if (!menu() && data()) {
|
||||
setMenu(data() ?? null);
|
||||
|
||||
Reference in New Issue
Block a user