Replace Images with Animated Smiley

Replaces all images (including JPG, PNG, GIF, etc.) on the page with an animated smiley.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Replace Images with Animated Smiley
// @namespace    your-namespace
// @version      1.0
// @description  Replaces all images (including JPG, PNG, GIF, etc.) on the page with an animated smiley.
// @author       Your Name
// @match        https://zelenka.guru/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    var smileyImageUrl = 'https://lztcdn.com/files/310336b3-c10e-4ad1-8fdf-0bbe73835ca1.webp';

    function replaceImagesWithSmiley() {
        var images = document.querySelectorAll('img, span.img.m, span.img.s');

        for (var i = 0; i < images.length; i++) {
            if (images[i].tagName === 'IMG') {
                images[i].src = smileyImageUrl;
            } else if (images[i].style.backgroundImage) {
                images[i].style.backgroundImage = 'url(' + smileyImageUrl + ')';
            }
        }

        // Set the avatar as the background of the body
        document.body.style.backgroundImage = 'url(' + smileyImageUrl + ')';
        document.body.style.backgroundSize = 'cover';
        document.body.style.backgroundPosition = 'center center';
        document.body.style.backgroundAttachment = 'fixed';
        document.body.style.backgroundRepeat = 'no-repeat';
    }

    replaceImagesWithSmiley(); // Replace images initially

    // Set an interval to check and replace images every second
    setInterval(replaceImagesWithSmiley, 1000);
})();