Делает чат LolzTeam прозрачным.
当前为
// ==UserScript==
// @name Lolz Transparent Chat
// @namespace http://tampermonkey.net/
// @version 1.9
// @description Делает чат LolzTeam прозрачным.
// @author https://lolz.live/members/5332159/zDEBRY
// @match https://lzt.market/*
// @match https://lolz.live/*
// @grant none
// @license MIT
// ==/UserScript==
(function() {
'use strict';
const blurEnabled = true; // Установите true для включения размытия или false для его отключения
const applyStylesToChat = (chatElement) => {
if (chatElement) {
chatElement.style.backgroundColor = 'rgba(0, 0, 0, 0.4)';
chatElement.style.backdropFilter = blurEnabled ? 'blur(8px)' : 'none';
chatElement.style.border = '1px solid rgba(255, 255, 255, 0.2)';
const childElements = chatElement.querySelectorAll('*');
childElements.forEach(el => {
el.style.backgroundColor = 'transparent';
el.style.border = 'none';
});
const taggedMessageBlocks = chatElement.querySelectorAll('.chat2-message-tagged.lztng-4kgdqr .chat2-message-block.lztng-4kgdqr');
taggedMessageBlocks.forEach(block => {
block.style.border = '2px solid rgb(0, 255, 0)';
block.style.borderRadius = '10px';
block.style.backgroundColor = 'transparent';
block.style.padding = '4px';
});
const messageBlocks = chatElement.querySelectorAll('.chat2-message-block.lztng-4kgdqr');
messageBlocks.forEach(block => {
block.style.backgroundColor = 'transparent';
});
}
};
const createRainbowText = (nickElement) => {
if (!nickElement.classList.contains('rainbow-applied')) {
nickElement.style.backgroundImage = 'linear-gradient(90deg, red, orange, yellow, green, cyan, blue, violet)';
nickElement.style.webkitBackgroundClip = 'text';
nickElement.style.webkitTextFillColor = 'transparent';
nickElement.style.fontWeight = 'bold';
nickElement.style.animation = 'rainbow 3s linear infinite';
nickElement.classList.add('rainbow-applied');
}
};
const applyRainbowNick = () => {
const nickElements = document.querySelectorAll('span');
nickElements.forEach(nickElement => {
if (nickElement.textContent === 'zDEBRY') {
createRainbowText(nickElement);
}
});
};
const initializeChatStyling = () => {
const chatElement = document.querySelector('[class^="chat2-floating"]');
if (chatElement) {
applyStylesToChat(chatElement);
const observer = new MutationObserver(() => {
applyStylesToChat(chatElement);
applyRainbowNick();
});
observer.observe(chatElement, {
childList: true,
subtree: true
});
} else {
setTimeout(initializeChatStyling, 300);
}
applyRainbowNick();
};
const addRainbowAnimationStyles = () => {
const style = document.createElement('style');
style.textContent = `
@keyframes rainbow {
0% { background-position: 0% 50%; }
100% { background-position: 100% 50%; }
}
`;
document.head.appendChild(style);
};
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', () => {
addRainbowAnimationStyles();
initializeChatStyling();
});
} else {
addRainbowAnimationStyles();
initializeChatStyling();
}
})();