• Added new CSS option: --random-youtube-colors

• Added new CSS option: --youtube-color
• Added new CSS option: --youtube-custom-sub-icon
This commit is contained in:
nuttylmao
2025-09-22 06:45:07 +10:00
parent 54d7190f40
commit 5bb7686174
5 changed files with 63 additions and 9 deletions
+19 -3
View File
@@ -19,7 +19,16 @@ let alertQueue = [];
const kickPusherWsUrl = 'wss://ws-us2.pusher.com/app/32cbd69e4b950bf97679?protocol=7&client=js&version=7.6.0&flash=false';
let kickSubBadges = [];
/////////////////
// CSS OPTIONS //
/////////////////
const randomYouTubeColors = getComputedStyle(document.documentElement).getPropertyValue('--random-youtube-colors').trim() === '1';
const youtubeColor = getComputedStyle(document.documentElement).getPropertyValue('--youtube-color').trim();
const youtubeCustomSubIcon = getComputedStyle(document.documentElement)
.getPropertyValue('--youtube-custom-sub-icon')
.trim()
.replace(/^["']|["']$/g, ''); // removes surrounding quotes
/////////////
// OPTIONS //
@@ -854,7 +863,10 @@ function YouTubeMessage(data) {
// Set the message data
if (showUsername) {
usernameDiv.innerText = data.user.name;
usernameDiv.style.color = "#f70000"; // YouTube users do not have colors, so just set it to red
if (randomYouTubeColors)
usernameDiv.style.color = StringToHex(data.user.name);
else
usernameDiv.style.color = youtubeColor; // YouTube users do not have colors, so just set it to red
}
if (showMessage) {
@@ -890,9 +902,13 @@ function YouTubeMessage(data) {
badgeListDiv.appendChild(badge);
}
if (data.user.isSponsor && showBadges) {
// if (data.user.isSponsor && showBadges) {
if (!data.user.isSponsor && showBadges) {
const badge = new Image();
badge.src = `icons/badges/youtube-member.svg`;
if (youtubeCustomSubIcon)
badge.src = youtubeCustomSubIcon;
else
badge.src = `icons/badges/youtube-member.svg`;
badge.style.filter = `invert(100%)`;
badge.style.opacity = 0.8;
badge.classList.add("badge");
+2 -1
View File
@@ -2,7 +2,8 @@
margin: 0;
padding: 0;
--margin: 0px;
--border-radius: 20px;
--border-radius: 0.5em;
--youtube-color: #f70000;
}
body {