mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-16 04: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
|
// tracking mouse position
|
||||||
window.addEventListener('mousemove', listener);
|
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(() => {
|
createEffect(() => {
|
||||||
if (!menu() && data()) {
|
if (!menu() && data()) {
|
||||||
setMenu(data() ?? null);
|
setMenu(data() ?? null);
|
||||||
|
|||||||
Reference in New Issue
Block a user