Animakai EXTRA - Project

Funcionalidades para o Animakai.

当前为 2017-06-14 提交的版本,查看 最新版本

// ==UserScript==
// @name Animakai EXTRA - Project
// @version 0.7b
// @author Fukoji "King of DELAS".
// @namespace Funcionalidades para o Animakai.
// @description Funcionalidades para o Animakai.
// @match *.animakai.info/*
// @match https://*.animakai.info/*
// @grant none
// ==/UserScript==

//==== BLOCK AREA ====

var ende = /(http|https)\:\/\/www\.animakai\.info\/([a-z]*)\/([a-z]*)\-|([0-9]*)\/([a-z]*)\-([0-9]*)/;


var hideD = {};
	hideD.ligado = "yes";

var adsT = {};
	adsT.cima = document.getElementsByClassName('ads2');
	adsT.soc = document.getElementsByClassName('likebox');
	adsT.img = document.getElementsByClassName('visible-lg');
	adsT.VidCringe = document.getElementsByClassName('col-videos');

if (hideD.ligado == 'yes') {
	if (ende.test(window.location.href) !== true) {
	adsT.cima[0].style.display = 'none';
	adsT.soc[0].style.display = 'none';
	adsT.VidCringe[0].style.display = 'none';
	} else {
	adsT.img[0].style.display = 'none';
	}
}

//==== DIRECT LINK AREA ====
if (ende.test(window.location.href) === true) {
	//==== SD PLAYER ====

	var dwn1 = document.getElementsByTagName('source')[1].attributes[0].value;
	var sd1 = document.getElementsByClassName('titulo active')[0];
	sd1.innerHTML = 'Download';
	sd1.setAttribute('href', dwn1);

	// ==== 2D PLAYER ====

	var hd1 = document.getElementsByTagName('iframe')[0];
	var dwn2 = hd1.attributes['src'].value;
	var bttn2 = document.getElementsByClassName('titulo')[1];
	bttn2.innerHTML = 'Download 2';
	bttn2.setAttribute('href', dwn2);

	// ===== DISQUS AUTOHIDE ====

	var plusD = document.createElement('a');
	plusD.id = 'abreD';
	document.getElementsByTagName('h2')[0].appendChild(plusD);
	var abreDIS = document.getElementById('abreD');
	abreDIS.innerHTML = 'ABRIR [+]';
	abreDIS.style.float = 'left';
	abreDIS.style.paddingRight = '20px';
	document.getElementById('disqus_thread').style.display = 'none';
	abreDIS.addEventListener('click', function(){document.getElementById('disqus_thread').style.display = 'block';});


}

// ==== NIGHT MODE ====

if (ende.test(window.location.href) === true) {

	var lists = document.getElementsByClassName('top-padrao')[0];

	var NightON = document.createElement('img');
	NightON.id = 'trueN';
	NightON.src = 'https://cdn3.iconfinder.com/data/icons/glypho-photography/64/camera-mode-night-fill-128.png';
	NightON.value = 'xD';
	lists.appendChild(NightON);
	var bttN = document.getElementById('trueN');
	bttN.setAttribute('class', 'titulo');
	bttN.setAttribute('target', '_blank');
	bttN.setAttribute('alt', 'Ativar Modo Noturno!');
	bttN.style.width='8%';
	bttN.style.marginTop='calc(-3%)';
	bttN.style.marginLeft='calc(-3%)';
	bttN.style.marginBottom='calc(-3%)';

	bttN.addEventListener('click', function(){nmode('yes')});

}

function nmode(active, per) {
	if (active == 'yes') {
		var ndiv1 = document.createElement('div');
		ndiv1.id = 'night-b';
		ndiv1.value = 'xD';
		document.getElementsByTagName('body')[0].appendChild(ndiv1);

		ndNM = document.getElementById('night-b');

		ndNM.style.background = '#2d2d2d';
		ndNM.style.width = '100%';
		ndNM.style.height = '100%';
		ndNM.style.top = '0px';
		ndNM.style.left = '0px';
		ndNM.style.position = 'fixed';
		ndNM.style.zIndex = '99998';
		ndNM.style.opacity = '0.96';
		ndNM.addEventListener("click", function (){nmode('no');});

		plyg = document.getElementsByClassName('box-video')[0];
		plyg.style.zIndex = '99999';

	} else if (active == 'no') {
		ndNM.style.zIndex = '-99998';
		plyg.style.zIndex = '0';
	} else {
		alert('Não reconheço esse comando :x!');
	}

}