vuchaev2015

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

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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();
})();