Minefun FPS Boost

Tăng FPS cho Minefun

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला 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         Minefun FPS Boost
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Tăng FPS cho Minefun
// @match        *://minefun.io/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    let enabled = false;

    const btn = document.createElement("button");

    btn.innerText = "FPS BOOST OFF";

    btn.style.position = "fixed";
    btn.style.top = "20px";
    btn.style.right = "20px";
    btn.style.zIndex = "999999";
    btn.style.padding = "10px";
    btn.style.border = "none";
    btn.style.borderRadius = "10px";
    btn.style.background = "#222";
    btn.style.color = "white";
    btn.style.cursor = "pointer";

    document.body.appendChild(btn);

    const style = document.createElement("style");

    function enableBoost() {

        style.innerHTML = `
            * {
                animation: none !important;
                transition: none !important;
                text-shadow: none !important;
                box-shadow: none !important;
            }

            canvas {
                image-rendering: pixelated !important;
                filter: contrast(1.05);
            }
        `;

        document.head.appendChild(style);

        document.body.style.background = "#000";

        console.log("FPS BOOST ENABLED");
    }

    function disableBoost() {
        style.remove();
        document.body.style.background = "";
        console.log("FPS BOOST DISABLED");
    }

    btn.onclick = () => {

        enabled = !enabled;

        btn.innerText =
            enabled
                ? "FPS BOOST ON"
                : "FPS BOOST OFF";

        btn.style.background =
            enabled
                ? "#00cc66"
                : "#222";

        if (enabled) {
            enableBoost();
        } else {
            disableBoost();
        }

    };

})();