Splix.io Simple Zoom Mod

Press "z" to toggle between custom and default zoom. Use "-" and "=" to adjust your custom zoom. That's all!

目前為 2020-04-23 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Splix.io Simple Zoom Mod
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Press "z" to toggle between custom and default zoom. Use "-" and "=" to adjust your custom zoom. That's all!
// @author       Shimdidly
// @match        https://splix.io/
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    //Set up zoom level span element in the #scoreBlock element
    window.addEventListener('load',function(){
        var zoomLevelSpan = document.createElement("span");
        zoomLevelSpan.setAttribute("id", "zoomLevelSpan");
        document.getElementById("scoreBlock").appendChild(document.createElement("br"));
        document.getElementById("scoreBlock").appendChild(zoomLevelSpan);

        window.SdefaultBlocks=window.BLOCKS_ON_SCREEN;
        window.ScustomBlocks=8000;
        window.SzoomLevelToggle = false;
        window.MAX_ZOOM = 10000;
    });
    document.onkeydown = function(e) {
        switch (e.keyCode) {
            case 90: //z
                console.log('toggling zoom', window.ScustomBlocks);
                window.SzoomLevelToggle = !window.SzoomLevelToggle;
                if (window.SzoomLevelToggle) window.BLOCKS_ON_SCREEN = window.ScustomBlocks;
                else window.BLOCKS_ON_SCREEN = window.SdefaultBlocks;
                document.getElementById("zoomLevelSpan").innerHTML = "Zoom Level: " + window.BLOCKS_ON_SCREEN;
                break;
            case 189: //-
                window.ScustomBlocks += 50;
                if (window.SzoomLevelToggle) window.BLOCKS_ON_SCREEN = window.ScustomBlocks;
                console.log("BLOCKS_ON_SCREEN = " + window.BLOCKS_ON_SCREEN);
                document.getElementById("zoomLevelSpan").innerHTML = "Zoom Level: " + window.BLOCKS_ON_SCREEN;
                break;
            case 187: //=
                window.ScustomBlocks -= 50;
                if (window.SzoomLevelToggle) window.BLOCKS_ON_SCREEN = window.ScustomBlocks;
                console.log("BLOCKS_ON_SCREEN = " + window.BLOCKS_ON_SCREEN);
                document.getElementById("zoomLevelSpan").innerHTML = "Zoom Level: " + window.BLOCKS_ON_SCREEN;
                break;
        }
    };
    // Your code here...
})();