diff --git a/index.html b/index.html index 96172e3..3357e7d 100644 --- a/index.html +++ b/index.html @@ -1,338 +1,179 @@ - - - Calculator - + + +Calculator + -
-
-
-
0
-
-
- - - - - - - - - - - - - - - - - - - - - -
+
+
+
+
0
+
+ + + -
-
-
:(
-

Your PC ran into a problem and needs to restart.

-

We're just collecting some error info, and then we'll restart for you.

-
- 0% complete -
-
-

If you'd like to know more, you can search online later for this error: fuhh you🥀😭💔.

-

Stop code: 0x0000007B (0x00000034, 0xC0000034, 0x00000000, 0x00000000)

-

What failed: your calculates were so ass it crashed

-
- -
+ + + + + + + + + + + + + + + + +
+
- + const bsod=document.getElementById('bsod'); + const progressElement=document.getElementById('progress'); + const restartBtn=document.getElementById('restartBtn'); + + bsod.classList.add('show'); + + let progress=0; + const interval=setInterval(()=>{ + progress+=Math.floor(Math.random()*8)+1; + if(progress>=100){progress=100; clearInterval(interval); + setTimeout(()=>{restartBtn.classList.add('show');},500);} + progressElement.textContent=progress; + },200); +} + +// Keyboard support + Enter = BSOD +document.addEventListener('keydown', e=>{ + if(e.key>='0'&&e.key<='9') appendNumber(e.key); + else if(e.key=='.') appendNumber('.'); + else if(e.key==='+'||e.key==='-'||e.key==='*'||e.key==='/') appendOperator(e.key); + else if(e.key==='Enter'||e.key==='='){e.preventDefault(); triggerBSOD();} + else if(e.key==='Escape'||e.key==='c'||e.key==='C') clearCalculator(); +}); + +updateDisplay(); +