MooMoo.io modded UI

Removes unnecessary cards and ads, and makes changelog text bigger when updated, and other small UI improvements, hides UI after 10 seconds, reload button on disconnected removes server specification (Working as of July 13 2018)

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         MooMoo.io modded UI
// @version      1.6.5
// @description  Removes unnecessary cards and ads, and makes changelog text bigger when updated, and other small UI improvements, hides UI after 10 seconds, reload button on disconnected removes server specification (Working as of July 13 2018)
// @author       someRandomGuy
// @match        *://*.moomoo.io/*
// @namespace https://greasyfork.org/users/117222
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMzQDW3oAAARdSURBVFhHvVdbbFRVFB0QDS3tJP5B6StECTODJJcaWpo2Y1/3zsu2WIYUaMKHCthAqLzCKLWx0bYQ4yPRL36U2KD4RyJ+KBUoAULCH01MBHkYAY0vSqGt0NmsdedMh5u504e9ZScr98w5++y19z77PMblhPj9/pza2toX6urq9hqG0Qt8BxzTdf0I+mJVVVUl1FHqzkogEGgB0UVgF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iJnIw9ZZ4PnblmAi8C3J+bDzAPYOTfgOtJG5uLObmAl6z2zka6cmdYSPUx42LDi15qz6WHl5eeZ1n0hUTVygIYIR0TiLlMc27w7C/I1+FXEy5bdwwq5QpmYmcKIZRo/hew3fIRgfSxIp8N/SMEmBk9Dbj5MuS013RsrKyrJwYBWDgEXahoruBGkP2l0gfBPfjfiX7IUO/4KnXjuTisv1CLlw6nREjZu1AAAAAElFTkSuQmCC
// ==/UserScript==

console.log("MooMoo.io modded UI");

(function(){

addEventListener("click", function(e) { // changes the 'reload' button
	if (e.target.tagName == "A" && e.target.href == "javascript:window.location.href=window.location.href") {
		e.preventDefault();
		location.replace(location.origin);
	}
});

var sI = -1,
	hideAct = false;

function $(e){
	var a = document.querySelectorAll(e);
	if(a.length == 1){
		return a[0];
	} else if(a.length == 0){
		return null;
	} else {
		return a;
	}
	return a;
}

function getCookie(e){
	var c = document.cookie, g;
	c=c.split('; ');
	c.forEach(function(ob){
		var f=ob.split('=');
		if(f[0]==e){
			g=f[1];
			return;
		}
		return;
	}
			 );
	if(g!==undefined){
		return g;
	}else{
		return null;
	}
}

function resetInterval() {
    clearInterval(sI);

	if(hideAct){
		$("#mainMenu").classList.remove("hide");
		hideAct = false;
	}
	sI = setInterval(function(){
		hideActionMenu();
	}, 10e3);
}

function hideActionMenu() {
    hideAct = true;
    $("#mainMenu").classList.add("hide");
}

addEventListener("mousemove", function(){
	resetInterval();
});
addEventListener("keydown", function() {
    resetInterval();
});
document.body.addEventListener("focus", function() {
    resetInterval();
});
addEventListener("blur", function() {
    hideActionMenu();
});

Array.prototype.remove = function(){
	for(let i of this){
		i.remove();
	}
};

Element.prototype.remove = function(){
	this.parentElement.removeChild(this);
};

window.Worker = null;

addEventListener("load", function(){
	[$("#youtuberOf"), $("#adCard"), $("#followText"), $("#youtubeFollow"), $("#twitterFollow"), $(".menuCard[style='width:728px;display:inline-block;margin-top:10px;padding:10px;']")].remove();
	$("#promoImgHolder").innerHTML = "";
	{
		let a = [$("#serverBrowser"), $("#altServer")];
		for (var i = 0; i < a.length; i++) {
			$("#promoImgHolder").appendChild(a[i]);
		}
	}
	{
		let settings = $(".settingRadio"),
			parent = document.createElement("div");

		parent.classList.add("settings", "menuCard");
		parent.addEventListener("click", function(e) {
			if (e.target == this) { // prevent closing if user clicked settings
				this.classList.toggle("show");
			}
		});

		for (let i of settings) {
			parent.appendChild(i);
		}

		$("#menuCardHolder").children[0].appendChild(parent);
	}
	{
		let b = $("#skinColorHolder");
		$("#promoImgHolder").appendChild(b);
		$("#rightCardHolder").remove();
	}
	{
		let a = $("#linksContainer2").children[0];
		document.body.appendChild(a);
		$("#linksContainer2").innerHTML = "";
		$("#linksContainer2").appendChild(a);
		if(getCookie("tampermoneySaveChangelog")){
			document.cookie = 'tampermoneySaveChangelog =; expires=Thu, 01 Jan 1970 00:00:01 GMT;'; // remove old cookie
		}
		if(localStorage.tampermonkeyMoomooChangelogSave){
			if(localStorage.tampermonkeyMoomooChangelogSave == a.innerText){
				a.parentElement.style.opacity = .5;
			} else {
				a.style.fontSize = "5em";
				a.addEventListener("click", function(){
					localStorage.tampermonkeyMoomooChangelogSave = a.innerText;
					a.style.fontSize = "1em";
					a.parentElement.style.opacity = .5;
				});
			}
		} else {
			localStorage.tampermonkeyMoomooChangelogSave = a.innerText;
		}
	}
	{
		// custom css!
		let e = document.createElement("style");
		e.innerHTML = `
.skinColorItem {
    transition: 0.15s;
    opacity: 0.75;
    will-change: border-radius, opacity;
}

.activeSkin {
    opacity: 1;
}


#menuCardHolder div, #gameName {
    opacity: 0.6;
    transition: 0.15s;
}

#menuCardHolder div:hover, #gameName:hover {
    opacity: 0.99;
}

#mainMenu {
    transition: 0.15s;
}

#mainMenu.hide {
    cursor: none;
    opacity: 0;
}

.menuCard {
    margin-top: 8px !important;
}

.settings::before {
    content: "Settings";
    font-size: 24px;
}

.settings .settingRadio {
    margin: 0;
}

.settings {
    padding: 12px 18px;
    cursor: pointer;
}

.settings.show {
    padding: 18px 18px;
}

.settings > div {
    display: none;
}

.settings.show > div {
    display: block;
}
`;
		document.head.appendChild(e);
	}
});

}());