Przeglądaj źródła

fix: hide themesong logo if integration is enabled

Sv443 5 miesięcy temu
rodzic
commit
0cc6336aa4

+ 1 - 0
assets/resources.json

@@ -6,6 +6,7 @@
   "css-fix_playerpage_theming": "style/fixPlayerPageTheming.css",
   "css-fix_spacing": "style/fixSpacing.css",
   "css-fix_sponsorblock": "style/fixSponsorBlock.css",
+  "css-hide_themesong_logo": "style/hideThemeSongLogo.css",
   "css-show_votes": "style/showVotes.css",
   "css-vol_slider_size": "style/volSliderSize.css",
   "doc-changelog": {

+ 3 - 0
assets/style/hideThemeSongLogo.css

@@ -0,0 +1,3 @@
+ytmusic-logo #ts-logo-container {
+  display: none;
+}

+ 9 - 3
src/features/integrations.ts

@@ -46,11 +46,17 @@ export async function fixPlayerPageTheming() {
 /** Sets the lightness of the theme color used by BYTM according to the configured lightness value */
 export async function fixThemeSong() {
   try {
+    await addStyleFromResource("css-hide_themesong_logo");
+
     const cssVarName = (() => {
       switch(getFeature("themeSongLightness")) {
-      case "darker": return "--ts-palette-darkmuted-hex";
-      case "normal": return "--ts-palette-muted-hex";
-      case "lighter": return "--ts-palette-lightmuted-hex";
+      default:
+      case "darker":
+        return "--ts-palette-darkmuted-hex";
+      case "normal":
+        return "--ts-palette-muted-hex";
+      case "lighter":
+        return "--ts-palette-lightmuted-hex";
       };
     })();
     document.documentElement.style.setProperty("--bytm-themesong-bg-accent-col", `var(${cssVarName})`);