From 2c337953ebd76699ec1f74f8dc28b2d9e72b9703 Mon Sep 17 00:00:00 2001 From: Su-Yong Date: Wed, 4 Oct 2023 00:15:54 +0900 Subject: [PATCH] fix(album-color-theme): fix album-color-theme not working in macos --- plugins/album-color-theme/front.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/album-color-theme/front.ts b/plugins/album-color-theme/front.ts index 0400586a..7cd28d16 100644 --- a/plugins/album-color-theme/front.ts +++ b/plugins/album-color-theme/front.ts @@ -54,15 +54,6 @@ function hexToHSL(H: string) { return [h,s,l]; } -// updated elements -const playerPage = document.querySelector('#player-page'); -const navBarBackground = document.querySelector('#nav-bar-background'); -const ytmusicPlayerBar = document.querySelector('ytmusic-player-bar'); -const playerBarBackground = document.querySelector('#player-bar-background'); -const sidebarBig = document.querySelector('#guide-wrapper'); -const sidebarSmall = document.querySelector('#mini-guide-background'); -const ytmusicAppLayout = document.querySelector('#layout'); - let hue = 0; let saturation = 0; let lightness = 0; @@ -74,6 +65,15 @@ function changeElementColor(element: HTMLElement | null, hue: number, saturation } export default (_: ConfigType<'album-color-theme'>) => { + // updated elements + const playerPage = document.querySelector('#player-page'); + const navBarBackground = document.querySelector('#nav-bar-background'); + const ytmusicPlayerBar = document.querySelector('ytmusic-player-bar'); + const playerBarBackground = document.querySelector('#player-bar-background'); + const sidebarBig = document.querySelector('#guide-wrapper'); + const sidebarSmall = document.querySelector('#mini-guide-background'); + const ytmusicAppLayout = document.querySelector('#layout'); + const observer = new MutationObserver((mutationsList) => { for (const mutation of mutationsList) { if (mutation.type === 'attributes') {