Skip to content

Commit

Permalink
fix nav bar color change onscroll
Browse files Browse the repository at this point in the history
  • Loading branch information
luluna02 authored and Su-Yong committed May 16, 2024
1 parent e6b2511 commit 4415927
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/plugins/in-app-menu/renderer/TitleBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4415927

Please sign in to comment.