From 8f23acf7a10f053bed77b383ceb9270b9044cd08 Mon Sep 17 00:00:00 2001 From: Sv443 Date: Wed, 2 Aug 2023 17:50:19 +0200 Subject: [PATCH] feat: replace favicon too --- dist/BetterYTM.user.js | 12 +++++++++--- src/features/layout.css | 7 +++++-- src/features/layout.ts | 4 ++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/dist/BetterYTM.user.js b/dist/BetterYTM.user.js index caaf8d7dc0..1c5c3246a1 100644 --- a/dist/BetterYTM.user.js +++ b/dist/BetterYTM.user.js @@ -489,7 +489,7 @@ const scriptInfo = { name: GM.info.script.name, version: GM.info.script.version, namespace: GM.info.script.namespace, - lastCommit: "e7a2c9f", // assert as generic string instead of literal + lastCommit: "df6a5c7", // assert as generic string instead of literal }; @@ -1034,6 +1034,9 @@ function exchangeLogo() { newLogo.className = "bytm-mod-logo-img"; newLogo.src = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.getAssetUrl)("icon/icon.png"); logoElem.insertBefore(newLogo, logoElem.querySelector("svg")); + document.head.querySelectorAll("link[rel=\"icon\"]").forEach(e => { + e.href = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.getAssetUrl)("icon/icon.png"); + }); setTimeout(() => { logoElem.querySelectorAll(".bytm-mod-logo-ellipse").forEach(e => e.remove()); }, 1000); @@ -2637,14 +2640,17 @@ ytmusic-logo a.bytm-logo-exchanged .bytm-mod-logo-img { } @keyframes rotate-fade-in { - from { + 0% { + opacity: 0; transform: rotate(0deg); + } + 30% { opacity: 0; } 90% { opacity: 1; } - to { + 100% { transform: rotate(360deg); } } diff --git a/src/features/layout.css b/src/features/layout.css index 32c91c980c..3bfbbfb323 100644 --- a/src/features/layout.css +++ b/src/features/layout.css @@ -64,14 +64,17 @@ ytmusic-logo a.bytm-logo-exchanged .bytm-mod-logo-img { } @keyframes rotate-fade-in { - from { + 0% { + opacity: 0; transform: rotate(0deg); + } + 30% { opacity: 0; } 90% { opacity: 1; } - to { + 100% { transform: rotate(360deg); } } diff --git a/src/features/layout.ts b/src/features/layout.ts index 6c8062587c..ae325e18f3 100644 --- a/src/features/layout.ts +++ b/src/features/layout.ts @@ -93,6 +93,10 @@ function exchangeLogo() { logoElem.insertBefore(newLogo, logoElem.querySelector("svg")); + document.head.querySelectorAll("link[rel=\"icon\"]").forEach(e => { + e.href = getAssetUrl("icon/icon.png"); + }); + setTimeout(() => { logoElem.querySelectorAll(".bytm-mod-logo-ellipse").forEach(e => e.remove()); }, 1000);