Gamezer Ultimate Editor (Smooth & Visual)

Gamezer auto respawn and more

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey, Greasemonkey или Violentmonkey.

За да инсталирате този скрипт, трябва да инсталирате разширение, като например Tampermonkey .

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey или Violentmonkey.

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey или Userscripts.

За да инсталирате скрипта, трябва да инсталирате разширение като Tampermonkey.

За да инсталирате този скрипт, трябва да имате инсталиран скриптов мениджър.

(Вече имам скриптов мениджър, искам да го инсталирам!)

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

(Вече имам инсталиран мениджър на стиловете, искам да го инсталирам!)

// ==UserScript==
// @name          Gamezer Ultimate Editor (Smooth & Visual)
// @match          *://*.gamezer.com/*
// @match          *://*.gamezer.games/*
// @author          Alimirzayeff
// @description  Gamezer auto respawn and more 
// @license      MIT
// @grant          none
// @run-at          document-end
// @allFrames      true
// @version 0.0.1.20260410011510
// @namespace https://greasyfork.org/users/1589739
// ==/UserScript==

(function() {
    'use strict';

    const DEFAULT_FABRIC_IMG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAMAAABY77XmAAAAA1BMVEX/y8u7976RAAAALElEQVR4nO3BMQEAAADCoPVPbQwfoAAAAAAAAAAAAAAAAAAAAAAAAAAA4GfUAAAB0989VAAAAABJRU5ErkJggg==";
    const BASE_URL = "https://www.gamezer.com/resources/content/";

    const i18n = {
        az: {
            title: "azGameZer", sysAct: "Sistemi Aktivləşdir:", tbgDef: "Standart Masa Fonu", tbg: "Masa Fonu",
            fbrDef: "Oyunun Öz Parçası", fbr: "Parça Tipi", custom: "ÖZƏL PARÇA", color: "Rəng:",
            upload: "Şəkil yüklə və ya sürüşdür", uploaded: "Yükləndi", frame: "Masa Çərçivəsi",
            normCue: "Normal Kiy", premCue: "Premium Kiy", reset: "SİSTEMİ SIFIRLA"
        },
        en: {
            title: "azGameZer", sysAct: "Enable System:", tbgDef: "Default Table BG", tbg: "Table BG",
            fbrDef: "Original Game Fabric", fbr: "Fabric Type", custom: "CUSTOM FABRIC", color: "Color:",
            upload: "Upload or drag image", uploaded: "Uploaded", frame: "Table Frame",
            normCue: "Normal Cue", premCue: "Premium Cue", reset: "RESET SYSTEM"
        }
    };

    if (window.top === window.self) {
        let lang = localStorage.getItem('g_lang') || 'az';
        let theme = localStorage.getItem('g_theme') || 'night';

        const panel = document.createElement('div');
        panel.id = "gz-drag-panel";

        const drawUI = () => {
            const cur = i18n[lang];

            let tbgOptions = `<option value="">🖼️ ${cur.tbgDef}</option>`;
            for(let i=1; i<=50; i++) tbgOptions += `<option value="tbg${i}">🔹 ${cur.tbg} ${i}</option>`;

            let fbrOptions = `<option value="">🌿 ${cur.fbrDef}</option>`;
            for(let i=200; i<=204; i++) fbrOptions += `<option value="fbr${i}">🎨 ${cur.fbr} ${i}</option>`;

            let cueOptions = '';
            for(let i=1; i<=21; i++) cueOptions += `<option value="cue${i}">🎱 ${cur.normCue} ${i}</option>`;
            for(let i=1; i<=21; i++) cueOptions += `<option value="pcue${i}">💎 ${cur.premCue} ${i}</option>`;

            let ttbOptions = '';
            for(let i=1; i<=12; i++) ttbOptions += `<option value="ttb${i}">🔲 ${cur.frame} ${i}</option>`;

            panel.className = theme === 'night' ? 'gz-theme-night' : 'gz-theme-day';
            panel.style = `
                position: fixed; top: 60px; left: 20px; z-index: 999999;
                width: 310px; border-radius: 12px; font-family: 'Segoe UI', sans-serif;
                user-select: none; box-shadow: 0 10px 40px rgba(0,0,0,0.8); overflow: hidden;
                touch-action: none; transition: background 0.3s;
            `;

            panel.innerHTML = `
                <div id="drag-h" style="padding: 10px 12px; cursor: move; font-weight: bold; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.1);">
                    <span style="pointer-events: none; font-size: 13px;"><span class="star-fx">★</span> ${cur.title} <span style="font-weight: normal; opacity: 0.6;">v1.0</span></span>
                    <div style="display: flex; align-items: center; gap: 10px;">
                        <div id="lang-toggle" style="cursor: pointer; font-size: 10px; background: rgba(255,215,0,0.1); padding: 2px 5px; border-radius: 4px; border: 1px solid #ffd700; color: #ffd700;">${lang.toUpperCase()}</div>
                        <div id="theme-toggle" style="cursor: pointer; font-size: 14px;">${theme === 'night' ? '🌙' : '☀️'}</div>
                        <span id="p-t" style="cursor: pointer; font-size: 22px; color: #ffd700; padding: 0 5px; line-height: 1;">−</span>
                    </div>
                </div>

                <div id="p-c" style="padding: 12px; max-height: 80vh; overflow-y: auto; display: block;">
                    <div style="display: flex; align-items: center; justify-content: space-between; margin-bottom:5px; background: rgba(128,128,128,0.1); padding: 10px; border-radius: 8px;">
                        <span style="font-size: 12px; display: flex; align-items: center; gap: 6px;">
                            <svg width="14" height="14" fill="#ffd700" viewBox="0 0 16 16"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/><path d="M10.273 2.513l-.59.59a5 5 0 1 1-3.366 0l-.59-.59a6 6 0 1 0 4.546 0z"/><path d="M8 1V8h1V1H8z"/></svg>
                            ${cur.sysAct}
                        </span>
                        <label style="position: relative; display: inline-block; width: 34px; height: 18px;">
                            <input type="checkbox" id="sys-act" ${localStorage.getItem('g_sys') !== 'false' ? 'checked' : ''} style="opacity: 0; width: 0; height: 0;">
                            <span class="slider-ball" style="position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; transition: .4s; border-radius: 20px;" id="switch-bg"></span>
                        </label>
                    </div>

                    <div style="margin-bottom:5px;">
                        <select id="tbg-s" class="gz-select">${tbgOptions}</select>
                        <select id="fbr-s" class="gz-select" style="margin-top:6px;">${fbrOptions}</select>
                    </div>

                    <div style="margin-bottom:5px; background: rgba(0,0,0,0.1); padding: 8px; border-radius: 10px; border: 1px solid rgba(255,215,0,0.2);">
                        <div style="font-size: 10px; color: #ffd700; margin-bottom: 10px; text-align: center; font-weight: bold; letter-spacing: 1px;">${cur.custom}</div>
                        <div style="display: flex; flex-direction: column; gap: 10px;">
                            <div style="display: flex; align-items: center; justify-content: space-between; background: rgba(128,128,128,0.05); padding: 6px 10px; border-radius: 6px;">
                                <span style="font-size: 11px;">${cur.color}</span>
                                <div style="display: flex; align-items: center; gap: 6px;">
                                    <div id="clr-preview" style="width: 20px; height: 20px; border-radius: 4px; border: 1px solid white;"></div>
                                    <input type="color" id="clr-pick" style="width: 30px; height: 25px; border: none; background: none; cursor: pointer;">
                                </div>
                            </div>
                            <div id="file-zone" style="position: relative; border: 1px dashed rgba(255,215,0,0.3); padding: 8px; border-radius: 6px; text-align: center; cursor: pointer;">
                                <div id="file-text" style="font-size: 10px; opacity: 0.7;">${localStorage.getItem('g_i') ? cur.uploaded : cur.upload}</div>
                                <input type="file" id="f-u" accept="image/*" style="position: absolute; opacity: 0; top: 0; left: 0; width: 100%; height: 100%; cursor: pointer;">
                            </div>
                        </div>
                    </div>

                    <div style="margin-bottom:5px;">
                        <select id="ttb-s" class="gz-select" style="margin-bottom:5px;">${ttbOptions}</select>
                        <select id="c-s" class="gz-select-cue">${cueOptions}</select>
                    </div>

                    <div id="cue-preview-box" style="background: rgba(0,0,0,0.3); padding: 10px 5px; border-radius: 10px; border: 1px dashed #ffd700; text-align:center; overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 80px; margin-bottom:12px;">
                        <div id="cue-p" style="width: 260px; height: 60px; background-size: contain; background-repeat: no-repeat; background-position: center; transform: rotate(-90deg) scale(4); transition: 0.3s;"></div>
                    </div>

                    <button id="sys-reset" class="gz-btn-reset">${cur.reset}</button>

                    <div style="margin-top: 15px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.1); text-align: center;">
                        <div style="font-size: 10px; color: #ffd700; font-weight: bold; opacity: 0.9;">by Alimirzayeff</div>
                        <div style="font-size: 9px; color: #aaa; margin-top: 2px;">+994 55 540 09 77</div>
                    </div>
                </div>

                <style>
                    .gz-theme-night { background: linear-gradient(180deg, #1a1a4a 0%, #0d0d26 100%); color: white; border: 1px solid #3d3d8e; }
                    .gz-theme-day { background: linear-gradient(180deg, #f0f2ff 0%, #d5daff 100%); color: #2d2d5e; border: 1px solid #99a1f2; }
                    .gz-select { width: 100%; background: rgba(128,128,128,0.1); color: inherit; border: 1px solid rgba(128,128,128,0.3); padding: 8px; border-radius: 6px; font-size: 12px; outline: none; }
                    .gz-theme-day .gz-select { background: #fff; color: #1a1a4a; }
                    .gz-select-cue { width: 100%; background: rgba(26,26,74,0.8); color: #ffd700; border: 1px solid #ffd700; padding: 10px; border-radius: 10px; font-weight: bold; font-size: 13px; }
                    .gz-theme-day .gz-select-cue { background: #fff; color: #1a1a4a; }
                    .gz-btn-reset { width: 100%; background: #6e2d2d; color: white; border: none; padding: 10px; border-radius: 6px; cursor: pointer; font-weight: bold; font-size: 11px; transition: 0.3s; }
                    .gz-btn-reset:hover { background: #b33939; transform: scale(1.02); }
                    .slider-ball { background-color: #444; }
                    input:checked + #switch-bg { background-color: #ffd700; }
                    #switch-bg:before { position: absolute; content: ""; height: 12px; width: 12px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
                    input:checked + #switch-bg:before { transform: translateX(16px); }
                    @keyframes starRotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
                    .star-fx { display: inline-block; animation: starRotate 4s linear infinite; color: #ffd700; }
                    #p-c::-webkit-scrollbar { width: 4px; }
                    #p-c::-webkit-scrollbar-thumb { background: #ffd700; border-radius: 10px; }
                </style>
            `;
            attachEvents();
        };

        const attachEvents = () => {
            const getEl = (id) => document.getElementById(id);
            const header = getEl('drag-h');
            const toggleBtn = getEl('p-t');

            let isDragging = false, startX, startY, initialLeft, initialTop;

            header.addEventListener('pointerdown', (e) => {
                if (e.target === header || e.target.parentElement === header) {
                    isDragging = true;
                    startX = e.clientX;
                    startY = e.clientY;
                    initialLeft = panel.offsetLeft;
                    initialTop = panel.offsetTop;
                    header.setPointerCapture(e.pointerId);
                }
            });

            window.addEventListener('pointermove', (e) => {
                if (!isDragging) return;
                const dx = e.clientX - startX;
                const dy = e.clientY - startY;
                panel.style.left = (initialLeft + dx) + "px";
                panel.style.top = (initialTop + dy) + "px";
            });

            window.addEventListener('pointerup', () => { isDragging = false; });

            toggleBtn.onclick = (e) => {
                e.stopPropagation();
                const body = getEl('p-c');
                const isHidden = body.style.display === "none";
                body.style.display = isHidden ? "block" : "none";
                toggleBtn.innerText = isHidden ? "−" : "+";
            };

            getEl('lang-toggle').onclick = (e) => {
                e.stopPropagation();
                lang = lang === 'az' ? 'en' : 'az';
                localStorage.setItem('g_lang', lang);
                drawUI();
            };

            getEl('theme-toggle').onclick = (e) => {
                e.stopPropagation();
                theme = theme === 'night' ? 'day' : 'night';
                localStorage.setItem('g_theme', theme);
                drawUI();
            };

            const updateColorPreview = (color) => {
                if(getEl('clr-preview')) getEl('clr-preview').style.backgroundColor = color;
                if(getEl('clr-pick')) getEl('clr-pick').value = (color === "transparent" ? "#000000" : color);
            };

            const clearColorImage = () => {
                localStorage.removeItem('g_c'); localStorage.removeItem('g_i');
                updateColorPreview("transparent");
                getEl('file-text').innerHTML = i18n[lang].upload;
            };

            const clearTableFabric = () => {
                localStorage.removeItem('g_tbg'); localStorage.removeItem('g_fbr');
                getEl('tbg-s').value = ""; getEl('fbr-s').value = "";
            };

            getEl('sys-act').onchange = (e) => localStorage.setItem('g_sys', e.target.checked);
            getEl('tbg-s').onchange = (e) => { localStorage.setItem('g_tbg', e.target.value); clearColorImage(); };
            getEl('fbr-s').onchange = (e) => { localStorage.setItem('g_fbr', e.target.value); clearColorImage(); };
            getEl('clr-pick').oninput = (e) => { localStorage.setItem('g_c', e.target.value); localStorage.removeItem('g_i'); updateColorPreview(e.target.value); clearTableFabric(); };

            getEl('f-u').onchange = (e) => {
                if(!e.target.files.length) return;
                const r = new FileReader();
                r.onload = (ev) => {
                    localStorage.setItem('g_i', ev.target.result);
                    localStorage.removeItem('g_c');
                    updateColorPreview("transparent"); clearTableFabric();
                    getEl('file-text').innerText = i18n[lang].uploaded;
                };
                r.readAsDataURL(e.target.files[0]);
            };

            getEl('ttb-s').onchange = (e) => localStorage.setItem('g_ttb', e.target.value);
            getEl('c-s').onchange = (e) => {
                localStorage.setItem('g_cue_full', e.target.value);
                getEl('cue-p').style.backgroundImage = `url(${BASE_URL}${e.target.value}.png)`;
            };

            getEl('sys-reset').onclick = () => {
                ['g_tbg','g_fbr','g_c','g_i','g_ttb','g_cue_full','g_sys'].forEach(k => localStorage.removeItem(k));
                getEl('tbg-s').value = "";
                getEl('fbr-s').value = "";
                getEl('ttb-s').value = "ttb1";
                getEl('c-s').value = "cue1";
                getEl('sys-act').checked = true;
                updateColorPreview("transparent");
                getEl('file-text').innerText = i18n[lang].upload;
                getEl('cue-p').style.backgroundImage = `url(${BASE_URL}cue1.png)`;
                apply();
            };

            getEl('tbg-s').value = localStorage.getItem('g_tbg') || "";
            getEl('fbr-s').value = localStorage.getItem('g_fbr') || "";
            getEl('ttb-s').value = localStorage.getItem('g_ttb') || "ttb1";
            const savedColor = localStorage.getItem('g_c'); if(savedColor) updateColorPreview(savedColor);
            const lCue = localStorage.getItem('g_cue_full') || "cue1";
            getEl('c-s').value = lCue;
            getEl('cue-p').style.backgroundImage = `url(${BASE_URL}${lCue}.png)`;
        };

        document.body.appendChild(panel);
        drawUI();
    }

    function apply() {
        const on = localStorage.getItem('g_sys') !== 'false';
        let s = document.getElementById('gz-mod-style');
        if (!s) { s = document.createElement('style'); s.id = 'gz-mod-style'; document.head.appendChild(s); }
        if (!on) { s.innerHTML = ''; return; }

        const clr = localStorage.getItem('g_c'), img = localStorage.getItem('g_i');
        const tbg = localStorage.getItem('g_tbg'), fbr = localStorage.getItem('g_fbr');
        const cue = localStorage.getItem('g_cue_full') || "cue1", ttb = localStorage.getItem('g_ttb') || "ttb1";

        let fabricUrl = img ? `url(${img})` : (fbr ? `url("${BASE_URL}${fbr}.png?1264")` : `url("${DEFAULT_FABRIC_IMG}")`);
        if (clr && !img && !fbr) fabricUrl = 'none';

        const backgroundUrl = tbg ? `url("${BASE_URL}${tbg}.png?1264")` : 'none';

        s.innerHTML = `
            .BilliardsTableBase { background-image: url("${BASE_URL}${ttb}.png") !important; }
            .BilliardsTableDefaultFabric {
                background-color: ${clr ? clr : (img || fbr ? 'transparent' : '#006633')} !important;
                background-image: ${backgroundUrl}, ${fabricUrl} !important;
                background-repeat: no-repeat, repeat !important;
                background-size: cover, ${img ? 'cover' : 'auto'} !important;
                background-position: center, center !important;
                background-blend-mode: normal !important;
            }
            .BilliardsCueSource { background-image: url("${BASE_URL}${cue}.png") !important; background-size: 100% 100% !important; }
            .BilliardsCueAnim { background: transparent !important; }
        `;
    }
    setInterval(apply, 400);
})();