您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
made with much love
// ==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); } });