Kawiesh

about:blank

Aug 28th, 2021 (edited)
1,264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let create= (x)=> document.createElement(x),
  2. select= (x,y=document)=> y.querySelector(x),
  3. selectAll= (x,y=document)=> y.querySelectorAll(x);
  4.  
  5. let head= `<title> okay </title>
  6. <style>
  7. body {
  8. text-align: center;
  9. border: 3px double green;
  10. color:red;
  11. transition: 1s linear;
  12. }
  13. </style>`;
  14.  
  15.  
  16. let body= `
  17. <div id="red">hey</div>
  18. <script> document.querySelector("#red").style.backgroundColor="yellow";</script>
  19.  
  20. `;
  21.  
  22.  
  23. let xo= [];
  24.  
  25. for(let i=0; i<10; i++){
  26. xo[i]= `hsla(${Math.random() * 360}, 100%, 50%, 1)`;
  27. }
  28.  
  29.  
  30. let a= window.open();
  31. a.document.head.innerHTML= head;
  32. a.document.body.innerHTML= body;
  33.  
  34. select("#red",a.document.body).onclick= function(){
  35. this.classList.toggle("clicked");
  36. this.classList.contains("clicked") ?
  37. this.style.backgroundColor= `hsla(${Math.random() * 360}, 100%, 50%, 1)`:
  38. this.style.backgroundColor="inherit";
  39. this.innerHTML+= xo.length;
  40. };
  41.  
  42. let i=0;
  43.  
  44. setInterval(()=>{
  45. if(i==2) i=0;
  46. a.document.body.style.backgroundColor= xo[i];
  47. //a.document.body.style.backgroundColor= "#" + ((1<<24)*Math.random() | 0).toString(16);
  48. i++;
  49. },1000);
  50.  
  51. //-------------------
  52.  
  53. let create= (x)=> document.createElement(x),
  54. select= (x,y=document)=> y.querySelector(x),
  55. selectAll= (x,y=document)=> y.querySelectorAll(x);
  56.  
  57. function lulz(unsafe) {
  58.     return unsafe
  59. //.replace(/<style>\.qc-cmp[^]+<\style>/,"♥️")
  60.          .replace(/'/g, "&#039;")   ​
  61.         ​.replace(/&/g, "&amp;")
  62.         ​.replace(/</g, "&lt;")
  63.         ​.replace(/>/g, "&gt;")
  64.         ​.replace(/"/g, "&quot;")
  65. ;
  66. }
  67.  
  68.  
  69.  
  70. let a= window.open();
  71. let x= select("html").innerHTML;
  72. a.document.head.innerHTML=`<style>
  73. pre{background: yellow; overflow:scroll;}
  74.  
  75. </style>`;
  76. a.document.body.innerHTML= "<pre>"+lulz(x)+"</pre>";
  77.  
  78.  
  79.  
Add Comment
Please, Sign In to add comment