Replace Images with Animated Smiley

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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