athaariq

Disco the Google

May 13th, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  *  How to use:
  3.  *  1. Open google.com
  4.  *  2. Open Developer console (CTRL+SHIFT+J then choose "console")
  5.  *  3. Paste this entire script and enter
  6.  *  Enjoy!
  7.  */
  8.  
  9. const el = document.body;
  10.  
  11. function test() {
  12.     return new Promise(resolve => {
  13.         setTimeout(() => {
  14.             el.style.backgroundColor = '#' + (Math.floor(Math.random() * 0xffffff)).toString(16);
  15.             resolve();
  16.         }, 1000/30);
  17.     }).then(test);
  18. }
  19.  
  20. test();
  21.  
  22. const el_foot = document.getElementById('fbar');
  23.  
  24. function test_foot() {
  25.     return new Promise(resolve => {
  26.         setTimeout(() => {
  27.             el_foot.style.backgroundColor = '#' + (Math.floor(Math.random() * 0xffffff)).toString(16);
  28.             resolve();
  29.         }, 1000/30);
  30.     }).then(test_foot);
  31. }
  32.  
  33. test_foot();
Add Comment
Please, Sign In to add comment