Lolz transparent chat

Меняет чат LolzTeam на прозрачный

目前為 2024-11-23 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Lolz transparent chat
// @namespace    http://tampermonkey.net/
// @version      1.6
// @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)'; // Прозрачность контейнера: Измените 0.4 для настройки прозрачности (Меньше - он более прозрачный)
            chatElement.style.backdropFilter = blurEnabled ? 'blur(8px)' : 'none'; // Размытие: Измените 8px для настройки степени размытия.
            chatElement.style.border = '1px solid rgba(255, 255, 255, 0.2)';

            const childElements = chatElement.querySelectorAll('*');
            childElements.forEach(el => {
                el.style.backgroundColor = 'transparent';
                el.style.color = 'rgba(255, 255, 255, 0.9)';
                el.style.border = 'none';
            });
        }
    };

    setTimeout(() => {
        const chatElement = document.querySelector('.chat2-floating');

        applyStylesToChat(chatElement);

        if (chatElement) {
            const observer = new MutationObserver(() => {
                applyStylesToChat(chatElement);
            });

            observer.observe(chatElement, {
                childList: true,
                subtree: true
            });
        }
    }, 2000);
})();