Nizax

mirkoczat live w tle

Jul 26th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. var iframe = document.createElement( 'iframe' );
  2. var input = document.createElement( 'input' );
  3. input.type = "text"; input.placeholder = "podaj kod filmiku czyli to co jest w linku po 'watch?v=' "; input.style.width = "60%";
  4. var input_ok = document.createElement( 'button' );
  5. input_ok.innerHTML = "gotowe"; input_ok.style.color = "black";
  6.  
  7. document.body.prepend( input_ok ); document.body.prepend( input );
  8. input_ok.onclick = function(){
  9. document.body.removeChild( input ); document.body.removeChild( input_ok );
  10. iframe.src = "https://www.youtube.com/embed/" + input.value;
  11. var space = document.body.getElementsByTagName( 'div' );
  12. space[1].className = "";
  13. var mid = document.getElementsByClassName( "col-sm-10 col-md-8 mid midfull" );
  14. mid[0].style.zIndex = "1"; mid[0].style.backgroundColor = "rgba(0,0,0,0.5)";
  15. document.body.prepend( iframe );
  16. iframe.style.position = "absolute"; iframe.style.zIndex = "99"; iframe.style.width = "98%"; iframe.style.height = "85%"; iframe.style.top = "15%";
  17. var buttons = document.createElement( 'div' );
  18. var button = document.createElement( 'button' );
  19. button.innerHTML = "H I D E";
  20. buttons.style.position = "absolute"; buttons.style.top = "3%"; buttons.style.zIndex = "99999"; button.style.color = "black";
  21. var chatButton = document.createElement( 'button' );
  22. chatButton.style.color = "black"; chatButton.innerHTML = "color";
  23. document.body.prepend( buttons );
  24. buttons.appendChild( button );
  25. buttons.appendChild( chatButton );
  26. button.onclick = function(){
  27. if(iframe.style.position == "absolute"){
  28. iframe.style.position = "fixed"; iframe.style.zIndex = "-1"; button.innerHTML = "S H O W";
  29. } else {
  30. iframe.style.position = "absolute"; iframe.style.zIndex = "99"; button.innerHTML = "H I D E";
  31. };
  32. };
  33. var chat = document.getElementsByClassName( "chat" );
  34. chatButton.onclick = function(){
  35. if(chatButton.style.color == "red"){
  36. chat[0].style.textShadow = "1px 2px blue";
  37. chatButton.style.color = "blue";
  38. } else if(chatButton.style.color == "blue"){
  39. chat[0].style.textShadow = "1px 2px green";
  40. chatButton.style.color = "green";
  41. } else if(chatButton.style.color == "green"){
  42. chat[0].style.textShadow = "";
  43. chatButton.style.color = "black";
  44. } else {
  45. chat[0].style.textShadow = "1px 2px red";
  46. chatButton.style.color = "red";
  47. };
  48. };
  49. };
Add Comment
Please, Sign In to add comment