Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name 3DScript
- // @description Script para 3DJocs
- // @namespace Violentmonkey Scripts
- // @grant none
- // @include http://www.3djuegos.com/*
- // @version 2.0
- // @author Nachokyle IMaarC Ratred
- // ==/UserScript==
- /*header transparente*/
- document.getElementById("cab").style.background = "rgba(0,0,0,0.5)"; //Color base del header
- document.getElementsByClassName("sombra_cab")[0].style.background = "transparent";
- var barra = document.getElementsByClassName("sep_off");
- for(i=0; i<barra.length; i++){
- barra[i].style.background = "transparent";
- }
- var divs = document.getElementsByTagName("div");
- for (i=0; i < divs.length; i++) {
- if (divs[i].className.indexOf("subopc bg cb sub_b") > -1 ) {
- divs[i].style.background = "transparent";
- }
- if(divs[i].className.indexOf("bg ini sub_") > -1 ){
- divs[i].style.background = "transparent";
- }
- if(divs[i].className.indexOf("bg end sub_") > -1 ){
- divs[i].style.background = "transparent";
- }
- }
- if(window.location.href == "http://www.3djuegos.com/"){
- document.getElementsByClassName("sep_on_ini_mini")[0].style.background = "transparent";
- }
- var q = document.getElementById("opc_main").childNodes;
- for(i = 1; i<q.length; i++){
- q[i].className = "";
- }
- var logo = document.getElementsByClassName("xXx fl")[0];
- logo.innerHTML = '<img src="http://i.imgur.com/OP4G0JN.png" width="254" height="71">'; //Logo de 3DJuegos
- /*header transparente*/
- /*Buscador*/
- var busca = document.getElementById("bg_buscador").childNodes;
- busca[1].style.background = "rgba(255, 255, 255, 0.8"; //Color fondo de la lupa
- busca[1].style.backgroundImage = "url('http://www.cititec.com/img/skin/mini-search-icon.png')"; //Icono lupa
- busca[1].style.backgroundRepeat = "no-repeat";
- busca[1].style.backgroundPosition = "center";
- document.getElementById("bg_buscador").style.borderBottom = "0.5px solid rgba(0,0,0,0.8)";
- document.getElementById("bg_buscador").style.borderRadius = "5px"; //Border redondeados 5píxeles
- document.getElementById("bg_buscador").style.background = "rgba(255, 255, 255, 0.85"; //Color caja del texto
- document.getElementById("bus_superior").style.fontWeight = "bold";
- document.getElementById("bus_superior").style.color = "black"; //color letra
- /*Buscador*/
- /*Triángulo ocupado-conectado-desconectado*/
- /*Solo tenéis que dejar el código que trabaje sobre vuestro estado según sea desconectado, conectado u ocupado.
- Si por ejemplo vuestro estado es desconectado y tenéis el código de conectado el script crasheará*/
- /*Por defecto está en ocupado*/
- var ocupao = document.getElementsByClassName("ocupado_n7")[0];
- //var conectao = document.getElementsByClassName("conectado_n7")[0];
- //var desconectao = document.getElementsByClassName("desconectado_n7")[0];
- if(ocupao[0] != "undefined"){
- document.getElementsByClassName("ocupado_n7")[0].style.backgroundPosition = "1px 1px";
- document.getElementsByClassName("ocupado_n7")[0].style.marginTop ="-2px";
- document.getElementsByClassName("ocupado_n7")[0].style.backgroundRepeat = "no-repeat";
- document.getElementsByClassName("ocupado_n7")[0].style.backgroundImage = "url('http://i.imgur.com/JCDMTjo.png')";
- }
- /*if(conectao[0] != "undefined"){
- document.getElementsByClassName("conectado_n7")[0].style.backgroundPosition = "1px 1px";
- document.getElementsByClassName("conectado_n7")[0].style.marginTop ="-2px";
- document.getElementsByClassName("conectado_n7")[0].style.backgroundRepeat = "no-repeat";
- document.getElementsByClassName("conectado_n7")[0].style.backgroundImage = "url('http://iforo.3djuegos.com/files_foros/2r/2rop.png')";
- }*/
- /*if(desconectao[0] != "undefined"){
- document.getElementsByClassName("desconectado_n7")[0].style.backgroundPosition = "1px 1px";
- document.getElementsByClassName("desconectado_n7")[0].style.marginTop ="-2px";
- document.getElementsByClassName("desconectado_n7")[0].style.backgroundRepeat = "no-repeat";
- document.getElementsByClassName("desconectado_n7")[0].style.backgroundImage = "url('http://i.imgur.com/Gka23u0.png')";
- }*/
- /*Triángulo ocupado-conectado-desconectado*/
- /*Cabecera perfil trans*/
- var expul = document.getElementsByClassName("v6");
- if (window.location.href.indexOf("com/comunidad") > -1 && expul[0] == undefined) {
- document.getElementById("cab_perfil").style.background = "transparent";
- document.getElementById("borde_padre").style.background = "rgba(0,0,0,0.6)"; //Color base del perfil
- document.getElementsByClassName("comu_caja_opc_bg")[0].style.background = "rgba(0,0,0,0.7)"; //Color de la cajita de la derecha
- document.getElementsByClassName("bor36")[0].style.border = "0px solid red";
- }
- /*Cabecera perfil trans*/
- /*Barras perfil*/
- /*Las barras que hay en 3DJuegos ahora son degradados horizontales que van de negro a un casi negro*/
- /*Podéis poner cualquier color hexadecimal y os hará un degradado del color de la izquierda al color de la derecha*/
- var barras31 = document.getElementsByClassName("barra31");
- for(i=0;i<barras31.length; i++){
- barras31[i].style.background = "linear-gradient(to right, #000000, #232526 )";
- }
- var barras34 = document.getElementsByClassName("barra34");
- for(i=0;i<barras34.length; i++){
- barras34[i].style.background = "linear-gradient(to right, #000000, #232526 )";
- }
- var barras36 = document.getElementsByClassName("barra36");
- for(i=0;i<barras36.length; i++){
- barras36[i].style.background = "linear-gradient(to right, #000000, #232526 )";
- }
- var barrasVotos = document.getElementsByClassName("bg_tb_foro");
- for(i=0;i<barrasVotos.length; i++){
- barrasVotos[i].style.background = "black";
- }
- if (window.location.href.indexOf("com/foro-") > -1){
- var barrasforos = document.getElementsByTagName("dl")[0].style.background = "linear-gradient(to right, #000000, #232526 )";
- }
- /*Barras perfil*/
- /*Footer*/
- var pie = document.getElementById("pie").style.background = "rgba(0,0,0,0.7)"; //Color base del footer
- document.getElementById("pie_izq").style.background = "transparent";
- document.getElementById("pie_der").style.background = "transparent";
- document.getElementById("pie_top_izq").style.background = "transparent";
- document.getElementById("pie_top_der").style.background = "transparent";
- document.getElementById("borde_padre").style.background ="rgba(0,0,0,0.7)"; //Color base del footer
- document.getElementById("juegos").style.backgroundImage = "url('http://i.imgur.com/wEksQ0w.png')";
- /*Footer*/
- /*Avatares cuadrados*/
- var div = document.getElementsByClassName('cab_msg');
- for (i=0; i<div.length; i++){
- div[i].style.borderRadius = 5+'px';
- }
- var citas = document.getElementsByClassName('cita_tit');
- for (i=0; i<citas.length; i++){
- citas[i].style.borderRadius = 3+'px';
- }
- var citas2 = document.getElementsByClassName('cita_degra');
- for (i=0; i<citas2.length; i++){
- citas2[i].style.borderRadius = 0+'px';
- }
- var imgs = document.getElementsByTagName('img');
- for (i=0; i<imgs.length; i++){
- imgs[i].style.borderRadius = 2+'px';
- if (window.location.href.indexOf("tema") > -1) {
- imgs[i].setAttribute("style", "border-radius: 2px !important");
- }
- }
- var imgInicio = document.getElementsByClassName("db pa l4 t4 bgc0");
- for (var i = 0; i < imgInicio.length; i++) {
- imgInicio[i].setAttribute("style", "border-radius: 50px !important");
- }
- if (window.location.href.indexOf("tema") > -1) {
- setTimeout(avataresVotos, 500);
- function avataresVotos() {
- var avatares = document.getElementsByClassName("br50 wi28 he28");
- for (var i = 0; i < avatares.length; i++) {
- avatares[i].style.borderRadius = 2 + 'px';
- }
- setTimeout(avataresVotos, 200);
- }
- }
- if (window.location.href.indexOf("noticias") > -1) {
- setTimeout(noticiasVotos, 500);
- function noticiasVotos() {
- var avatares = document.getElementsByTagName("img");
- var contenedor = document.getElementsByClassName("cab_msg");
- for (var i = 0; i < avatares.length; i++) {
- avatares[i].style.borderRadius = 2 + 'px';
- }
- for (var i = 0; i < contenedor.length; i++) {
- contenedor[i].style.borderRadius = 2 + 'px';
- }
- setTimeout(noticiasVotos, 200);
- }
- }
- /*Avatares cuadrados*/
- /*Quitar negrita y aumentar separadores en los foros*/
- var tema = document.getElementsByClassName('url');
- for (i=0; i<tema.length; i++){
- tema[i].style.fontWeight = "normal";
- }
- var sepa = document.getElementsByClassName('sepa');
- for (i=0; i<sepa.length; i++){
- var new_sepa = document.createElement("style");
- new_sepa.innerHTML = ".sepa:after {content: '';border-bottom: 2.5px solid black !important; background: white !important;}";
- document.head.appendChild(new_sepa);
- }
- /*Quitar negrita y aumentar separadores en los foros*/
- /*Cambio iconos de 3djuegos.com/foros*/
- var ico = document.getElementsByClassName('icof');
- for (i=0; i<ico.length; i++){
- ico[i].style.backgroundImage = "url('http://i.imgur.com/XHDtU41.png')";
- }
- /*Cambio iconos de 3djuegos.com/foros*/
- /*Eliminar columna lateral*/
- var col = document.getElementsByClassName('columna_312_bg2');
- if(col[0] != null){col[0].parentNode.removeChild(col[0]);}
- /*Eliminar columna lateral*/
- /*Mostrar expulsado indefinidamente*/
- var exp=document.getElementsByClassName('s10 c8');for(i=0;i<exp.length;i++){temp=exp[i].innerHTML;if(temp.indexOf('hasta')>-1||temp.indexOf('BLOQUEADOS')>-1){}else{exp[i].innerHTML='Expulsado indefinidamente'}}
- /*Mostrar expulsado indefinidamente*/
- /*Eliminar mensajes mensajes */
- var block = document.getElementsByClassName('container_msg');
- for(i=0;i<block.length;i++){
- x = block[i].dataset;
- if(x.id_autor == 725912 || x.id_autor == 182201){
- block[i].parentNode.removeChild(block[i]);
- }
- }
- var block2 = document.getElementsByClassName("cab_msg");
- for(i=0;i<block2.length;i++){
- if(block2[i].parentNode.id.indexOf("cab_bloqueada") != -1){
- block2[i].parentNode.style.height = "0px";
- block2[i].parentNode.style.visibility = "hidden";
- }
- }
- /*Eliminar mensajes mensajes */
- /*Eliminar miniatura*/
- var mini=document.getElementsByClassName('img_tema');
- for(i=0;i<mini.length;i++){
- mini[i].setAttribute("style", "display: none !important");
- }
- /*Eliminar miniatura*/
- /*Cambiar fondo color*/
- var check = document.getElementById('zona_skin');
- if(check != null){
- document.getElementById("zona_skin").firstChild.style.height = "0px";
- document.body.style.background = "red";
- }
- /*Cambiar fondo color*/
- /*Cambiar fondo Imagen*/
- var check = document.getElementById('zona_skin');
- if(check != null){
- document.getElementById("zona_skin").firstChild.style.height = "0px";
- document.body.style.backgroundImage = "url('http://cdn.akamai.steamstatic.com/steamcommunity/public/images/items/261640/e57e9248ee7716de647d5eb1716ec18f35231793.jpg')";
- document.body.style.backgroundAttachment = "fixed";
- }
- /*Cambiar fondo Imagen*/
- /*Añadir iconos*/
- var caja = document.getElementById("opciones_bbcode_menu_emoti_299");
- if(caja != null){
- caja.setAttribute("style", "width: 208px");
- var fotos = ["http://www.roto2.com/roto2.gif",
- "http://st.forocoches.com/foro/images/smilies/roto2qtemeto.gif",
- "http://st.forocoches.com/foro/images/smilies/sisi1.gif",
- "http://st.forocoches.com/foro/images/smilies/thumbsup.gif",
- "http://st.forocoches.com/foro/images/smilies/icon_popcorn.gif",
- "http://st.forocoches.com/foro/images/smilies/rota2.gif",
- "http://st.forocoches.com/foro/images/smilies/roto2nuse.gif",
- "http://st.forocoches.com/foro/images/smilies/clap.gif",
- "http://st.forocoches.com/foro/images/smilies/dancer2.gif",
- "http://st.forocoches.com/foro/images/smilies/roto2cafe.gif",
- "http://st.forocoches.com/foro/images/smilies/buitre.gif",
- "http://st.forocoches.com/foro/images/smilies/roto2gaydude.gif",
- "http://st.forocoches.com/foro/images/smilies/facepalm.gif",
- "http://i.neoseeker.com/cm/52/badges/pc_master_race_iconZdVbe.png",
- "http://orig10.deviantart.net/5bdf/f/2015/311/7/3/steamsad_by_kiwi450da-d9fx6q3.png",
- "http://orig11.deviantart.net/f3cc/f/2015/311/6/a/steamfacepalm_by_kiwi450da-d9fx6pq.png",
- "http://orig09.deviantart.net/ba45/f/2015/311/b/8/steamhappy_by_kiwi450da-d9fx6ps.png",
- "http://orig01.deviantart.net/116e/f/2015/311/c/4/steamsalty_by_kiwi450da-d9fx6q5.png",
- "http://orig15.deviantart.net/f23e/f/2015/311/d/d/steambored_by_kiwi450da-d9fx6po.png",
- "http://orig00.deviantart.net/4dd8/f/2015/311/3/f/steammocking_by_kiwi450da-d9fx6pz.png",
- "http://i.imgur.com/f9IXpQY.gif",
- "http://i.imgur.com/lzTeK36.gif",
- "http://i.imgur.com/Xes98hi.png",
- "http://i.imgur.com/nluUNx4.png",
- "http://cdn.arstechnica.net/wp-content/uploads/2015/11/kappa.png",
- "http://a.deviantart.net/avatars/p/e/pedobear45.gif",
- "http://defconnations.com/uploads/emoticons/pepeicon1.png",
- "https://a.pomf.cat/lknyzw.png",
- "https://cdn.pajlada.se/emoticons/twitch-74959.png",
- "http://iforo.3djuegos.com/files_foros/7x/7xo.png",
- "http://iforo.3djuegos.com/files_foros/5h/5he.png"
- ];
- for(i=0;i<fotos.length;i++){
- var temp = fotos[i];
- var newicon = document.createElement("div");
- newicon.className = "dib cur_p bbcode_boton";
- newicon.id = i;
- newicon.style.backgroundImage = "url('"+fotos[i]+"')";
- newicon.style.backgroundRepeat = "no-repeat";
- newicon.style.backgroundSize = "20px 20px";
- newicon.style.backgroundPosition = "center center";
- newicon.style.height = "20px";
- newicon.style.width = "20px";
- newicon.addEventListener("click",function(){add_icon(this.id)}, true);
- caja.appendChild(newicon);
- }
- function add_icon(id){
- var caretPos = document.getElementById("form_mensaje").selectionStart;
- var textAreaTxt = document.getElementById("form_mensaje").value;
- var txtToAdd = "[img]"+fotos[id]+"[/img]";
- document.getElementById("form_mensaje").value = textAreaTxt.substring(0, caretPos) + txtToAdd + textAreaTxt.substring(caretPos);
- }
- }
- /*Añadir iconos*/
- /* Menu Gifs */
- if(window.location.href.indexOf("zona=escribir") > -1 ){
- var barra = document.getElementsByClassName("comu_caja_fondo_boton br4 mar_rl5 mar_t10 tar pr")[0];
- var barra2 = barra.innerHTML;
- barra.innerHTML = "<input type='text' id='textGif' placeholder='Introducir búsqueda' style='width: 250px;height: 27px;margin-right: 10px;border-radius: 2px;border: 1px solid #bbbbbb;background: white;color: black;text-indent: 5px;'>"+"<a class='boton b_s14' id='gifsPopup' style='margin-right: 8px' href='#'>Buscar gif</a>";
- barra.innerHTML += barra2;
- document.getElementById("gifsPopup").addEventListener("click",function(){
- var container = document.getElementById("gifsContainer");
- var textGif = document.getElementById("textGif").value;
- if(!container)
- {
- if(textGif != "")
- {
- var body_w = document.body.offsetWidth;
- var column_w = document.getElementById("borde_padre").offsetWidth;
- var cont_w = body_w - column_w;
- // Insertar Container para los gifs.
- var x = document.createElement("div");
- x.setAttribute("id","gifsContainer");
- x.style.height = "100%";
- x.style.width = cont_w+"px";
- x.style.backgroundColor = "rgba(255, 255, 255, 0.2)";
- x.style.top = "1px";
- x.style.right = "1px";
- x.style.textAlign = "center";
- x.style.position = "fixed";
- x.style.zIndex = "1000";
- x.style.overflow = "auto";
- //x.style.display = "none";
- document.body.appendChild(x);
- document.getElementById("borde_padre").style.position = "absolute";
- /*document.getElementById("textGif").onclick = function(){
- document.getElementById("gifsContainer").remove();
- document.getElementById("borde_padre").style.position = "relative";
- };*/document.getElementById("gifsPopup").innerText = "Salir";
- document.getElementById("gifsPopup").addEventListener("click",switchSalir);
- function switchSalir()
- {
- document.getElementById("gifsContainer").remove();
- document.getElementById("gifsPopup").innerText = "Buscar gif";
- document.getElementById("borde_padre").style.position = "relative";
- document.getElementById("gifsPopup").removeEventListener("click",switchSalir);
- }
- container = document.getElementById("gifsContainer");
- container.innerHTML = "";
- var data = textGif.replace(" ","+");
- var xhttp = new XMLHttpRequest();
- xhttp.onreadystatechange = function() {
- if (this.readyState == 4 && this.status == 200) {
- // Response
- var response = JSON.parse(this.response);
- if(response.data.length == 0)
- {
- alert("Sin resultados");
- }
- else
- {
- for(var i = 0; i < response.data.length; i++)
- {
- container.innerHTML += "<img src=" + response.data[i].images.downsized.url +" class='gif' style='width:300px;display:inline;'>";
- }
- for(var x = 0; x < document.getElementsByClassName("gif").length; x++)
- {
- document.getElementsByClassName("gif")[x].addEventListener("click",function(){
- document.getElementById("form_mensaje").value += "[img]" + this.getAttribute("src") + "[/img]";
- });
- }
- }
- }
- };
- xhttp.open("GET", "http://api.giphy.com/v1/gifs/search?q="+ data +"&limit=100&api_key=dc6zaTOxFJmzC", true);
- xhttp.send();
- }
- else
- {
- sweetAlert("Oops...", "Something went wrong!", "error");
- }
- }
- else if(container && textGif != "")
- {
- container.innerHTML = "";
- var data = textGif.replace(" ","+");
- var xhttp = new XMLHttpRequest();
- xhttp.onreadystatechange = function() {
- if (this.readyState == 4 && this.status == 200) {
- // Response
- var response = JSON.parse(this.response);
- if(response.data.length == 0)
- {
- alert("Sin resultados");
- }
- else
- {
- for(var i = 0; i < response.data.length; i++)
- {
- container.innerHTML += "<img src=" + response.data[i].images.downsized.url +" class='gif' style='width:300px;display:inline;'>";
- }
- for(var x = 0; x < document.getElementsByClassName("gif").length; x++)
- {
- document.getElementsByClassName("gif")[x].addEventListener("click",function(){
- document.getElementById("form_mensaje").value += "[img]" + this.getAttribute("src") + "[/img]";
- });
- }
- }
- }
- };
- xhttp.open("GET", "http://api.giphy.com/v1/gifs/search?q="+ data +"&limit=100&api_key=dc6zaTOxFJmzC", true);
- xhttp.send();
- }
- });
- }
- /* Menu Gifs */
- /*Modo seguro*/
- if(window.location.href.indexOf("zona=escribir") > -1 || window.location.href.indexOf("mensajes_escribir") > -1 ){
- var salir= "Hay cambios sin guardar";
- document.getElementsByClassName("comu_caja_fondo_boton br4 mar_rl5 mar_t10 tar pr")[0].onclick = function(){
- salir = null;
- setTimeout(function(){ salir= "Hay cambios sin guardar"; }, 3000);
- }
- window.onbeforeunload = function(){
- if(document.getElementById("form_mensaje").value != ""){
- return salir ;
- }
- }
- }
- /*Modo seguro*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement