mirror of
https://github.com/nuttylmao/nutty.gg.git
synced 2026-09-18 19:50:58 -04:00
• 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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user