// ==UserScript==
// @name Snake.io cheat (beta)
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Cheats for snake.io (Zoom hack)
// @author idk just not you
// @license MIT
// @match https://snake.io/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=snake.io
// @grant none
// @downloadURL none
// ==/UserScript==
(function() {
function get(x) { return document.getElementById(x); }
let cheatMenu = document.createElement("div");
cheatMenu.id = "cheatMenu";
cheatMenu.style.position = "absolute";
cheatMenu.style.top = "30px";
cheatMenu.style.left = "20px";
cheatMenu.style.zIndex = "9999";
cheatMenu.style.background = "white";
cheatMenu.style.padding = "10px";
cheatMenu.style.border = "1px solid black";
cheatMenu.innerHTML = `
`;
document.body.appendChild(cheatMenu);
let box = get("cheatMenu");
document.addEventListener("keydown", (event) => {
if (event.keyCode == 89) { // Нажатие "Y" скрывает/показывает меню
box.style.opacity = (box.style.opacity == "1") ? "0" : "1";
}
});
let CanvasWidth = get("WS");
let showWidth = get("WV");
CanvasWidth.oninput = function() {
showWidth.innerHTML = this.value;
let gameCanvas = get("unity-canvas");
gameCanvas.style.width = this.value + "px";
};
let CanvasHeight = get("HS");
let showHeight = get("HV");
CanvasHeight.oninput = function() {
showHeight.innerHTML = this.value;
let gameCanvas = get("unity-canvas");
gameCanvas.style.height = this.value + "px";
};
let ZoomVS = get("ZOOM");
let ShowZoomVS = get("ZM");
ZoomVS.oninput = function() {
let zoomValue = parseFloat(this.value);
let gameCanvas = get("unity-canvas");
let gameContainer = get("unity-container");
ShowZoomVS.innerHTML = this.value;
gameContainer.style.transform = "scale(" + zoomValue + ")";
gameContainer.style.transformOrigin = "center";
gameCanvas.style.transform = "scale(" + zoomValue + ")";
gameCanvas.style.transformOrigin = "center";
gameContainer.style.position = "absolute";
gameContainer.style.top = "50%";
gameContainer.style.left = "50%";
gameContainer.style.transform = "translate(-50%, -50%)";
gameContainer.style.overflow = "hidden";
document.getElementById("otherKooApps").style.opacity = 0;
};
})();