Minefun Sky Text Flash

Sky text flashing colors for Minefun

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Minefun Sky Text Flash
// @namespace    https://greasyfork.org
// @version      1.1
// @description  Sky text flashing colors for Minefun
// @match        *://*minefun*/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    // ===== SKY TEXT =====
    const skyText = document.createElement("div");
    skyText.innerText = "☁ BẦU TRỜI GALAXY ☁";
    document.body.appendChild(skyText);

    Object.assign(skyText.style, {
        position: "fixed",
        top: "20px",
        left: "50%",
        transform: "translateX(-50%)",
        fontSize: "22px",
        fontWeight: "bold",
        zIndex: "9999",
        pointerEvents: "none",
        color: "#00ffcc",
        textShadow: "0 0 10px black",
        transition: "0.3s"
    });

    // ===== BUTTON =====
    const btn = document.createElement("div");
    btn.innerText = "Sky OFF";
    document.body.appendChild(btn);

    Object.assign(btn.style, {
        position: "fixed",
        top: "100px",
        right: "20px",
        zIndex: "10000",
        padding: "8px 12px",
        background: "#111",
        color: "#fff",
        border: "1px solid #444",
        cursor: "pointer",
        userSelect: "none"
    });

    let enabled = false;

    const colors = ["#00ffff", "#ff0033", "#cc00ff", "#ffcc00"];
    let i = 0;
    let interval = null;

    btn.onclick = () => {
        enabled = !enabled;

        if (enabled) {
            btn.innerText = "Sky ON";

            interval = setInterval(() => {
                skyText.style.color = colors[i % colors.length];
                skyText.style.textShadow = `0 0 15px ${colors[i % colors.length]}`;
                i++;
            }, 300);

        } else {
            btn.innerText = "Sky OFF";
            clearInterval(interval);
            skyText.style.color = "#00ffcc";
            skyText.style.textShadow = "0 0 10px black";
        }
    };

    // ===== DRAG BUTTON =====
    let drag = false, ox, oy;

    btn.addEventListener("mousedown", (e) => {
        drag = true;
        ox = e.clientX - btn.offsetLeft;
        oy = e.clientY - btn.offsetTop;
    });

    document.addEventListener("mousemove", (e) => {
        if (!drag) return;
        btn.style.left = (e.clientX - ox) + "px";
        btn.style.top = (e.clientY - oy) + "px";
        btn.style.right = "auto";
    });

    document.addEventListener("mouseup", () => drag = false);

})();