Gota.io Optimiser

Upgrade how the game looks with customizable features that you can control, example being the background styles in the main menu. ANYTHING that you want to be featured, I will add if it is necessary. You can submit feedback in the Discord: https://discord.gg/yHE3NSb

Versão de: 18/04/2020. Veja: a última versão.

// ==UserScript==
// @name         Gota.io Optimiser
// @namespace    https://gota.io/web/*
// @version      1.2
// @description  Upgrade how the game looks with customizable features that you can control, example being the background styles in the main menu. ANYTHING that you want to be featured, I will add if it is necessary. You can submit feedback in the Discord: https://discord.gg/yHE3NSb
// @author       AlexHGaming
// @match        https://gota.io/web/
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Declare variables
    let version = `1.1`;

    // Assign IDs to classes
    document.getElementsByClassName(`options-container`)[0].id = "options";
    document.getElementsByClassName(`main-bottom-stats interface-color`)[0].id = "stats";
    document.getElementsByClassName(`error-banner`)[0].id = "banner";
    document.getElementsByClassName(`main-bottom-links`)[0].id = "adv";
    document.getElementsByClassName(`main-rb-title`)[0].id = "proftxt";
    document.getElementsByClassName(`main-version`)[0].id = "version";

    // Update styles
    document.getElementById(`main-rb`).style = `display: none`;
    document.getElementById(`adv`).style = `display: none`;
    document.getElementById(`stats`).style = `display: none`;
    document.getElementById(`proftxt`).style = `font-size: 21.3px`;
    document.getElementById(`servers-body-eu`).style = `background-color: transparent`;
    document.getElementById(`servers-body-na`).style = `background-color: transparent`;
    document.getElementById(`servers-body-ap`).style = `background-color: transparent`;

    // Update content
    document.getElementById(`banner`).innerHTML = `An error has occured. If you can still play, just click this red box. Try these solutions to fix your error: disable the extension, clear your cache, try a different browser etc. If none of these work, please contact someone in the <a href = 'discord.gg/gota'>Gota Discord</a>.`;
    document.getElementById(`proftxt`).innerHTML = `Gota Account`;
    document.getElementById(`version`).innerHTML += ` | Extension Version: ${version}`;
     //I put so many breaks here since the left panel breaks if the widget gets added onto the main-left ID
    document.getElementById(`proftxt`).innerHTML += `<br><br><br><br><br><br><br>Main menu image`;
    document.getElementById(`proftxt`).innerHTML += `<input type = 'text' class = 'gota-input' style = 'height: 25px; width: 300px;' id = 'custombg'>`;
    document.getElementById(`proftxt`).innerHTML += `<br><br><font size = '4px' style = "background-color: red">For changes to take effect, you need to refresh your page.`;
    document.getElementById(`proftxt`).innerHTML += `<br><br><img src = 'https://discordapp.com/api/guilds/647909290061070366/embed.png?style=banner2' onclick = 'window.open("https://discord.gg/yHE3NSb")'>`;
    document.getElementById(`custombg`).value = localStorage.getItem('bg');
    document.getElementById(`main`).style = `background-image: url(${localStorage.getItem("bg")}`;

    setInterval(function() {
        localStorage.setItem(`bg`, `${document.getElementById("custombg").value}`);
    }, 500);

})();