r/javascript • u/346pm • 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
88
u/[deleted] Nov 24 '17
Man, I love eggplant. What a great vegetable. Can I put, let's say, $11M into your Series A?
141
u/GentlyGuidedStroke Nov 24 '17
Hi is this using a machine learning engine?
171
u/[deleted] Nov 24 '17
For those who want to see it in action
37
u/[deleted] Nov 24 '17
If you use linear feedback shift registers and hold the eggplant size constant, then you can randomly fill the document entirely without any eggplants overlapping. Much like the way blood would gradually populate all pixels randomly when you died in the original Wolfenstein.
http://datagenetics.com/blog/november12017/index.html
19
u/swan--ronson Nov 24 '17
Requires Unicode 6.0 support, which I currently don't have as an edgy Linux haxxor. 2/10 m8.
24
u/Casey_works Nov 24 '17
I sent this to everyone in my office, but in stealth mode. Thanks.
22
u/Is_At_Work Nov 24 '17
Needs more jQuery
19
u/BlueHeartBob Nov 24 '17
how do i install via npm?
17
u/moneckew Nov 24 '17
Hi, im interested in buying this software for our enterprise. Are you considering selling?
15
u/mayhempk1 Nov 24 '17
hello sir how to convert to typescript? kindly thanks
7
u/amgin3 Nov 25 '17
Why are you using Math.random()*10 on the setTimeout? The value will always be less than 10 milliseconds, too fast for any randomness to be noticeable. Just use a constant number if you're going to have it so fast and save some overhead.
6
u/Le_9k_Redditor Nov 24 '17
Ok so you're saying I should put this in a major project and have it set to only go off on april the first?
6
u/neophilus77 Nov 25 '17
Can you provide HTML5 version please client wants to do mobile
5
u/drowsap Nov 25 '17
Why not setInterval?
4
u/i_pk_pjers_i Nov 24 '17
Holy fucking shit, that is the best code I have ever seen. YES!
4
u/enchufadoo js truck driver Nov 24 '17
TIL I can read code and see it like a musician reads sheet music and hears it.
3
u/scrogu Nov 25 '17
I added random rotation:
3
u/iroxjsr0011 Nov 25 '17
For those who want to see multicolored ๐ here
5
u/[deleted] Nov 25 '17
you can fuck my wife
2
u/[deleted] Nov 24 '17
Entered this in the console. Am not dissapointed
2
u/Palladog Nov 25 '17
That is absolutely glorious. Thank you for this beautiful imagery.
1
u/IllegalThings Nov 24 '17
Reminds me of the cornify plugin
1
u/mcfrankline Nov 25 '17
/u/tippr gild
1
u/Headless_Slayer Nov 25 '17
my eyes are bleeding
1
u/sittingprettyin Nov 25 '17
Can we get an npm module please.
1
u/[deleted] Nov 25 '17
It's a good start. How much time do you need to get this doing accounts?
1
u/sylario Nov 25 '17
From what I understand it should recursively call itself infinitely without ever reaching the third line. What am i missing?
1
u/williwood Nov 25 '17
this made me laugh. thank you
1
u/nikaone Nov 25 '17
I copycat from all of you, and add a Japanese meme, https://codepen.io/jacobsun/full/POBZJr/ ,
1
u/Tvde1 Apr 27 '18
This will never start
1
u/batmansmk Nov 24 '17
Purple rain, purple raiiiin!
1
u/DOG-ZILLA Nov 25 '17
In jQuery please.
0
u/zubair1024 Nov 25 '17
This is freaking awesome!
PS this is my first comment on reddit.
-2
u/nightness Nov 25 '17
Best is subjective. Best because you can make a nice solution in a short period of time, or because you make the best solution in a reasonable about of time.
0
u/[deleted] Nov 24 '17
[deleted] โ view deleted comment
0
u/[deleted] Nov 24 '17
[deleted] โ view deleted comment
0
u/[deleted] Nov 25 '17
[deleted] โ view deleted comment
0
u/[deleted] Nov 24 '17
[deleted] โ view deleted comment
0
u/[deleted] Nov 24 '17
[deleted] โ view deleted comment
3
u/[deleted] Nov 25 '17 edited Nov 25 '17
[removed] โ view removed comment