Minefun Sky Color Shift

Change sky colors locally (client-side only)

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği yüklemek için Tampermonkey gibi bir uzantı yüklemeniz gerekir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

Bu stili yüklemek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için Stylus gibi bir uzantı kurmanız gerekir.

Bu stili yükleyebilmek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı kurmanız gerekir.

Bu stili yükleyebilmek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Minefun Sky Color Shift
// @namespace    https://greasyfork.org
// @version      1.2
// @description  Change sky colors locally (client-side only)
// @match        *://*minefun*/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    // ===== STYLE INJECTION =====
    const style = document.createElement("style");
    style.innerHTML = `
    .sky-filter {
        filter: hue-rotate(0deg) saturate(2) brightness(1.2) !important;
        transition: filter 0.5s linear;
    }

    #skyBtn {
        position: fixed;
        top: 100px;
        right: 20px;
        z-index: 99999;
        padding: 10px 14px;
        background: #111;
        color: white;
        border: 1px solid #444;
        cursor: pointer;
        user-select: none;
        font-family: sans-serif;
    }
    `;
    document.head.appendChild(style);

    // ===== APPLY TO GAME ROOT =====
    function applySky() {
        // Minefun thường dùng body hoặc canvas wrapper
        document.body.classList.add("sky-filter");
    }

    function removeSky() {
        document.body.classList.remove("sky-filter");
    }

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

    let enabled = false;
    let hue = 0;
    let interval = null;

    const colorsSpeed = 20;

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

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

            applySky();

            interval = setInterval(() => {
                hue += 15;
                if (hue > 360) hue = 0;

                document.body.style.filter =
                    `hue-rotate(${hue}deg) saturate(2) brightness(1.3)`;

            }, colorsSpeed);

        } else {
            btn.innerText = "Sky OFF";

            clearInterval(interval);
            removeSky();
            document.body.style.filter = "none";
        }
    };

    // ===== 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);

})();