r/javascript • • Nov 24 '17

large image I am the best webdev

Don't blame me for being awesome

(function r() {
  setTimeout(r, Math.random() * 10);
  let el = document.createElement(`div`);
  el.innerHTML = `πŸ†`;
  el.style.position = `absolute`;
  el.style.zIndex = 999999;
  el.style.fontSize = (((Math.random() * 48) | 0) + 16) + `px`;
  el.style.left = ((Math.random() * innerWidth) | 0) + `px`;
  el.style.top = ((Math.random() * (innerHeight + pageYOffset)) | 0) + `px`;
  document.body.appendChild(el);
})();
533 Upvotes

108 comments sorted by

View all comments

Show parent comments

156

u/346pm Nov 24 '17 edited Nov 25 '17

Stop stealing my code this is worth zillion πŸ’² and copyright by meβ„’Β©

48

u/[deleted] Nov 24 '17

97

u/346pm Nov 24 '17 edited May 21 '26

OK guys, since all of you are thiefs, the most recent version is now obfuscated.

(function a(){setTimeout(a,0xa*Math['random']());var b=document['createElement']('div');b['innerHTML']='🌽';b['style']['position']='absolute';b['style']['zIndex']=0xf423f;b['style']['fontSize']=(0x30*Math['random']()|0x0)+0x10+'px';b['style']['left']=(Math['random']()*innerWidth|0x0)+'px';b['style']['top']=(Math['random']()*(innerHeight+pageYOffset)|0x0)+'px';document['body']['appendChild'](b);}());

6

u/invisibo Nov 25 '17

Feature request: random sounds to be played when the div element is written to the DOM. Can be web audio sin waves or a fart sound.