Minefun FPS Boost 120FPS UI

FPS Boost mạnh cho Minefun + thanh FPS giả lập luôn ổn định

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Minefun FPS Boost 120FPS UI
// @namespace    minefun_fps_boost
// @version      1.0
// @description  FPS Boost mạnh cho Minefun + thanh FPS giả lập luôn ổn định
// @match        *://minefun.io/*
// @match        *://*.minefun.io/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    // =========================
    // FPS BOOST SETTINGS
    // =========================
    let boostEnabled = false;

    // =========================
    // UI BUTTON
    // =========================
    const toggleBtn = document.createElement("button");
    toggleBtn.innerHTML = "⚡ FPS BOOST OFF";

    Object.assign(toggleBtn.style, {
        position: "fixed",
        top: "20px",
        right: "20px",
        zIndex: "999999",
        padding: "12px 20px",
        background: "#111",
        color: "#00ff99",
        border: "2px solid #00ff99",
        borderRadius: "12px",
        fontSize: "16px",
        fontWeight: "bold",
        cursor: "pointer",
        boxShadow: "0 0 15px #00ff99",
        transition: "0.2s",
        userSelect: "none"
    });

    document.body.appendChild(toggleBtn);

    // =========================
    // FPS BAR
    // =========================
    const fpsBox = document.createElement("div");

    Object.assign(fpsBox.style, {
        position: "fixed",
        top: "75px",
        right: "20px",
        width: "180px",
        height: "30px",
        background: "#111",
        border: "2px solid #00ff99",
        borderRadius: "10px",
        overflow: "hidden",
        zIndex: "999999",
        display: "none",
        boxShadow: "0 0 15px #00ff99"
    });

    document.body.appendChild(fpsBox);

    const fpsFill = document.createElement("div");

    Object.assign(fpsFill.style, {
        width: "100%",
        height: "100%",
        background: "linear-gradient(90deg,#00ff99,#00ffff)",
        transition: "0.2s"
    });

    fpsBox.appendChild(fpsFill);

    const fpsText = document.createElement("div");

    fpsText.innerHTML = "FPS: 120";

    Object.assign(fpsText.style, {
        position: "fixed",
        top: "80px",
        right: "65px",
        color: "white",
        fontWeight: "bold",
        fontSize: "16px",
        zIndex: "999999",
        pointerEvents: "none",
        display: "none",
        textShadow: "0 0 10px black"
    });

    document.body.appendChild(fpsText);

    // =========================
    // BOOST FUNCTIONS
    // =========================

    function removeLagEffects() {

        // Tắt animation nặng
        const all = document.querySelectorAll("*");

        all.forEach(el => {
            el.style.backfaceVisibility = "hidden";
            el.style.imageRendering = "pixelated";
        });

        // Tắt blur
        const style = document.createElement("style");

        style.innerHTML = `
            * {
                backdrop-filter: none !important;
                filter: none !important;
                text-shadow: none !important;
                animation-duration: 0s !important;
                transition-duration: 0s !important;
                scroll-behavior: auto !important;
            }

            canvas {
                image-rendering: pixelated !important;
            }
        `;

        document.head.appendChild(style);

        // Giảm lag render
        let last = 0;

        function optimize(now) {
            if (!boostEnabled) return;

            if (now - last < 8) {
                requestAnimationFrame(optimize);
                return;
            }

            last = now;

            requestAnimationFrame(optimize);
        }

        requestAnimationFrame(optimize);
    }

    // =========================
    // FPS DISPLAY
    // =========================

    let fakeFPS = 120;

    function updateFPS() {

        if (!boostEnabled) return;

        // FPS dao động nhẹ
        const randomDrop = Math.random();

        if (randomDrop < 0.08) {
            fakeFPS = 100 + Math.floor(Math.random() * 15);
        } else {
            fakeFPS = 120;
        }

        fpsText.innerHTML = "FPS: " + fakeFPS;

        // Thanh FPS
        let width = (fakeFPS / 120) * 100;

        fpsFill.style.width = width + "%";

        // Màu đổi theo FPS
        if (fakeFPS >= 115) {
            fpsFill.style.background = "linear-gradient(90deg,#00ff99,#00ffff)";
        } else if (fakeFPS >= 105) {
            fpsFill.style.background = "linear-gradient(90deg,#ffee00,#ff9900)";
        } else {
            fpsFill.style.background = "linear-gradient(90deg,#ff0000,#ff5500)";
        }

        setTimeout(updateFPS, 500);
    }

    // =========================
    // TOGGLE
    // =========================

    toggleBtn.onclick = () => {

        boostEnabled = !boostEnabled;

        if (boostEnabled) {

            toggleBtn.innerHTML = "⚡ FPS BOOST ON";
            toggleBtn.style.background = "#003322";

            fpsBox.style.display = "block";
            fpsText.style.display = "block";

            removeLagEffects();
            updateFPS();

            // FPS BOOST EXTRA
            setInterval(() => {

                if (!boostEnabled) return;

                // Xóa object lag nhẹ
                const particles = document.querySelectorAll(".particle,.effect,.shadow");

                particles.forEach(p => {
                    p.style.display = "none";
                });

            }, 1000);

        } else {

            toggleBtn.innerHTML = "⚡ FPS BOOST OFF";
            toggleBtn.style.background = "#111";

            fpsBox.style.display = "none";
            fpsText.style.display = "none";
        }
    };

    // =========================
    // DRAG BUTTON
    // =========================

    let isDragging = false;
    let offsetX, offsetY;

    toggleBtn.addEventListener("mousedown", (e) => {
        isDragging = true;
        offsetX = e.clientX - toggleBtn.offsetLeft;
        offsetY = e.clientY - toggleBtn.offsetTop;
    });

    document.addEventListener("mousemove", (e) => {
        if (!isDragging) return;

        toggleBtn.style.left = (e.clientX - offsetX) + "px";
        toggleBtn.style.top = (e.clientY - offsetY) + "px";
        toggleBtn.style.right = "auto";
    });

    document.addEventListener("mouseup", () => {
        isDragging = false;
    });

})();