Skip to content
Sign upLog in
Prank blue screen of death (SO REALISTIC!!!)
Profile icon

You were playing your favorite video game (which your mom and dad told you specifically not to), when all of a sudden, oh noooes! A BSoD (blue screen of death) appears, you panic, not knowing big boi words. It restarts, then says get fooled! You've been gnomed!

Funny BSOD prank. I tried it out with my dad, he totally got fooled XD. Kinda hard to prank people since it's on a webpage (for the people who know nothing about computers, it may be easy), but nevertheless fun. Looks sooo authentic, I even put real errors in there (yes, DRIVER_IRQL_NOT_GREATER_THAN_OR_EQUAL_TO is an error)! Hope you like it (hint: works best in full screen) :)

You are viewing a single comment. View All
Profile icon

What do you have against promises? You'll have to get used to them eventually, ECMAScript is usually offered asynchronous and concurrent APIs, so it makes code that revolves around the event loop much nicer. You can do some pretty cool stuff with 'em, and most newer APIs (since 2015+) are using promises, so, unless you stick to below roughly ES2015, you'll need to use them, as the native code uses them.

Also, I see that you're a Node.js user, if you ever use Deno, which Repl supports at, they make heavy use of promises, but they also have top-level await enabled by default, making it effortless to use. (V8 has had it since 2019, I have it enabled in my own browser)

It made the multiple levels of nesting into just one level.
Besides that, I made a greater separation between HTML, ES, and CSS, a large portion of it was tightly coupled together, which isn't good practice.

But really, the biggest change was the removal of the switch case, replacing it with one line:

switch(iterator){ case 1: document.getElementById('booting').textContent = 'Booting up... |'; iterator++; break; case 2: document.getElementById('booting').textContent = 'Booting up... /'; iterator++; break; case 3: document.getElementById('booting').textContent = 'Booting up... -'; iterator++; break; case 4: document.getElementById('booting').textContent = 'Booting up... \\'; iterator = 1; break; } iterator2++;


{ const limit = 90 + Math.floor( Math.random( ) * 50 ); for ( let iterator = 0; iterator !== limit; ++iterator ) { await delay( 0.1 ); textNode.textContent = "|/-\\"[ iterator & 3 ]; } }

Imho, that's way cleaner now.

But, I just realized, your code was already statically typed, maybe you'd like TypeScript?