Furry34 Blur

The blur is removed individually when pointing or playing a video, without interfering with the viewing.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Furry34 Blur
// @name:ru      Furry34 Размытие
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  The blur is removed individually when pointing or playing a video, without interfering with the viewing.
// @description:ru  Размытие снимается индивидуально при наведении или воспроизведении видео, не мешая просмотру.
// @author       scody
// @license      MIT
// @match        *://furry34.com/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    const style = document.createElement('style');
    style.textContent = `
        .blurred-media {
            filter: blur(18px);
            transition: filter 0.2s ease-in-out;
            position: relative;
            cursor: pointer;
        }

        .blurred-media.revealed {
            filter: none !important;
        }
    `;
    document.head.appendChild(style);

    function applySimpleBlur(el) {
        el.classList.add('blurred-media');

        const isVideo = el.tagName.toLowerCase() === 'video';

        if (isVideo) {
            el.setAttribute('preload', 'metadata');
        }

        el.addEventListener('mouseenter', () => {
            if (!isVideo || el.paused) {
                el.classList.add('revealed');
            }
        });

        el.addEventListener('mouseleave', () => {
            if (!isVideo || el.paused) {
                el.classList.remove('revealed');
            }
        });

        if (isVideo) {
            el.addEventListener('play', () => {
                el.classList.add('revealed');
            });

            el.addEventListener('pause', () => {
                el.classList.remove('revealed');
            });

            el.addEventListener('ended', () => {
                el.classList.remove('revealed');
            });
        }
    }

    function processAll() {
        const imgs = document.querySelectorAll('img:not([data-blur-applied])');
        const vids = document.querySelectorAll('video:not([data-blur-applied])');

        imgs.forEach(img => {
            img.setAttribute('data-blur-applied', 'true');
            applySimpleBlur(img);
        });

        vids.forEach(video => {
            video.setAttribute('data-blur-applied', 'true');
            applySimpleBlur(video);

            if (!video.paused && !video.ended && video.readyState > 2) {
                video.classList.add('revealed');
            }
        });
    }

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

    processAll();
})();