Platzi - AntiCodeSpam blur!

Put a blur effect on code comments to prevent spoilers

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

Advertisement:

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

Advertisement:

// ==UserScript==
// @name         Platzi - AntiCodeSpam blur!
// @namespace    http://tampermonkey.net/
// @version      0.2
// @author       Facundo Soto
// @match        https://platzi.com/clases/*
// @description  Put a blur effect on code comments to prevent spoilers
// @icon         https://www.google.com/s2/favicons?domain=platzi.com
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @require      https://greasyfork.org/scripts/31940-waitforkeyelements/code/waitForKeyElements.js?version=209282
// @grant        GM_addStyle
// @run-at       document-idle
// ==/UserScript==

waitForKeyElements ("#material-view pre code", function(e) {

    var elemento = $(e[0]);

    elemento.css({"filter": "blur(5px)grayscale(1)", "transition": ".2s ease"});

    elemento.hover(
        function () {
            $(this).css("filter", "blur(0px)")
        },

        function () {
            $(this).css("filter", "blur(5px)grayscale(1)")
        }
    )

});