Greasy Fork is available in English.

rainbow

made with much love

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         rainbow
// @description  made with much love
// @version      0.0.1
// @author       Cazka#1820
// @match        *://digdig.io/
// @icon         https://www.google.com/s2/favicons?domain=digdig.io
// @grant        none
// @namespace https://greasyfork.org/users/541070s
// ==/UserScript==

let i = 0;

const { set: fillStyleSetter } = Object.getOwnPropertyDescriptor(CanvasRenderingContext2D.prototype, "fillStyle");
Object.defineProperty(CanvasRenderingContext2D.prototype, "fillStyle", {
    set(value) {
        i = 1;
        fillStyleSetter.call(this, value);
    }
});
const { set: globalAlphaSetter } = Object.getOwnPropertyDescriptor(CanvasRenderingContext2D.prototype, "globalAlpha");
Object.defineProperty(CanvasRenderingContext2D.prototype, "globalAlpha", {
    set(value) {
        if(i == 1 && value > 0.25) i = 2;
        else i = 0;
        globalAlphaSetter.call(this, value);
    }
});
const colors = ['#ff0000', '#ff8000', '#ffff00', '#80ff00', '#00ff00', '#00ff80', '#00ffff', '#0080ff', '#0000ff', '#8000ff', '#ff00ff', '#ff0080'];
window.CanvasRenderingContext2D.prototype.fillRect = new Proxy(window.CanvasRenderingContext2D.prototype.fillRect, {
    apply(target, thisArgs, args) {
        if(i==2) {
            thisArgs.fillStyle = colors[(Math.floor((Date.now() / 100) + 2.5*thisArgs.globalAlpha)) % colors.length];
            thisArgs.globalAlpha *= 0.8;
        }
        i = 0;
        Reflect.apply(target, thisArgs, args);
    }
});