vuchaev2015

Превращает весь форум в вучаевых

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         vuchaev2015
// @license      MIT
// @version      1.0
// @author       k1erry
// @icon         https://i.imgur.com/phojwCv.jpg
// @description  Превращает весь форум в вучаевых
// @match        https://zelenka.guru/*
// @match        https://lzt.market/*
// @namespace    http://example.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const replacementImageURL = 'https://zelenka.guru/data/avatars/l/302/302690.jpg';

    const newStyle = `
        background: linear-gradient(180deg, #FFFFFF 25%, rgba(0, 0, 0, 0.37) 52.08%), radial-gradient(86.67% 86.67% at 50% 50%, #D9D9D9 0%, #767676 34.38%, #3A3A3A 50.51%, #FBFBFB 50.52%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        text-shadow: 0px -2px 5px rgba(255, 255, 255, 0.54), 0px 2px 5px rgba(0, 0, 0, 0.86);
    `;

    function replaceImagesAndStyles() {
        const allImages = document.querySelectorAll('img');
        allImages.forEach(img => {
            img.src = replacementImageURL;
        });

        const avatars = document.querySelectorAll('.avatar');
        avatars.forEach(avatar => {
            const span = avatar.querySelector('.img');
            if (span) {
                span.style.backgroundImage = `url('${replacementImageURL}')`;
            }

            const img = avatar.querySelector('img');
            if (img) {
                img.src = replacementImageURL;
            }
        });

        const sidebarImages = document.querySelectorAll('img.sidebarUserAvatar');
        sidebarImages.forEach(img => {
            img.src = replacementImageURL;
        });

        const usernames = document.querySelectorAll('.username');
        usernames.forEach(username => {
            username.style.cssText = newStyle;
        });

        const spansWithInlineStyles = document.querySelectorAll('span[style*="color: #ebebff;"]');
        spansWithInlineStyles.forEach(span => {
            span.style.cssText = newStyle;
        });
    }

    const observer = new MutationObserver(replaceImagesAndStyles);
    const config = { childList: true, subtree: true };
    observer.observe(document.body, config);

    replaceImagesAndStyles();
})();