Advertisement
Zenit

3Dscript_final

Mar 18th, 2016
1,408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name 3DScript
  3. // @description Script para 3DJocs
  4. // @namespace Violentmonkey Scripts
  5. // @grant none
  6. // @include     http://www.3djuegos.com/*
  7. // @version 2.0
  8. // @author Nachokyle IMaarC Ratred
  9. // ==/UserScript==
  10.  
  11. /*header transparente*/
  12. document.getElementById("cab").style.background = "rgba(0,0,0,0.5)";                                //Color base del header
  13. document.getElementsByClassName("sombra_cab")[0].style.background = "transparent";
  14. var barra = document.getElementsByClassName("sep_off");
  15. for(i=0; i<barra.length; i++){
  16.   barra[i].style.background = "transparent";
  17. }
  18. var divs = document.getElementsByTagName("div");
  19.   for (i=0; i < divs.length; i++) {
  20.       if (divs[i].className.indexOf("subopc bg cb sub_b") > -1 ) {
  21.         divs[i].style.background = "transparent";          
  22.       }
  23.       if(divs[i].className.indexOf("bg ini sub_") > -1 ){
  24.         divs[i].style.background = "transparent";  
  25.       }
  26.       if(divs[i].className.indexOf("bg end sub_") > -1 ){
  27.         divs[i].style.background = "transparent";  
  28.       }    
  29.   }
  30. if(window.location.href == "http://www.3djuegos.com/"){
  31.     document.getElementsByClassName("sep_on_ini_mini")[0].style.background = "transparent";
  32. }
  33. var q = document.getElementById("opc_main").childNodes;
  34. for(i = 1; i<q.length; i++){
  35.   q[i].className = "";
  36. }
  37.  
  38. var logo = document.getElementsByClassName("xXx fl")[0];
  39. logo.innerHTML = '<img src="http://i.imgur.com/OP4G0JN.png" width="254" height="71">';          //Logo de 3DJuegos
  40. /*header transparente*/
  41.  
  42. /*Buscador*/
  43. var busca = document.getElementById("bg_buscador").childNodes;
  44. busca[1].style.background = "rgba(255, 255, 255, 0.8";                                                  //Color fondo de la lupa
  45. busca[1].style.backgroundImage = "url('http://www.cititec.com/img/skin/mini-search-icon.png')";         //Icono lupa
  46. busca[1].style.backgroundRepeat = "no-repeat";
  47. busca[1].style.backgroundPosition = "center";
  48. document.getElementById("bg_buscador").style.borderBottom = "0.5px solid rgba(0,0,0,0.8)";
  49. document.getElementById("bg_buscador").style.borderRadius = "5px";                                      //Border redondeados 5píxeles
  50. document.getElementById("bg_buscador").style.background = "rgba(255, 255, 255, 0.85";                   //Color caja del texto
  51. document.getElementById("bus_superior").style.fontWeight = "bold";
  52. document.getElementById("bus_superior").style.color = "black";                                          //color letra
  53. /*Buscador*/
  54.    
  55. /*Triángulo ocupado-conectado-desconectado*/
  56.  
  57. /*Solo tenéis que dejar el código que trabaje sobre vuestro estado según sea desconectado, conectado u ocupado.
  58. Si por ejemplo vuestro estado es desconectado y tenéis el código de conectado el script crasheará*/
  59.  
  60. /*Por defecto está en ocupado*/
  61.  
  62. var ocupao = document.getElementsByClassName("ocupado_n7")[0];
  63. //var conectao = document.getElementsByClassName("conectado_n7")[0];
  64. //var desconectao = document.getElementsByClassName("desconectado_n7")[0];
  65. if(ocupao[0] != "undefined"){
  66.   document.getElementsByClassName("ocupado_n7")[0].style.backgroundPosition = "1px 1px";
  67.   document.getElementsByClassName("ocupado_n7")[0].style.marginTop ="-2px";
  68.   document.getElementsByClassName("ocupado_n7")[0].style.backgroundRepeat = "no-repeat";
  69.   document.getElementsByClassName("ocupado_n7")[0].style.backgroundImage = "url('http://i.imgur.com/JCDMTjo.png')";
  70. }
  71. /*if(conectao[0] != "undefined"){
  72.   document.getElementsByClassName("conectado_n7")[0].style.backgroundPosition = "1px 1px";
  73.   document.getElementsByClassName("conectado_n7")[0].style.marginTop ="-2px";
  74.   document.getElementsByClassName("conectado_n7")[0].style.backgroundRepeat = "no-repeat";
  75.   document.getElementsByClassName("conectado_n7")[0].style.backgroundImage = "url('http://iforo.3djuegos.com/files_foros/2r/2rop.png')";
  76. }*/
  77.  
  78. /*if(desconectao[0] != "undefined"){
  79.   document.getElementsByClassName("desconectado_n7")[0].style.backgroundPosition = "1px 1px";
  80.   document.getElementsByClassName("desconectado_n7")[0].style.marginTop ="-2px";
  81.   document.getElementsByClassName("desconectado_n7")[0].style.backgroundRepeat = "no-repeat";
  82.   document.getElementsByClassName("desconectado_n7")[0].style.backgroundImage = "url('http://i.imgur.com/Gka23u0.png')";
  83. }*/
  84. /*Triángulo ocupado-conectado-desconectado*/
  85.  
  86. /*Cabecera perfil trans*/
  87. var expul = document.getElementsByClassName("v6");
  88. if (window.location.href.indexOf("com/comunidad") > -1 && expul[0] == undefined) {     
  89.     document.getElementById("cab_perfil").style.background = "transparent";
  90.     document.getElementById("borde_padre").style.background = "rgba(0,0,0,0.6)";                    //Color base del perfil
  91.     document.getElementsByClassName("comu_caja_opc_bg")[0].style.background = "rgba(0,0,0,0.7)";    //Color de la cajita de la derecha
  92.     document.getElementsByClassName("bor36")[0].style.border = "0px solid red";
  93. }
  94. /*Cabecera perfil trans*/
  95.  
  96. /*Barras perfil*/
  97.  
  98. /*Las barras que hay en 3DJuegos ahora son degradados horizontales que van de negro a un casi negro*/
  99. /*Podéis poner cualquier color hexadecimal y os hará un degradado del color de la izquierda al color de la derecha*/
  100.  
  101. var barras31 = document.getElementsByClassName("barra31");
  102. for(i=0;i<barras31.length; i++){
  103.   barras31[i].style.background = "linear-gradient(to right, #000000, #232526 )";
  104. }
  105. var barras34 = document.getElementsByClassName("barra34");
  106. for(i=0;i<barras34.length; i++){
  107.   barras34[i].style.background = "linear-gradient(to right, #000000, #232526 )";
  108. }
  109. var barras36 = document.getElementsByClassName("barra36");
  110. for(i=0;i<barras36.length; i++){
  111.   barras36[i].style.background = "linear-gradient(to right, #000000, #232526 )";
  112. }
  113. var barrasVotos = document.getElementsByClassName("bg_tb_foro");
  114. for(i=0;i<barrasVotos.length; i++){
  115.   barrasVotos[i].style.background = "black";
  116. }
  117. if (window.location.href.indexOf("com/foro-") > -1){
  118.     var barrasforos = document.getElementsByTagName("dl")[0].style.background = "linear-gradient(to right, #000000, #232526 )";
  119. }
  120. /*Barras perfil*/
  121.  
  122. /*Footer*/
  123. var pie = document.getElementById("pie").style.background = "rgba(0,0,0,0.7)";                  //Color base del footer
  124. document.getElementById("pie_izq").style.background = "transparent";
  125. document.getElementById("pie_der").style.background = "transparent";
  126. document.getElementById("pie_top_izq").style.background = "transparent";
  127. document.getElementById("pie_top_der").style.background = "transparent";
  128. document.getElementById("borde_padre").style.background ="rgba(0,0,0,0.7)";                     //Color base del footer
  129. document.getElementById("juegos").style.backgroundImage = "url('http://i.imgur.com/wEksQ0w.png')";
  130. /*Footer*/
  131.  
  132. /*Avatares cuadrados*/
  133. var div = document.getElementsByClassName('cab_msg');
  134. for (i=0; i<div.length; i++){
  135.   div[i].style.borderRadius = 5+'px';
  136. }
  137.  
  138. var citas = document.getElementsByClassName('cita_tit');
  139.  
  140. for (i=0; i<citas.length; i++){
  141.   citas[i].style.borderRadius = 3+'px';
  142. }
  143. var citas2 = document.getElementsByClassName('cita_degra');
  144. for (i=0; i<citas2.length; i++){
  145.   citas2[i].style.borderRadius = 0+'px';
  146. }
  147.  
  148. var imgs = document.getElementsByTagName('img');
  149. for (i=0; i<imgs.length; i++){
  150.   imgs[i].style.borderRadius = 2+'px';
  151.   if (window.location.href.indexOf("tema") > -1) {
  152.     imgs[i].setAttribute("style", "border-radius: 2px !important");  
  153.   }
  154. }
  155. var imgInicio = document.getElementsByClassName("db pa l4 t4 bgc0");
  156. for (var i = 0; i < imgInicio.length; i++) {
  157.     imgInicio[i].setAttribute("style", "border-radius: 50px !important");
  158. }
  159.  
  160. if (window.location.href.indexOf("tema") > -1) {
  161.     setTimeout(avataresVotos, 500);
  162.  
  163.     function avataresVotos() {
  164.         var avatares = document.getElementsByClassName("br50 wi28 he28");
  165.         for (var i = 0; i < avatares.length; i++) {
  166.             avatares[i].style.borderRadius = 2 + 'px';
  167.         }
  168.         setTimeout(avataresVotos, 200);
  169.     }
  170. }
  171. if (window.location.href.indexOf("noticias") > -1) {
  172.     setTimeout(noticiasVotos, 500);
  173.  
  174.     function noticiasVotos() {
  175.  
  176.         var avatares = document.getElementsByTagName("img");
  177.         var contenedor = document.getElementsByClassName("cab_msg");
  178.         for (var i = 0; i < avatares.length; i++) {
  179.             avatares[i].style.borderRadius = 2 + 'px';
  180.         }
  181.  
  182.         for (var i = 0; i < contenedor.length; i++) {
  183.             contenedor[i].style.borderRadius = 2 + 'px';
  184.         }
  185.  
  186.         setTimeout(noticiasVotos, 200);
  187.  
  188.     }
  189. }
  190. /*Avatares cuadrados*/
  191.  
  192. /*Quitar negrita y aumentar separadores en los foros*/
  193. var tema = document.getElementsByClassName('url');
  194. for (i=0; i<tema.length; i++){
  195.   tema[i].style.fontWeight = "normal";
  196. }
  197. var sepa = document.getElementsByClassName('sepa');
  198. for (i=0; i<sepa.length; i++){
  199.     var new_sepa = document.createElement("style");
  200.     new_sepa.innerHTML = ".sepa:after {content: '';border-bottom: 2.5px solid black !important; background: white !important;}";
  201.     document.head.appendChild(new_sepa);
  202. }
  203. /*Quitar negrita y aumentar separadores en los foros*/
  204.  
  205.  
  206. /*Cambio iconos de 3djuegos.com/foros*/
  207. var ico = document.getElementsByClassName('icof');
  208. for (i=0; i<ico.length; i++){
  209.   ico[i].style.backgroundImage = "url('http://i.imgur.com/XHDtU41.png')";
  210. }
  211. /*Cambio iconos de 3djuegos.com/foros*/
  212.  
  213.  
  214. /*Eliminar columna lateral*/
  215. var col = document.getElementsByClassName('columna_312_bg2');
  216. if(col[0] != null){col[0].parentNode.removeChild(col[0]);}
  217. /*Eliminar columna lateral*/
  218.  
  219. /*Mostrar expulsado indefinidamente*/
  220. 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'}}
  221. /*Mostrar expulsado indefinidamente*/
  222.  
  223.  
  224. /*Eliminar mensajes mensajes */
  225. var block = document.getElementsByClassName('container_msg');
  226. for(i=0;i<block.length;i++){
  227.     x = block[i].dataset;
  228.     if(x.id_autor == 725912 || x.id_autor == 182201){
  229.         block[i].parentNode.removeChild(block[i]);
  230.     }
  231. }
  232.  
  233. var block2 = document.getElementsByClassName("cab_msg");
  234. for(i=0;i<block2.length;i++){
  235.     if(block2[i].parentNode.id.indexOf("cab_bloqueada") != -1){
  236.         block2[i].parentNode.style.height = "0px";
  237.         block2[i].parentNode.style.visibility = "hidden";
  238.     }
  239. }
  240. /*Eliminar mensajes mensajes */
  241.  
  242.  
  243. /*Eliminar miniatura*/
  244. var mini=document.getElementsByClassName('img_tema');
  245. for(i=0;i<mini.length;i++){
  246.     mini[i].setAttribute("style", "display: none !important");
  247. }
  248. /*Eliminar miniatura*/
  249.  
  250. /*Cambiar fondo color*/
  251. var check = document.getElementById('zona_skin');
  252. if(check != null){
  253.     document.getElementById("zona_skin").firstChild.style.height = "0px";
  254.     document.body.style.background = "red";
  255. }
  256. /*Cambiar fondo color*/
  257.  
  258. /*Cambiar fondo Imagen*/
  259.  
  260. var check = document.getElementById('zona_skin');
  261. if(check != null){
  262.     document.getElementById("zona_skin").firstChild.style.height = "0px";
  263.     document.body.style.backgroundImage = "url('http://cdn.akamai.steamstatic.com/steamcommunity/public/images/items/261640/e57e9248ee7716de647d5eb1716ec18f35231793.jpg')";
  264.     document.body.style.backgroundAttachment = "fixed";
  265. }
  266. /*Cambiar fondo Imagen*/
  267.  
  268. /*Añadir iconos*/
  269.     var caja = document.getElementById("opciones_bbcode_menu_emoti_299");
  270.     if(caja != null){
  271.         caja.setAttribute("style", "width: 208px");
  272.         var fotos = ["http://www.roto2.com/roto2.gif",
  273.                      "http://st.forocoches.com/foro/images/smilies/roto2qtemeto.gif",
  274.                      "http://st.forocoches.com/foro/images/smilies/sisi1.gif",
  275.                      "http://st.forocoches.com/foro/images/smilies/thumbsup.gif",
  276.                      "http://st.forocoches.com/foro/images/smilies/icon_popcorn.gif",
  277.                      "http://st.forocoches.com/foro/images/smilies/rota2.gif",
  278.                      "http://st.forocoches.com/foro/images/smilies/roto2nuse.gif",
  279.                      "http://st.forocoches.com/foro/images/smilies/clap.gif",
  280.                      "http://st.forocoches.com/foro/images/smilies/dancer2.gif",
  281.                      "http://st.forocoches.com/foro/images/smilies/roto2cafe.gif",
  282.                      "http://st.forocoches.com/foro/images/smilies/buitre.gif",
  283.                      "http://st.forocoches.com/foro/images/smilies/roto2gaydude.gif",
  284.                      "http://st.forocoches.com/foro/images/smilies/facepalm.gif",
  285.                      "http://i.neoseeker.com/cm/52/badges/pc_master_race_iconZdVbe.png",
  286.                      "http://orig10.deviantart.net/5bdf/f/2015/311/7/3/steamsad_by_kiwi450da-d9fx6q3.png",
  287.                      "http://orig11.deviantart.net/f3cc/f/2015/311/6/a/steamfacepalm_by_kiwi450da-d9fx6pq.png",
  288.                      "http://orig09.deviantart.net/ba45/f/2015/311/b/8/steamhappy_by_kiwi450da-d9fx6ps.png",
  289.                      "http://orig01.deviantart.net/116e/f/2015/311/c/4/steamsalty_by_kiwi450da-d9fx6q5.png",
  290.                      "http://orig15.deviantart.net/f23e/f/2015/311/d/d/steambored_by_kiwi450da-d9fx6po.png",
  291.                      "http://orig00.deviantart.net/4dd8/f/2015/311/3/f/steammocking_by_kiwi450da-d9fx6pz.png",
  292.                      "http://i.imgur.com/f9IXpQY.gif",
  293.                      "http://i.imgur.com/lzTeK36.gif",
  294.                      "http://i.imgur.com/Xes98hi.png",
  295.                      "http://i.imgur.com/nluUNx4.png",
  296.                      "http://cdn.arstechnica.net/wp-content/uploads/2015/11/kappa.png",
  297.                      "http://a.deviantart.net/avatars/p/e/pedobear45.gif",
  298.                      "http://defconnations.com/uploads/emoticons/pepeicon1.png",
  299.                      "https://a.pomf.cat/lknyzw.png",
  300.                      "https://cdn.pajlada.se/emoticons/twitch-74959.png",
  301.                      "http://iforo.3djuegos.com/files_foros/7x/7xo.png",
  302.                      "http://iforo.3djuegos.com/files_foros/5h/5he.png"
  303.                     ];
  304.  
  305.         for(i=0;i<fotos.length;i++){
  306.         var temp = fotos[i];
  307.         var newicon = document.createElement("div");
  308.             newicon.className = "dib cur_p bbcode_boton";
  309.             newicon.id = i;
  310.             newicon.style.backgroundImage = "url('"+fotos[i]+"')";
  311.             newicon.style.backgroundRepeat = "no-repeat";
  312.             newicon.style.backgroundSize = "20px 20px";
  313.             newicon.style.backgroundPosition = "center center";
  314.             newicon.style.height = "20px";
  315.             newicon.style.width = "20px";
  316.             newicon.addEventListener("click",function(){add_icon(this.id)}, true);
  317.             caja.appendChild(newicon);
  318.         }
  319.  
  320.         function add_icon(id){         
  321.             var caretPos = document.getElementById("form_mensaje").selectionStart;
  322.             var textAreaTxt = document.getElementById("form_mensaje").value;
  323.             var txtToAdd = "[img]"+fotos[id]+"[/img]";
  324.             document.getElementById("form_mensaje").value = textAreaTxt.substring(0, caretPos) + txtToAdd + textAreaTxt.substring(caretPos);
  325.         }
  326.     }
  327. /*Añadir iconos*/
  328.  
  329. /* Menu Gifs */
  330.  
  331. if(window.location.href.indexOf("zona=escribir") > -1 ){
  332.     var barra = document.getElementsByClassName("comu_caja_fondo_boton br4 mar_rl5 mar_t10 tar pr")[0];
  333.     var barra2 = barra.innerHTML;
  334.     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>";
  335.     barra.innerHTML += barra2;
  336.    
  337.     document.getElementById("gifsPopup").addEventListener("click",function(){
  338.         var container = document.getElementById("gifsContainer");
  339.         var textGif = document.getElementById("textGif").value;
  340.         if(!container)
  341.         {
  342.             if(textGif != "")
  343.             {
  344.              
  345.                 var body_w = document.body.offsetWidth;
  346.                 var column_w = document.getElementById("borde_padre").offsetWidth;
  347.                 var cont_w = body_w - column_w;
  348.                 // Insertar Container para los gifs.
  349.                 var x = document.createElement("div");
  350.                 x.setAttribute("id","gifsContainer");
  351.                 x.style.height = "100%";
  352.                 x.style.width = cont_w+"px";
  353.                 x.style.backgroundColor = "rgba(255, 255, 255, 0.2)";
  354.                 x.style.top = "1px";
  355.                 x.style.right = "1px";
  356.                 x.style.textAlign = "center";
  357.                 x.style.position = "fixed";
  358.                 x.style.zIndex = "1000";
  359.                 x.style.overflow = "auto";
  360.                 //x.style.display = "none";
  361.                 document.body.appendChild(x);        
  362.                 document.getElementById("borde_padre").style.position = "absolute";
  363.              
  364.                 /*document.getElementById("textGif").onclick = function(){
  365.                     document.getElementById("gifsContainer").remove();
  366.                     document.getElementById("borde_padre").style.position = "relative";
  367.                 };*/document.getElementById("gifsPopup").innerText = "Salir";
  368.  
  369.                 document.getElementById("gifsPopup").addEventListener("click",switchSalir);
  370.  
  371.                 function switchSalir()
  372.                 {
  373.                     document.getElementById("gifsContainer").remove();
  374.                     document.getElementById("gifsPopup").innerText = "Buscar gif";
  375.                     document.getElementById("borde_padre").style.position = "relative";
  376.                     document.getElementById("gifsPopup").removeEventListener("click",switchSalir);
  377.                 }
  378.  
  379.                 container = document.getElementById("gifsContainer");
  380.  
  381.                 container.innerHTML = "";
  382.                 var data = textGif.replace(" ","+");
  383.                 var xhttp = new XMLHttpRequest();
  384.                 xhttp.onreadystatechange = function() {
  385.                     if (this.readyState == 4 && this.status == 200) {
  386.                         // Response
  387.                         var response = JSON.parse(this.response);
  388.                         if(response.data.length == 0)
  389.                         {
  390.                             alert("Sin resultados");
  391.                         }
  392.                         else
  393.                         {
  394.                             for(var i = 0; i < response.data.length; i++)
  395.                             {
  396.                                 container.innerHTML += "<img src=" + response.data[i].images.downsized.url +" class='gif' style='width:300px;display:inline;'>";
  397.                             }
  398.                             for(var x = 0; x < document.getElementsByClassName("gif").length; x++)
  399.                             {
  400.                                 document.getElementsByClassName("gif")[x].addEventListener("click",function(){
  401.                                     document.getElementById("form_mensaje").value += "[img]" + this.getAttribute("src") + "[/img]";
  402.                                 });
  403.                             }
  404.                         }
  405.                     }
  406.                 };
  407.                 xhttp.open("GET", "http://api.giphy.com/v1/gifs/search?q="+ data +"&limit=100&api_key=dc6zaTOxFJmzC", true);
  408.                 xhttp.send();
  409.             }
  410.             else
  411.             {
  412.                 sweetAlert("Oops...", "Something went wrong!", "error");
  413.             }
  414.         }
  415.         else if(container && textGif != "")
  416.         {
  417.             container.innerHTML = "";
  418.             var data = textGif.replace(" ","+");
  419.             var xhttp = new XMLHttpRequest();
  420.             xhttp.onreadystatechange = function() {
  421.                 if (this.readyState == 4 && this.status == 200) {
  422.                     // Response
  423.                     var response = JSON.parse(this.response);
  424.                     if(response.data.length == 0)
  425.                     {
  426.                         alert("Sin resultados");
  427.                     }
  428.                     else
  429.                     {
  430.                         for(var i = 0; i < response.data.length; i++)
  431.                         {
  432.                             container.innerHTML += "<img src=" + response.data[i].images.downsized.url +" class='gif' style='width:300px;display:inline;'>";
  433.                         }
  434.                         for(var x = 0; x < document.getElementsByClassName("gif").length; x++)
  435.                         {
  436.                             document.getElementsByClassName("gif")[x].addEventListener("click",function(){
  437.                                 document.getElementById("form_mensaje").value += "[img]" + this.getAttribute("src") + "[/img]";
  438.                             });
  439.                         }
  440.                     }
  441.                 }
  442.             };
  443.             xhttp.open("GET", "http://api.giphy.com/v1/gifs/search?q="+ data +"&limit=100&api_key=dc6zaTOxFJmzC", true);
  444.             xhttp.send();
  445.         }
  446.     });
  447. }
  448.  
  449. /* Menu Gifs */
  450.  
  451. /*Modo seguro*/
  452. if(window.location.href.indexOf("zona=escribir") > -1 || window.location.href.indexOf("mensajes_escribir") > -1 ){
  453.   var salir= "Hay cambios sin guardar";
  454.   document.getElementsByClassName("comu_caja_fondo_boton br4 mar_rl5 mar_t10 tar pr")[0].onclick = function(){
  455.     salir = null;
  456.     setTimeout(function(){ salir= "Hay cambios sin guardar"; }, 3000);
  457.   }  
  458.    window.onbeforeunload = function(){
  459.      if(document.getElementById("form_mensaje").value != ""){
  460.         return salir ;
  461.      }
  462.     }
  463.  
  464. }
  465. /*Modo seguro*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement