darkc0de commited on
Commit
7fb59fb
·
verified ·
1 Parent(s): f072dd2

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +530 -170
index.html CHANGED
@@ -84,6 +84,7 @@
84
 
85
  .window.active {
86
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 255, 255, 0.3);
 
87
  }
88
 
89
  .window-header {
@@ -144,6 +145,10 @@
144
  text-shadow: 0 0 5px currentColor, 0 0 10px currentColor;
145
  }
146
 
 
 
 
 
147
  /* Taskbar */
148
  .taskbar {
149
  background: linear-gradient(180deg, rgba(10, 25, 50, 0.9) 0%, rgba(5, 15, 30, 0.95) 100%);
@@ -210,6 +215,15 @@
210
  }
211
 
212
  /* Animations */
 
 
 
 
 
 
 
 
 
213
  @keyframes slide-up {
214
  from { transform: translateY(100%); opacity: 0; }
215
  to { transform: translateY(0); opacity: 1; }
@@ -219,6 +233,23 @@
219
  animation: slide-up 0.3s ease-out;
220
  }
221
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
222
  .grid-pattern {
223
  background-image:
224
  linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
@@ -276,6 +307,7 @@
276
  <span class="text-xs text-center font-medium text-pink-100 drop-shadow-md">Calculator</span>
277
  </div>
278
 
 
279
  <div class="desktop-icon flex flex-col items-center p-3 rounded-lg w-24" onclick="openWindow('spec')">
280
  <div class="w-12 h-12 bg-gray-900 rounded-lg flex items-center justify-center mb-2 border border-red-500/30 shadow-lg shadow-red-500/20">
281
  <i data-lucide="book-open" class="w-6 h-6 text-red-400"></i>
@@ -283,6 +315,7 @@
283
  <span class="text-xs text-center font-medium text-red-100 drop-shadow-md">Master Spec</span>
284
  </div>
285
 
 
286
  <div class="desktop-icon flex flex-col items-center p-3 rounded-lg w-24" onclick="openWindow('favs')">
287
  <div class="w-12 h-12 bg-gray-900 rounded-lg flex items-center justify-center mb-2 border border-yellow-500/30 shadow-lg shadow-yellow-500/20">
288
  <i data-lucide="star" class="w-6 h-6 text-yellow-400"></i>
@@ -290,14 +323,6 @@
290
  <span class="text-xs text-center font-medium text-yellow-100 drop-shadow-md">Xor's Favs</span>
291
  </div>
292
 
293
- <!-- NEW GAME DESKTOP ICON -->
294
- <div class="desktop-icon flex flex-col items-center p-3 rounded-lg w-24" onclick="openWindow('game')">
295
- <div class="w-12 h-12 bg-gray-900 rounded-lg flex items-center justify-center mb-2 border border-emerald-500/30 shadow-lg shadow-emerald-500/20">
296
- <i data-lucide="gamepad-2" class="w-6 h-6 text-emerald-400"></i>
297
- </div>
298
- <span class="text-xs text-center font-medium text-emerald-100 drop-shadow-md">Cyber Snake</span>
299
- </div>
300
-
301
  <a href="https://ko-fi.com/Z8Z51E5TIG" target="_blank" class="desktop-icon flex flex-col items-center p-3 rounded-lg w-24 no-underline">
302
  <div class="w-12 h-12 bg-gray-900 rounded-lg flex items-center justify-center mb-2 border border-orange-500/30 shadow-lg shadow-orange-500/20">
303
  <i data-lucide="coffee" class="w-6 h-6 text-orange-400"></i>
@@ -335,7 +360,7 @@
335
  <div class="terminal-text text-green-400 space-y-1">
336
  <div class="text-cyan-400 font-bold">Xortron Operating System v7.7.7</div>
337
  <div class="text-gray-400">Kernel 5.15.0-76-generic x86_64</div>
338
- <div class="text-gray-500 text-xs mt-2">Last login: <span id="last-login"></span> from 192.168.1.105</div>
339
  <div class="mt-4 flex items-center">
340
  <span class="text-green-500">root@xortron-os:~#</span>
341
  <span class="ml-2 cursor-blink">█</span>
@@ -366,17 +391,56 @@
366
  <div class="flex items-center gap-2 text-gray-300 hover:text-cyan-400 cursor-pointer p-1 rounded hover:bg-cyan-900/20 transition"><i data-lucide="monitor" class="w-4 h-4"></i> Desktop</div>
367
  <div class="flex items-center gap-2 text-gray-300 hover:text-cyan-400 cursor-pointer p-1 rounded hover:bg-cyan-900/20 transition"><i data-lucide="download" class="w-4 h-4"></i> Downloads</div>
368
  <div class="flex items-center gap-2 text-cyan-400 bg-cyan-900/20 p-1 rounded cursor-pointer"><i data-lucide="database" class="w-4 h-4"></i> Data</div>
 
 
 
 
 
 
 
 
 
 
369
  </div>
370
  </div>
371
  <div class="flex-1 p-4 bg-black/20 grid-pattern overflow-auto">
 
 
 
 
 
 
 
372
  <div class="grid grid-cols-4 gap-3">
373
  <div class="glass-panel p-3 rounded-lg hover:bg-cyan-900/20 cursor-pointer transition group">
374
  <i data-lucide="file-code" class="w-8 h-8 text-blue-400 mb-2 group-hover:scale-110 transition"></i>
375
  <div class="text-xs text-gray-300 truncate">script.py</div>
 
 
 
 
 
 
376
  </div>
377
  <div class="glass-panel p-3 rounded-lg hover:bg-cyan-900/20 cursor-pointer transition group">
378
  <i data-lucide="file-archive" class="w-8 h-8 text-red-400 mb-2 group-hover:scale-110 transition"></i>
379
- <div class="text-xs text-gray-300 truncate">data.zip</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
380
  </div>
381
  </div>
382
  </div>
@@ -391,6 +455,7 @@
391
  <span class="text-sm font-medium text-red-100">Hack Tools v3.1.4</span>
392
  </div>
393
  <div class="flex items-center gap-2">
 
394
  <div class="window-btn btn-min" onclick="minimizeWindow('hacktools')"></div>
395
  <div class="window-btn btn-max" onclick="maximizeWindow('hacktools')"></div>
396
  <div class="window-btn btn-close" onclick="closeWindow('hacktools')"></div>
@@ -398,11 +463,78 @@
398
  </div>
399
  <div class="p-6 h-[calc(100%-40px)] overflow-auto bg-black/40">
400
  <div class="grid grid-cols-2 gap-4">
401
- <div class="glass-panel p-4 rounded-lg border border-transparent hover:border-red-500/30">
402
- <div class="font-semibold text-red-100">Port Scanner</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
403
  </div>
404
- <div class="glass-panel p-4 rounded-lg border border-transparent hover:border-orange-500/30">
405
- <div class="font-semibold text-orange-100">Brute Force</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
406
  </div>
407
  </div>
408
  </div>
@@ -416,14 +548,97 @@
416
  <span class="text-sm font-medium text-green-100">Network Monitor</span>
417
  </div>
418
  <div class="flex items-center gap-2">
 
419
  <div class="window-btn btn-min" onclick="minimizeWindow('network')"></div>
420
  <div class="window-btn btn-max" onclick="maximizeWindow('network')"></div>
421
  <div class="window-btn btn-close" onclick="closeWindow('network')"></div>
422
  </div>
423
  </div>
424
- <div class="p-4 bg-black/40 h-[calc(100%-40px)]">
425
- <div class="font-mono text-green-400">
426
- <span id="download-speed">3.7</span> MB/s ↓ | <span id="upload-speed">1.2</span> MB/s ↑
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
427
  </div>
428
  </div>
429
  </div>
@@ -436,14 +651,41 @@
436
  <span class="text-sm font-medium text-purple-100">Xortron Browser</span>
437
  </div>
438
  <div class="flex items-center gap-2">
 
 
 
 
439
  <div class="window-btn btn-min" onclick="minimizeWindow('browser')"></div>
440
  <div class="window-btn btn-max" onclick="maximizeWindow('browser')"></div>
441
  <div class="window-btn btn-close" onclick="closeWindow('browser')"></div>
442
  </div>
443
  </div>
444
  <div class="flex flex-col h-[calc(100%-40px)] bg-gray-900">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
445
  <div class="flex-1 relative bg-black/40 overflow-hidden">
446
  <iframe id="browser-frame" src="https://darkc0de-chat.hf.space/" class="w-full h-full border-none" sandbox="allow-scripts allow-same-origin allow-forms allow-popups"></iframe>
 
 
 
 
 
 
447
  </div>
448
  </div>
449
  </div>
@@ -456,6 +698,7 @@
456
  <span class="text-sm font-medium text-pink-100">Xortron-Calc</span>
457
  </div>
458
  <div class="flex items-center gap-2">
 
459
  <div class="window-btn btn-min" onclick="minimizeWindow('calculator')"></div>
460
  <div class="window-btn btn-max" onclick="maximizeWindow('calculator')"></div>
461
  <div class="window-btn btn-close" onclick="closeWindow('calculator')"></div>
@@ -466,6 +709,31 @@
466
  <div id="calc-history" class="text-xs text-gray-500 font-mono text-right mb-1 h-4"></div>
467
  <div id="calc-display" class="text-3xl text-pink-100 font-mono text-right truncate">0</div>
468
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
469
  </div>
470
  </div>
471
 
@@ -477,6 +745,10 @@
477
  <span class="text-sm font-medium text-red-100">Xortron Master Spec</span>
478
  </div>
479
  <div class="flex items-center gap-2">
 
 
 
 
480
  <div class="window-btn btn-min" onclick="minimizeWindow('spec')"></div>
481
  <div class="window-btn btn-max" onclick="maximizeWindow('spec')"></div>
482
  <div class="window-btn btn-close" onclick="closeWindow('spec')"></div>
@@ -487,7 +759,7 @@
487
  </div>
488
  </div>
489
 
490
- <!-- Xor's Favs Window -->
491
  <div id="window-favs" class="window glass-strong pointer-events-auto hidden" style="top: 8%; left: 18%; width: 400px; height: 700px; z-index: 56;">
492
  <div class="window-header flex items-center justify-between px-4 py-2 select-none" onmousedown="startDrag(event, 'window-favs')">
493
  <div class="flex items-center gap-2">
@@ -495,6 +767,10 @@
495
  <span class="text-sm font-medium text-yellow-100">Xor's Favorites</span>
496
  </div>
497
  <div class="flex items-center gap-2">
 
 
 
 
498
  <div class="window-btn btn-min" onclick="minimizeWindow('favs')"></div>
499
  <div class="window-btn btn-max" onclick="maximizeWindow('favs')"></div>
500
  <div class="window-btn btn-close" onclick="closeWindow('favs')"></div>
@@ -505,33 +781,20 @@
505
  </div>
506
  </div>
507
 
508
- <!-- NEW: CYBER SNAKE GAME WINDOW -->
509
- <div id="window-game" class="window glass-strong pointer-events-auto hidden" style="top: 15%; left: 35%; width: 420px; height: 500px; z-index: 65;">
510
- <div class="window-header flex items-center justify-between px-4 py-2 select-none" onmousedown="startDrag(event, 'window-game')">
511
- <div class="flex items-center gap-2">
512
- <i data-lucide="gamepad-2" class="w-4 h-4 text-emerald-400"></i>
513
- <span class="text-sm font-medium text-emerald-100">Cyber Snake</span>
514
- </div>
515
- <div class="flex items-center gap-2">
516
- <span class="text-xs text-gray-400 font-mono mr-2">Score: <span id="snake-score" class="text-emerald-400 font-bold">0</span></span>
517
- <div class="window-btn btn-min" onclick="minimizeWindow('game')"></div>
518
- <div class="window-btn btn-max" onclick="maximizeWindow('game')"></div>
519
- <div class="window-btn btn-close" onclick="closeWindow('game')"></div>
520
- </div>
521
- </div>
522
- <div class="flex flex-col items-center justify-center h-[calc(100%-40px)] bg-black/90 relative p-4">
523
-
524
- <div id="snake-overlay" class="absolute inset-0 flex flex-col items-center justify-center bg-black/80 backdrop-blur-sm z-10 transition-all">
525
- <i data-lucide="gamepad-2" class="w-12 h-12 text-emerald-400 mb-4 animate-pulse"></i>
526
- <h2 class="text-3xl font-bold text-emerald-400 mb-2 font-mono neon-text tracking-widest">CYBER SNAKE</h2>
527
- <p class="text-gray-400 text-sm mb-6 font-mono text-center px-8">Use arrow keys to control.<br>Do not hit the walls.</p>
528
- <button onclick="startSnakeGame()" class="px-6 py-2 bg-emerald-500/10 border border-emerald-500/50 text-emerald-400 hover:bg-emerald-500 hover:text-black hover:shadow-[0_0_15px_#10b981] transition-all rounded font-bold tracking-widest">INITIATE</button>
529
- </div>
530
-
531
- <canvas id="snake-canvas" width="360" height="360" class="border border-emerald-500/30 shadow-[0_0_20px_rgba(16,185,129,0.15)] bg-gray-900 rounded"></canvas>
532
  </div>
 
 
 
533
  </div>
534
-
535
  </div>
536
 
537
  <!-- Taskbar -->
@@ -561,26 +824,28 @@
561
  <button class="taskbar-icon w-10 h-10 rounded-lg flex items-center justify-center" onclick="openWindow('calculator')" id="taskbar-calculator">
562
  <i data-lucide="calculator" class="w-5 h-5 text-pink-400"></i>
563
  </button>
 
564
  <button class="taskbar-icon w-10 h-10 rounded-lg flex items-center justify-center" onclick="openWindow('spec')" id="taskbar-spec">
565
  <i data-lucide="book-open" class="w-5 h-5 text-red-400"></i>
566
  </button>
 
567
  <button class="taskbar-icon w-10 h-10 rounded-lg flex items-center justify-center" onclick="openWindow('favs')" id="taskbar-favs">
568
  <i data-lucide="star" class="w-5 h-5 text-yellow-400"></i>
569
  </button>
570
-
571
- <!-- NEW GAME TASKBAR ICON -->
572
- <button class="taskbar-icon w-10 h-10 rounded-lg flex items-center justify-center" onclick="openWindow('game')" id="taskbar-game">
573
- <i data-lucide="gamepad-2" class="w-5 h-5 text-emerald-400"></i>
574
- </button>
575
  </div>
576
 
577
  <div class="flex items-center gap-4 px-4 py-2 glass-panel rounded-lg">
 
 
 
 
 
578
  <div class="text-xs font-mono text-gray-300" id="clock">03:57 AM</div>
579
  <div class="text-xs text-gray-500" id="date">Wed, Mar 18</div>
580
  </div>
581
  </div>
582
 
583
- <!-- Start Menu -->
584
  <div id="start-menu" class="fixed bottom-16 left-4 w-64 glass-strong rounded-xl border border-cyan-500/20 shadow-2xl transform translate-y-4 opacity-0 pointer-events-none transition-all duration-200 z-[998]">
585
  <div class="p-4 border-b border-cyan-900/30">
586
  <div class="flex items-center gap-3">
@@ -612,22 +877,29 @@
612
  <button class="w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-pink-900/20 transition text-left text-sm text-gray-300" onclick="openWindow('calculator'); toggleStartMenu()">
613
  <i data-lucide="calculator" class="w-4 h-4 text-pink-400"></i> Calculator
614
  </button>
 
 
615
  <button class="w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-red-900/20 transition text-left text-sm text-gray-300" onclick="openWindow('spec'); toggleStartMenu()">
616
  <i data-lucide="book-open" class="w-4 h-4 text-red-400"></i> Master Spec
617
  </button>
 
 
618
  <button class="w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-yellow-900/20 transition text-left text-sm text-gray-300" onclick="openWindow('favs'); toggleStartMenu()">
619
  <i data-lucide="star" class="w-4 h-4 text-yellow-400"></i> Xor's Favs
620
  </button>
621
 
622
- <!-- NEW GAME START MENU ITEM -->
623
- <button class="w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-emerald-900/20 transition text-left text-sm text-gray-300" onclick="openWindow('game'); toggleStartMenu()">
624
- <i data-lucide="gamepad-2" class="w-4 h-4 text-emerald-400"></i> Cyber Snake
625
- </button>
626
-
627
  <div class="border-t border-cyan-900/30 my-2"></div>
628
  <a href="https://ko-fi.com/Z8Z51E5TIG" target="_blank" class="w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-orange-900/20 transition text-left text-sm text-gray-300 no-underline" onclick="toggleStartMenu()">
629
  <i data-lucide="coffee" class="w-4 h-4 text-orange-400"></i> Buy me a coffee
630
  </a>
 
 
 
 
 
 
 
 
631
  </div>
632
  </div>
633
 
@@ -662,8 +934,10 @@
662
  window.style.zIndex = ++zIndexCounter;
663
  window.classList.add('active');
664
 
 
665
  if (taskbarBtn) taskbarBtn.classList.add('active');
666
 
 
667
  window.style.transform = 'scale(0.9)';
668
  window.style.opacity = '0';
669
  setTimeout(() => {
@@ -671,8 +945,10 @@
671
  window.style.opacity = '1';
672
  }, 10);
673
  } else {
 
674
  focusWindow(windowId);
675
  }
 
676
  activeWindow = windowId;
677
  }
678
 
@@ -709,12 +985,14 @@
709
  const window = document.getElementById(`window-${windowId}`);
710
 
711
  if (window.dataset.maximized === 'true') {
 
712
  window.style.width = window.dataset.prevWidth;
713
  window.style.height = window.dataset.prevHeight;
714
  window.style.top = window.dataset.prevTop;
715
  window.style.left = window.dataset.prevLeft;
716
  window.dataset.maximized = 'false';
717
  } else {
 
718
  window.dataset.prevWidth = window.style.width;
719
  window.dataset.prevHeight = window.style.height;
720
  window.dataset.prevTop = window.style.top;
@@ -732,19 +1010,22 @@
732
  const window = document.getElementById(`window-${windowId}`);
733
  window.style.zIndex = ++zIndexCounter;
734
 
 
735
  document.querySelectorAll('.window').forEach(w => w.classList.remove('active'));
736
  window.classList.add('active');
737
  }
738
 
 
739
  function startDrag(e, windowId) {
740
- if (e.target.closest('.window-btn')) return;
741
 
742
  const window = document.getElementById(windowId);
743
- if (window.dataset.maximized === 'true') return;
744
 
745
  isDragging = true;
746
  draggedWindow = window;
747
 
 
748
  document.querySelectorAll('iframe').forEach(iframe => {
749
  iframe.style.pointerEvents = 'none';
750
  });
@@ -762,6 +1043,7 @@
762
  let x = e.clientX - dragOffset.x;
763
  let y = e.clientY - dragOffset.y;
764
 
 
765
  x = Math.max(0, Math.min(x, window.innerWidth - draggedWindow.offsetWidth));
766
  y = Math.max(0, Math.min(y, window.innerHeight - draggedWindow.offsetHeight - 56));
767
 
@@ -773,11 +1055,13 @@
773
  isDragging = false;
774
  draggedWindow = null;
775
 
 
776
  document.querySelectorAll('iframe').forEach(iframe => {
777
  iframe.style.pointerEvents = 'auto';
778
  });
779
  });
780
 
 
781
  document.querySelectorAll('.window').forEach(window => {
782
  window.addEventListener('mousedown', () => {
783
  const id = window.id.replace('window-', '');
@@ -785,6 +1069,7 @@
785
  });
786
  });
787
 
 
788
  function toggleStartMenu() {
789
  const menu = document.getElementById('start-menu');
790
  if (menu.classList.contains('opacity-0')) {
@@ -794,15 +1079,35 @@
794
  }
795
  }
796
 
 
797
  document.addEventListener('click', (e) => {
798
  const menu = document.getElementById('start-menu');
799
  const btn = document.querySelector('[onclick="toggleStartMenu()"]');
800
 
801
- if (!menu.contains(e.target) && btn && !btn.contains(e.target)) {
802
  menu.classList.add('opacity-0', 'pointer-events-none', 'translate-y-4');
803
  }
804
  });
805
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
806
  document.querySelectorAll('.desktop-icon').forEach(icon => {
807
  icon.addEventListener('click', (e) => {
808
  e.stopPropagation();
@@ -815,143 +1120,198 @@
815
  document.querySelectorAll('.desktop-icon').forEach(i => i.classList.remove('selected'));
816
  });
817
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
818
 
819
- // ==========================================
820
- // CYBER SNAKE GAME LOGIC
821
- // ==========================================
822
- const gameCanvas = document.getElementById('snake-canvas');
823
- const gameCtx = gameCanvas.getContext('2d');
824
- const gridSize = 20;
825
- let snake = [];
826
- let food = {};
827
- let snakeDx = gridSize;
828
- let snakeDy = 0;
829
- let snakeGameLoop;
830
- let snakeScore = 0;
831
- let isSnakeRunning = false;
832
-
833
- function startSnakeGame() {
834
- document.getElementById('snake-overlay').classList.add('hidden');
835
 
836
- snake = [
837
- {x: 160, y: 160},
838
- {x: 140, y: 160},
839
- {x: 120, y: 160}
840
- ];
841
- snakeDx = gridSize;
842
- snakeDy = 0;
843
- snakeScore = 0;
844
- document.getElementById('snake-score').innerText = snakeScore;
845
 
846
- spawnFood();
 
847
 
848
- if(snakeGameLoop) clearInterval(snakeGameLoop);
849
- isSnakeRunning = true;
850
- snakeGameLoop = setInterval(updateSnake, 120);
 
 
 
 
 
 
 
851
  }
852
 
853
- function spawnFood() {
854
- food.x = Math.floor(Math.random() * (gameCanvas.width / gridSize)) * gridSize;
855
- food.y = Math.floor(Math.random() * (gameCanvas.height / gridSize)) * gridSize;
 
 
 
 
856
  }
857
 
858
- function updateSnake() {
859
- if (!isSnakeRunning) return;
860
-
861
- const head = {x: snake[0].x + snakeDx, y: snake[0].y + snakeDy};
862
-
863
- // Wall collision (Game Over)
864
- if (head.x < 0 || head.x >= gameCanvas.width || head.y < 0 || head.y >= gameCanvas.height) {
865
- return gameSnakeOver();
866
  }
 
867
 
868
- // Self collision (Game Over)
869
- for (let i = 0; i < snake.length; i++) {
870
- if (head.x === snake[i].x && head.y === snake[i].y) {
871
- return gameSnakeOver();
872
- }
873
- }
 
 
 
874
 
875
- snake.unshift(head);
 
 
 
876
 
877
- // Food collision
878
- if (head.x === food.x && head.y === food.y) {
879
- snakeScore += 10;
880
- document.getElementById('snake-score').innerText = snakeScore;
881
- spawnFood();
882
- } else {
883
- snake.pop();
884
- }
885
 
886
- drawSnake();
 
 
887
  }
888
 
889
- function drawSnake() {
890
- // Draw background
891
- gameCtx.fillStyle = '#111827'; // Dark gray bg
892
- gameCtx.fillRect(0, 0, gameCanvas.width, gameCanvas.height);
893
-
894
- // Draw grid lines (Cyber look)
895
- gameCtx.strokeStyle = 'rgba(16, 185, 129, 0.05)';
896
- gameCtx.lineWidth = 1;
897
- for(let i = 0; i < gameCanvas.width; i += gridSize) {
898
- gameCtx.beginPath(); gameCtx.moveTo(i, 0); gameCtx.lineTo(i, gameCanvas.height); gameCtx.stroke();
899
- gameCtx.beginPath(); gameCtx.moveTo(0, i); gameCtx.lineTo(gameCanvas.width, i); gameCtx.stroke();
900
  }
901
-
902
- // Draw Food
903
- gameCtx.fillStyle = '#ec4899'; // Pink food
904
- gameCtx.shadowBlur = 15;
905
- gameCtx.shadowColor = '#ec4899';
906
- gameCtx.fillRect(food.x + 2, food.y + 2, gridSize - 4, gridSize - 4);
907
-
908
- // Draw Snake
909
- gameCtx.shadowColor = '#10b981';
910
- snake.forEach((part, index) => {
911
- if(index === 0) {
912
- gameCtx.fillStyle = '#34d399'; // Lighter head
913
- gameCtx.shadowBlur = 10;
914
- } else {
915
- gameCtx.fillStyle = '#10b981'; // Body
916
- gameCtx.shadowBlur = 5;
917
- }
918
- gameCtx.fillRect(part.x + 1, part.y + 1, gridSize - 2, gridSize - 2);
919
- });
920
-
921
- gameCtx.shadowBlur = 0; // Reset
922
  }
923
 
924
- function gameSnakeOver() {
925
- isSnakeRunning = false;
926
- clearInterval(snakeGameLoop);
927
- const overlay = document.getElementById('snake-overlay');
928
- overlay.classList.remove('hidden');
929
- overlay.querySelector('h2').innerText = 'SYSTEM FAILURE';
930
- overlay.querySelector('h2').classList.replace('text-emerald-400', 'text-red-500');
931
- overlay.querySelector('p').innerHTML = `Game Over.<br>Final Score: ${snakeScore}`;
932
- overlay.querySelector('button').innerText = 'REBOOT GAME';
933
  }
934
 
935
- // Global Keydown hook that isolates commands only when the Game Window is active
936
- document.addEventListener('keydown', (e) => {
937
- const gameWindow = document.getElementById('window-game');
938
-
939
- // Only process game inputs if the Game window is open AND is currently active (in focus)
940
- if (gameWindow.classList.contains('hidden') || !gameWindow.classList.contains('active')) return;
 
941
 
942
- // Prevent page scrolling with arrows when playing
943
- if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].indexOf(e.code) > -1) {
944
- e.preventDefault();
 
 
 
 
 
 
 
 
 
945
  }
 
946
 
947
- if (!isSnakeRunning) return;
948
-
949
- if (e.code === 'ArrowUp' && snakeDy === 0) { snakeDx = 0; snakeDy = -gridSize; }
950
- if (e.code === 'ArrowDown' && snakeDy === 0) { snakeDx = 0; snakeDy = gridSize; }
951
- if (e.code === 'ArrowLeft' && snakeDx === 0) { snakeDx = -gridSize; snakeDy = 0; }
952
- if (e.code === 'ArrowRight' && snakeDx === 0) { snakeDx = gridSize; snakeDy = 0; }
 
 
 
 
 
 
 
 
 
953
  });
954
-
955
  </script>
956
  </body>
957
  </html>
 
84
 
85
  .window.active {
86
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 255, 255, 0.3);
87
+ /* z-index removed to fix stacking issues with JS */
88
  }
89
 
90
  .window-header {
 
145
  text-shadow: 0 0 5px currentColor, 0 0 10px currentColor;
146
  }
147
 
148
+ .neon-border {
149
+ box-shadow: 0 0 10px rgba(0, 255, 255, 0.5), inset 0 0 10px rgba(0, 255, 255, 0.1);
150
+ }
151
+
152
  /* Taskbar */
153
  .taskbar {
154
  background: linear-gradient(180deg, rgba(10, 25, 50, 0.9) 0%, rgba(5, 15, 30, 0.95) 100%);
 
215
  }
216
 
217
  /* Animations */
218
+ @keyframes pulse-glow {
219
+ 0%, 100% { box-shadow: 0 0 20px rgba(0, 255, 255, 0.3); }
220
+ 50% { box-shadow: 0 0 30px rgba(0, 255, 255, 0.6); }
221
+ }
222
+
223
+ .animate-pulse-glow {
224
+ animation: pulse-glow 2s infinite;
225
+ }
226
+
227
  @keyframes slide-up {
228
  from { transform: translateY(100%); opacity: 0; }
229
  to { transform: translateY(0); opacity: 1; }
 
233
  animation: slide-up 0.3s ease-out;
234
  }
235
 
236
+ /* Mobile Responsive */
237
+ @media (max-width: 768px) {
238
+ .window {
239
+ position: fixed !important;
240
+ top: 0 !important;
241
+ left: 0 !important;
242
+ width: 100% !important;
243
+ height: 100% !important;
244
+ border-radius: 0;
245
+ }
246
+
247
+ .desktop-grid {
248
+ grid-template-columns: repeat(3, 1fr);
249
+ }
250
+ }
251
+
252
+ /* Grid Pattern for File Manager */
253
  .grid-pattern {
254
  background-image:
255
  linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
 
307
  <span class="text-xs text-center font-medium text-pink-100 drop-shadow-md">Calculator</span>
308
  </div>
309
 
310
+ <!-- NEW MASTER SPEC DESKTOP ICON -->
311
  <div class="desktop-icon flex flex-col items-center p-3 rounded-lg w-24" onclick="openWindow('spec')">
312
  <div class="w-12 h-12 bg-gray-900 rounded-lg flex items-center justify-center mb-2 border border-red-500/30 shadow-lg shadow-red-500/20">
313
  <i data-lucide="book-open" class="w-6 h-6 text-red-400"></i>
 
315
  <span class="text-xs text-center font-medium text-red-100 drop-shadow-md">Master Spec</span>
316
  </div>
317
 
318
+ <!-- NEW XOR'S FAVS DESKTOP ICON -->
319
  <div class="desktop-icon flex flex-col items-center p-3 rounded-lg w-24" onclick="openWindow('favs')">
320
  <div class="w-12 h-12 bg-gray-900 rounded-lg flex items-center justify-center mb-2 border border-yellow-500/30 shadow-lg shadow-yellow-500/20">
321
  <i data-lucide="star" class="w-6 h-6 text-yellow-400"></i>
 
323
  <span class="text-xs text-center font-medium text-yellow-100 drop-shadow-md">Xor's Favs</span>
324
  </div>
325
 
 
 
 
 
 
 
 
 
326
  <a href="https://ko-fi.com/Z8Z51E5TIG" target="_blank" class="desktop-icon flex flex-col items-center p-3 rounded-lg w-24 no-underline">
327
  <div class="w-12 h-12 bg-gray-900 rounded-lg flex items-center justify-center mb-2 border border-orange-500/30 shadow-lg shadow-orange-500/20">
328
  <i data-lucide="coffee" class="w-6 h-6 text-orange-400"></i>
 
360
  <div class="terminal-text text-green-400 space-y-1">
361
  <div class="text-cyan-400 font-bold">Xortron Operating System v7.7.7</div>
362
  <div class="text-gray-400">Kernel 5.15.0-76-generic x86_64</div>
363
+ <div class="text-gray-500 text-xs mt-2">Last login: <span id="last-login">3/18/2026, 3:56:48 AM</span> from 192.168.1.105</div>
364
  <div class="mt-4 flex items-center">
365
  <span class="text-green-500">root@xortron-os:~#</span>
366
  <span class="ml-2 cursor-blink">█</span>
 
391
  <div class="flex items-center gap-2 text-gray-300 hover:text-cyan-400 cursor-pointer p-1 rounded hover:bg-cyan-900/20 transition"><i data-lucide="monitor" class="w-4 h-4"></i> Desktop</div>
392
  <div class="flex items-center gap-2 text-gray-300 hover:text-cyan-400 cursor-pointer p-1 rounded hover:bg-cyan-900/20 transition"><i data-lucide="download" class="w-4 h-4"></i> Downloads</div>
393
  <div class="flex items-center gap-2 text-cyan-400 bg-cyan-900/20 p-1 rounded cursor-pointer"><i data-lucide="database" class="w-4 h-4"></i> Data</div>
394
+ <div class="flex items-center gap-2 text-gray-300 hover:text-cyan-400 cursor-pointer p-1 rounded hover:bg-cyan-900/20 transition"><i data-lucide="wifi" class="w-4 h-4"></i> Network</div>
395
+ </div>
396
+ <div class="mt-6 pt-4 border-t border-cyan-900/30">
397
+ <div class="text-xs text-gray-500 mb-2">/root/files</div>
398
+ <button class="w-full py-1 px-2 bg-cyan-900/30 hover:bg-cyan-800/50 border border-cyan-700/50 rounded text-xs text-cyan-300 transition flex items-center justify-center gap-1">
399
+ <i data-lucide="plus" class="w-3 h-3"></i> New Folder
400
+ </button>
401
+ <button class="w-full mt-2 py-1 px-2 bg-cyan-900/30 hover:bg-cyan-800/50 border border-cyan-700/50 rounded text-xs text-cyan-300 transition flex items-center justify-center gap-1">
402
+ <i data-lucide="upload" class="w-3 h-3"></i> Upload
403
+ </button>
404
  </div>
405
  </div>
406
  <div class="flex-1 p-4 bg-black/20 grid-pattern overflow-auto">
407
+ <div class="flex items-center justify-between mb-4">
408
+ <div class="text-xs text-gray-400">Documents > Hack Tools</div>
409
+ <div class="flex gap-2">
410
+ <i data-lucide="grid" class="w-4 h-4 text-cyan-400 cursor-pointer"></i>
411
+ <i data-lucide="list" class="w-4 h-4 text-gray-500 cursor-pointer"></i>
412
+ </div>
413
+ </div>
414
  <div class="grid grid-cols-4 gap-3">
415
  <div class="glass-panel p-3 rounded-lg hover:bg-cyan-900/20 cursor-pointer transition group">
416
  <i data-lucide="file-code" class="w-8 h-8 text-blue-400 mb-2 group-hover:scale-110 transition"></i>
417
  <div class="text-xs text-gray-300 truncate">script.py</div>
418
+ <div class="text-[10px] text-gray-500">2.4 KB</div>
419
+ </div>
420
+ <div class="glass-panel p-3 rounded-lg hover:bg-cyan-900/20 cursor-pointer transition group">
421
+ <i data-lucide="file-text" class="w-8 h-8 text-yellow-400 mb-2 group-hover:scale-110 transition"></i>
422
+ <div class="text-xs text-gray-300 truncate">Weaponizer.txt</div>
423
+ <div class="text-[10px] text-gray-500">15 KB</div>
424
  </div>
425
  <div class="glass-panel p-3 rounded-lg hover:bg-cyan-900/20 cursor-pointer transition group">
426
  <i data-lucide="file-archive" class="w-8 h-8 text-red-400 mb-2 group-hover:scale-110 transition"></i>
427
+ <div class="text-xs text-gray-300 truncate">m3th4mph3t4m1n3.zip</div>
428
+ <div class="text-[10px] text-gray-500">45 MB</div>
429
+ </div>
430
+ <div class="glass-panel p-3 rounded-lg hover:bg-cyan-900/20 cursor-pointer transition group">
431
+ <i data-lucide="key" class="w-8 h-8 text-green-400 mb-2 group-hover:scale-110 transition"></i>
432
+ <div class="text-xs text-gray-300 truncate">keys.asc</div>
433
+ <div class="text-[10px] text-gray-500">4 KB</div>
434
+ </div>
435
+ <div class="glass-panel p-3 rounded-lg hover:bg-cyan-900/20 cursor-pointer transition group">
436
+ <i data-lucide="database" class="w-8 h-8 text-purple-400 mb-2 group-hover:scale-110 transition"></i>
437
+ <div class="text-xs text-gray-300 truncate">passwords.db</div>
438
+ <div class="text-[10px] text-gray-500">Encrypted</div>
439
+ </div>
440
+ <div class="glass-panel p-3 rounded-lg hover:bg-cyan-900/20 cursor-pointer transition group border-pink-500/30">
441
+ <i data-lucide="globe" class="w-8 h-8 text-pink-400 mb-2 group-hover:scale-110 transition"></i>
442
+ <div class="text-xs text-gray-300 truncate">PornHub.com</div>
443
+ <div class="text-[10px] text-gray-500">Shortcut</div>
444
  </div>
445
  </div>
446
  </div>
 
455
  <span class="text-sm font-medium text-red-100">Hack Tools v3.1.4</span>
456
  </div>
457
  <div class="flex items-center gap-2">
458
+ <span class="text-xs text-red-400 font-mono mr-2 animate-pulse">[Encrypted Connection Active]</span>
459
  <div class="window-btn btn-min" onclick="minimizeWindow('hacktools')"></div>
460
  <div class="window-btn btn-max" onclick="maximizeWindow('hacktools')"></div>
461
  <div class="window-btn btn-close" onclick="closeWindow('hacktools')"></div>
 
463
  </div>
464
  <div class="p-6 h-[calc(100%-40px)] overflow-auto bg-black/40">
465
  <div class="grid grid-cols-2 gap-4">
466
+ <div class="glass-panel p-4 rounded-lg hover:bg-red-900/10 cursor-pointer transition group border border-transparent hover:border-red-500/30">
467
+ <div class="flex items-center gap-3 mb-2">
468
+ <div class="p-2 bg-red-500/20 rounded-lg">
469
+ <i data-lucide="scan-line" class="w-5 h-5 text-red-400"></i>
470
+ </div>
471
+ <div class="font-semibold text-red-100">Port Scanner</div>
472
+ </div>
473
+ <div class="text-xs text-gray-400">Scan for open ports and services</div>
474
+ </div>
475
+
476
+ <div class="glass-panel p-4 rounded-lg hover:bg-orange-900/10 cursor-pointer transition group border border-transparent hover:border-orange-500/30">
477
+ <div class="flex items-center gap-3 mb-2">
478
+ <div class="p-2 bg-orange-500/20 rounded-lg">
479
+ <i data-lucide="hammer" class="w-5 h-5 text-orange-400"></i>
480
+ </div>
481
+ <div class="font-semibold text-orange-100">Brute Force</div>
482
+ </div>
483
+ <div class="text-xs text-gray-400">Password cracking utility</div>
484
+ </div>
485
+
486
+ <div class="glass-panel p-4 rounded-lg hover:bg-blue-900/10 cursor-pointer transition group border border-transparent hover:border-blue-500/30">
487
+ <div class="flex items-center gap-3 mb-2">
488
+ <div class="p-2 bg-blue-500/20 rounded-lg">
489
+ <i data-lucide="database" class="w-5 h-5 text-blue-400"></i>
490
+ </div>
491
+ <div class="font-semibold text-blue-100">SQL Inject</div>
492
+ </div>
493
+ <div class="text-xs text-gray-400">Database penetration tool</div>
494
+ </div>
495
+
496
+ <div class="glass-panel p-4 rounded-lg hover:bg-purple-900/10 cursor-pointer transition group border border-transparent hover:border-purple-500/30">
497
+ <div class="flex items-center gap-3 mb-2">
498
+ <div class="p-2 bg-purple-500/20 rounded-lg">
499
+ <i data-lucide="git-compare" class="w-5 h-5 text-purple-400"></i>
500
+ </div>
501
+ <div class="font-semibold text-purple-100">MITM</div>
502
+ </div>
503
+ <div class="text-xs text-gray-400">Man-in-the-middle attack</div>
504
  </div>
505
+
506
+ <div class="glass-panel p-4 rounded-lg hover:bg-yellow-900/10 cursor-pointer transition group border border-transparent hover:border-yellow-500/30">
507
+ <div class="flex items-center gap-3 mb-2">
508
+ <div class="p-2 bg-yellow-500/20 rounded-lg">
509
+ <i data-lucide="bug" class="w-5 h-5 text-yellow-400"></i>
510
+ </div>
511
+ <div class="font-semibold text-yellow-100">Exploit DB</div>
512
+ </div>
513
+ <div class="text-xs text-gray-400">Vulnerability database</div>
514
+ </div>
515
+
516
+ <div class="glass-panel p-4 rounded-lg hover:bg-green-900/10 cursor-pointer transition group border border-transparent hover:border-green-500/30">
517
+ <div class="flex items-center gap-3 mb-2">
518
+ <div class="p-2 bg-green-500/20 rounded-lg">
519
+ <i data-lucide="user-x" class="w-5 h-5 text-green-400"></i>
520
+ </div>
521
+ <div class="font-semibold text-green-100">Anonymizer</div>
522
+ </div>
523
+ <div class="text-xs text-gray-400">TOR/VPN configuration</div>
524
+ </div>
525
+ </div>
526
+
527
+ <div class="mt-6 p-4 glass-panel rounded-lg border border-red-500/20">
528
+ <div class="flex items-center gap-2 text-red-400 text-sm font-mono mb-2">
529
+ <i data-lucide="activity" class="w-4 h-4 animate-pulse"></i>
530
+ <span>SYSTEM STATUS: ARMED</span>
531
+ </div>
532
+ <div class="w-full bg-gray-800 rounded-full h-2 overflow-hidden">
533
+ <div class="bg-gradient-to-r from-red-500 to-orange-500 h-full w-[78%] animate-pulse"></div>
534
+ </div>
535
+ <div class="flex justify-between text-xs text-gray-500 mt-1 font-mono">
536
+ <span>Threat Level: HIGH</span>
537
+ <span>78%</span>
538
  </div>
539
  </div>
540
  </div>
 
548
  <span class="text-sm font-medium text-green-100">Network Monitor</span>
549
  </div>
550
  <div class="flex items-center gap-2">
551
+ <span class="text-xs text-green-400 font-mono mr-2 animate-pulse">12 active connections</span>
552
  <div class="window-btn btn-min" onclick="minimizeWindow('network')"></div>
553
  <div class="window-btn btn-max" onclick="maximizeWindow('network')"></div>
554
  <div class="window-btn btn-close" onclick="closeWindow('network')"></div>
555
  </div>
556
  </div>
557
+ <div class="flex flex-col h-[calc(100%-40px)] bg-black/40">
558
+ <div class="p-4 border-b border-cyan-900/30">
559
+ <div class="flex items-center justify-between mb-4">
560
+ <div class="text-xs text-gray-400 uppercase tracking-wider">Bandwidth Usage</div>
561
+ <div class="font-mono text-green-400">
562
+ <span id="download-speed">3.7</span> MB/s ↓ | <span id="upload-speed">1.2</span> MB/s ↑
563
+ </div>
564
+ </div>
565
+ <div class="flex gap-1 h-16">
566
+ <!-- Simulated graph bars -->
567
+ <div class="flex-1 bg-green-500/20 rounded-sm relative overflow-hidden">
568
+ <div class="absolute bottom-0 left-0 right-0 bg-green-500/60 transition-all duration-500" style="height: 45%"></div>
569
+ </div>
570
+ <div class="flex-1 bg-green-500/20 rounded-sm relative overflow-hidden">
571
+ <div class="absolute bottom-0 left-0 right-0 bg-green-500/60 transition-all duration-500" style="height: 72%"></div>
572
+ </div>
573
+ <div class="flex-1 bg-green-500/20 rounded-sm relative overflow-hidden">
574
+ <div class="absolute bottom-0 left-0 right-0 bg-green-500/60 transition-all duration-500" style="height: 30%"></div>
575
+ </div>
576
+ <div class="flex-1 bg-green-500/20 rounded-sm relative overflow-hidden">
577
+ <div class="absolute bottom-0 left-0 right-0 bg-green-500/60 transition-all duration-500" style="height: 85%"></div>
578
+ </div>
579
+ <div class="flex-1 bg-green-500/20 rounded-sm relative overflow-hidden">
580
+ <div class="absolute bottom-0 left-0 right-0 bg-green-500/60 transition-all duration-500" style="height: 55%"></div>
581
+ </div>
582
+ <div class="flex-1 bg-green-500/20 rounded-sm relative overflow-hidden">
583
+ <div class="absolute bottom-0 left-0 right-0 bg-green-500/60 transition-all duration-500" style="height: 40%"></div>
584
+ </div>
585
+ </div>
586
+ </div>
587
+
588
+ <div class="flex flex-1 overflow-hidden">
589
+ <div class="w-1/2 p-4 border-r border-cyan-900/30 overflow-auto">
590
+ <div class="text-xs text-gray-400 uppercase tracking-wider mb-3">Active Connections</div>
591
+ <div class="space-y-2 font-mono text-xs">
592
+ <div class="flex items-center justify-between p-2 glass-panel rounded hover:bg-cyan-900/20 transition cursor-pointer">
593
+ <span class="text-cyan-300">192.168.1.1:443</span>
594
+ <span class="text-green-400 text-[10px]">ENCRYPTED</span>
595
+ </div>
596
+ <div class="flex items-center justify-between p-2 glass-panel rounded hover:bg-cyan-900/20 transition cursor-pointer">
597
+ <span class="text-cyan-300">104.18.25.36:80</span>
598
+ <span class="text-yellow-400 text-[10px]">UNSECURED</span>
599
+ </div>
600
+ <div class="flex items-center justify-between p-2 glass-panel rounded hover:bg-cyan-900/20 transition cursor-pointer border border-red-500/30">
601
+ <span class="text-cyan-300">74.91.123.45:3306</span>
602
+ <span class="text-red-400 text-[10px] animate-pulse">VULNERABLE</span>
603
+ </div>
604
+ <div class="flex items-center justify-between p-2 glass-panel rounded hover:bg-cyan-900/20 transition cursor-pointer">
605
+ <span class="text-cyan-300">192.168.1.105:8080</span>
606
+ <span class="text-green-400 text-[10px]">LOCAL</span>
607
+ </div>
608
+ </div>
609
+ </div>
610
+
611
+ <div class="w-1/2 p-4 overflow-auto font-mono text-xs">
612
+ <div class="text-xs text-gray-400 uppercase tracking-wider mb-3">Network Map</div>
613
+ <div class="space-y-3">
614
+ <div class="flex items-start gap-2">
615
+ <i data-lucide="corner-down-right" class="w-4 h-4 text-cyan-600 mt-1"></i>
616
+ <div>
617
+ <div class="text-cyan-400">[YOU] 192.168.1.105</div>
618
+ <div class="flex items-start gap-2 mt-1 ml-4">
619
+ <i data-lucide="corner-down-right" class="w-4 h-4 text-cyan-600 mt-1"></i>
620
+ <div>
621
+ <div class="text-cyan-300">Router 192.168.1.1</div>
622
+ <div class="flex items-start gap-2 mt-1 ml-4 flex-col">
623
+ <div class="flex items-center gap-2">
624
+ <i data-lucide="minus" class="w-4 h-4 text-cyan-600"></i>
625
+ <span class="text-gray-400">Device 192.168.1.102 (Mobile)</span>
626
+ </div>
627
+ <div class="flex items-center gap-2">
628
+ <i data-lucide="minus" class="w-4 h-4 text-cyan-600"></i>
629
+ <span class="text-gray-400">Device 192.168.1.103 (Laptop)</span>
630
+ </div>
631
+ </div>
632
+ </div>
633
+ </div>
634
+ <div class="flex items-start gap-2 mt-1 ml-4">
635
+ <i data-lucide="corner-down-right" class="w-4 h-4 text-purple-600 mt-1"></i>
636
+ <div class="text-purple-400">[TOR Exit Node] 74.125.24.102</div>
637
+ </div>
638
+ </div>
639
+ </div>
640
+ </div>
641
+ </div>
642
  </div>
643
  </div>
644
  </div>
 
651
  <span class="text-sm font-medium text-purple-100">Xortron Browser</span>
652
  </div>
653
  <div class="flex items-center gap-2">
654
+ <span class="text-xs text-purple-400 font-mono mr-2 flex items-center gap-1">
655
+ <span class="w-2 h-2 bg-green-400 rounded-full animate-pulse"></span>
656
+ [Secure Connection]
657
+ </span>
658
  <div class="window-btn btn-min" onclick="minimizeWindow('browser')"></div>
659
  <div class="window-btn btn-max" onclick="maximizeWindow('browser')"></div>
660
  <div class="window-btn btn-close" onclick="closeWindow('browser')"></div>
661
  </div>
662
  </div>
663
  <div class="flex flex-col h-[calc(100%-40px)] bg-gray-900">
664
+ <div class="flex items-center gap-2 p-2 bg-gray-800/50 border-b border-gray-700">
665
+ <div class="flex gap-1">
666
+ <button class="p-1 hover:bg-gray-700 rounded text-gray-400" onclick="browserBack()"><i data-lucide="arrow-left" class="w-4 h-4"></i></button>
667
+ <button class="p-1 hover:bg-gray-700 rounded text-gray-400" onclick="browserForward()"><i data-lucide="arrow-right" class="w-4 h-4"></i></button>
668
+ <button class="p-1 hover:bg-gray-700 rounded text-gray-400" onclick="browserRefresh()"><i data-lucide="refresh-cw" class="w-4 h-4"></i></button>
669
+ </div>
670
+ <div class="flex-1 flex items-center gap-2 bg-gray-800 rounded-lg px-3 py-1 border border-gray-700">
671
+ <i data-lucide="lock" class="w-3 h-3 text-green-400"></i>
672
+ <input type="text" id="browser-url" value="https://darkc0de-chat.hf.space/" class="bg-transparent border-none outline-none text-sm text-gray-300 flex-1 font-mono" onkeydown="if(event.key==='Enter')browserNavigate()">
673
+ <button onclick="browserNavigate()" class="p-1 hover:bg-gray-700 rounded text-gray-400">
674
+ <i data-lucide="search" class="w-3 h-3"></i>
675
+ </button>
676
+ </div>
677
+ <div class="flex gap-1">
678
+ <button class="p-1 hover:bg-gray-700 rounded text-gray-400" onclick="browserHome()"><i data-lucide="home" class="w-4 h-4"></i></button>
679
+ </div>
680
+ </div>
681
  <div class="flex-1 relative bg-black/40 overflow-hidden">
682
  <iframe id="browser-frame" src="https://darkc0de-chat.hf.space/" class="w-full h-full border-none" sandbox="allow-scripts allow-same-origin allow-forms allow-popups"></iframe>
683
+ <div id="browser-loading" class="absolute inset-0 bg-gray-900/90 flex items-center justify-center hidden">
684
+ <div class="flex flex-col items-center gap-3">
685
+ <div class="w-12 h-12 border-4 border-purple-500/30 border-t-purple-400 rounded-full animate-spin"></div>
686
+ <span class="text-purple-400 font-mono text-sm">Loading...</span>
687
+ </div>
688
+ </div>
689
  </div>
690
  </div>
691
  </div>
 
698
  <span class="text-sm font-medium text-pink-100">Xortron-Calc</span>
699
  </div>
700
  <div class="flex items-center gap-2">
701
+ <span class="text-xs text-gray-400 font-mono mr-2">v1.0</span>
702
  <div class="window-btn btn-min" onclick="minimizeWindow('calculator')"></div>
703
  <div class="window-btn btn-max" onclick="maximizeWindow('calculator')"></div>
704
  <div class="window-btn btn-close" onclick="closeWindow('calculator')"></div>
 
709
  <div id="calc-history" class="text-xs text-gray-500 font-mono text-right mb-1 h-4"></div>
710
  <div id="calc-display" class="text-3xl text-pink-100 font-mono text-right truncate">0</div>
711
  </div>
712
+ <div class="grid grid-cols-4 gap-2 flex-1">
713
+ <button onclick="calcClear()" class="bg-red-500/20 hover:bg-red-500/30 text-red-400 rounded-lg font-semibold transition border border-red-500/30">C</button>
714
+ <button onclick="calcOperator('(')" class="glass-panel hover:bg-pink-900/20 text-pink-300 rounded-lg font-semibold transition">(</button>
715
+ <button onclick="calcOperator(')')" class="glass-panel hover:bg-pink-900/20 text-pink-300 rounded-lg font-semibold transition">)</button>
716
+ <button onclick="calcOperator('/')" class="bg-pink-500/20 hover:bg-pink-500/30 text-pink-400 rounded-lg font-semibold transition border border-pink-500/30">÷</button>
717
+
718
+ <button onclick="calcNumber('7')" class="glass-panel hover:bg-gray-700/50 text-gray-200 rounded-lg font-semibold transition text-lg">7</button>
719
+ <button onclick="calcNumber('8')" class="glass-panel hover:bg-gray-700/50 text-gray-200 rounded-lg font-semibold transition text-lg">8</button>
720
+ <button onclick="calcNumber('9')" class="glass-panel hover:bg-gray-700/50 text-gray-200 rounded-lg font-semibold transition text-lg">9</button>
721
+ <button onclick="calcOperator('*')" class="bg-pink-500/20 hover:bg-pink-500/30 text-pink-400 rounded-lg font-semibold transition border border-pink-500/30">×</button>
722
+
723
+ <button onclick="calcNumber('4')" class="glass-panel hover:bg-gray-700/50 text-gray-200 rounded-lg font-semibold transition text-lg">4</button>
724
+ <button onclick="calcNumber('5')" class="glass-panel hover:bg-gray-700/50 text-gray-200 rounded-lg font-semibold transition text-lg">5</button>
725
+ <button onclick="calcNumber('6')" class="glass-panel hover:bg-gray-700/50 text-gray-200 rounded-lg font-semibold transition text-lg">6</button>
726
+ <button onclick="calcOperator('-')" class="bg-pink-500/20 hover:bg-pink-500/30 text-pink-400 rounded-lg font-semibold transition border border-pink-500/30">-</button>
727
+
728
+ <button onclick="calcNumber('1')" class="glass-panel hover:bg-gray-700/50 text-gray-200 rounded-lg font-semibold transition text-lg">1</button>
729
+ <button onclick="calcNumber('2')" class="glass-panel hover:bg-gray-700/50 text-gray-200 rounded-lg font-semibold transition text-lg">2</button>
730
+ <button onclick="calcNumber('3')" class="glass-panel hover:bg-gray-700/50 text-gray-200 rounded-lg font-semibold transition text-lg">3</button>
731
+ <button onclick="calcOperator('+')" class="bg-pink-500/20 hover:bg-pink-500/30 text-pink-400 rounded-lg font-semibold transition border border-pink-500/30">+</button>
732
+
733
+ <button onclick="calcNumber('0')" class="glass-panel hover:bg-gray-700/50 text-gray-200 rounded-lg font-semibold transition text-lg col-span-2">0</button>
734
+ <button onclick="calcNumber('.')" class="glass-panel hover:bg-gray-700/50 text-gray-200 rounded-lg font-semibold transition text-lg">.</button>
735
+ <button onclick="calcEquals()" class="bg-pink-500 hover:bg-pink-400 text-white rounded-lg font-bold transition text-xl shadow-lg shadow-pink-500/30">=</button>
736
+ </div>
737
  </div>
738
  </div>
739
 
 
745
  <span class="text-sm font-medium text-red-100">Xortron Master Spec</span>
746
  </div>
747
  <div class="flex items-center gap-2">
748
+ <span class="text-xs text-red-400 font-mono mr-2 flex items-center gap-1">
749
+ <span class="w-2 h-2 bg-red-400 rounded-full animate-pulse"></span>
750
+ [Classified Document]
751
+ </span>
752
  <div class="window-btn btn-min" onclick="minimizeWindow('spec')"></div>
753
  <div class="window-btn btn-max" onclick="maximizeWindow('spec')"></div>
754
  <div class="window-btn btn-close" onclick="closeWindow('spec')"></div>
 
759
  </div>
760
  </div>
761
 
762
+ <!-- NEW: Xor's Favs Window -->
763
  <div id="window-favs" class="window glass-strong pointer-events-auto hidden" style="top: 8%; left: 18%; width: 400px; height: 700px; z-index: 56;">
764
  <div class="window-header flex items-center justify-between px-4 py-2 select-none" onmousedown="startDrag(event, 'window-favs')">
765
  <div class="flex items-center gap-2">
 
767
  <span class="text-sm font-medium text-yellow-100">Xor's Favorites</span>
768
  </div>
769
  <div class="flex items-center gap-2">
770
+ <span class="text-xs text-yellow-400 font-mono mr-2 flex items-center gap-1">
771
+ <span class="w-2 h-2 bg-yellow-400 rounded-full animate-pulse"></span>
772
+ [Saved Bookmarks]
773
+ </span>
774
  <div class="window-btn btn-min" onclick="minimizeWindow('favs')"></div>
775
  <div class="window-btn btn-max" onclick="maximizeWindow('favs')"></div>
776
  <div class="window-btn btn-close" onclick="closeWindow('favs')"></div>
 
781
  </div>
782
  </div>
783
 
784
+ </div>
785
+
786
+ <!-- System Alert Notification -->
787
+ <div id="system-alert" class="fixed top-4 right-4 glass-strong p-4 rounded-lg border-l-4 border-cyan-400 max-w-sm z-[1000] notification pointer-events-auto cursor-pointer" onclick="this.style.display='none'">
788
+ <div class="flex items-start gap-3">
789
+ <i data-lucide="info" class="w-5 h-5 text-cyan-400 mt-0.5"></i>
790
+ <div>
791
+ <div class="font-semibold text-cyan-100 mb-1">System Alert</div>
792
+ <div class="text-sm text-gray-300">Welcome to XortronOS. Systems online.</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
793
  </div>
794
+ <button class="ml-auto text-gray-400 hover:text-white" onclick="document.getElementById('system-alert').style.display='none'">
795
+ <i data-lucide="x" class="w-4 h-4"></i>
796
+ </button>
797
  </div>
 
798
  </div>
799
 
800
  <!-- Taskbar -->
 
824
  <button class="taskbar-icon w-10 h-10 rounded-lg flex items-center justify-center" onclick="openWindow('calculator')" id="taskbar-calculator">
825
  <i data-lucide="calculator" class="w-5 h-5 text-pink-400"></i>
826
  </button>
827
+ <!-- MASTER SPEC TASKBAR ICON -->
828
  <button class="taskbar-icon w-10 h-10 rounded-lg flex items-center justify-center" onclick="openWindow('spec')" id="taskbar-spec">
829
  <i data-lucide="book-open" class="w-5 h-5 text-red-400"></i>
830
  </button>
831
+ <!-- NEW XOR'S FAVS TASKBAR ICON -->
832
  <button class="taskbar-icon w-10 h-10 rounded-lg flex items-center justify-center" onclick="openWindow('favs')" id="taskbar-favs">
833
  <i data-lucide="star" class="w-5 h-5 text-yellow-400"></i>
834
  </button>
 
 
 
 
 
835
  </div>
836
 
837
  <div class="flex items-center gap-4 px-4 py-2 glass-panel rounded-lg">
838
+ <div class="flex items-center gap-2 text-xs font-mono">
839
+ <span class="w-2 h-2 bg-green-400 rounded-full animate-pulse"></span>
840
+ <span class="text-green-400">VPN:ON</span>
841
+ </div>
842
+ <div class="w-px h-4 bg-gray-600"></div>
843
  <div class="text-xs font-mono text-gray-300" id="clock">03:57 AM</div>
844
  <div class="text-xs text-gray-500" id="date">Wed, Mar 18</div>
845
  </div>
846
  </div>
847
 
848
+ <!-- Start Menu (Hidden by default) -->
849
  <div id="start-menu" class="fixed bottom-16 left-4 w-64 glass-strong rounded-xl border border-cyan-500/20 shadow-2xl transform translate-y-4 opacity-0 pointer-events-none transition-all duration-200 z-[998]">
850
  <div class="p-4 border-b border-cyan-900/30">
851
  <div class="flex items-center gap-3">
 
877
  <button class="w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-pink-900/20 transition text-left text-sm text-gray-300" onclick="openWindow('calculator'); toggleStartMenu()">
878
  <i data-lucide="calculator" class="w-4 h-4 text-pink-400"></i> Calculator
879
  </button>
880
+
881
+ <!-- MASTER SPEC START MENU ITEM -->
882
  <button class="w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-red-900/20 transition text-left text-sm text-gray-300" onclick="openWindow('spec'); toggleStartMenu()">
883
  <i data-lucide="book-open" class="w-4 h-4 text-red-400"></i> Master Spec
884
  </button>
885
+
886
+ <!-- NEW XOR'S FAVS START MENU ITEM -->
887
  <button class="w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-yellow-900/20 transition text-left text-sm text-gray-300" onclick="openWindow('favs'); toggleStartMenu()">
888
  <i data-lucide="star" class="w-4 h-4 text-yellow-400"></i> Xor's Favs
889
  </button>
890
 
 
 
 
 
 
891
  <div class="border-t border-cyan-900/30 my-2"></div>
892
  <a href="https://ko-fi.com/Z8Z51E5TIG" target="_blank" class="w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-orange-900/20 transition text-left text-sm text-gray-300 no-underline" onclick="toggleStartMenu()">
893
  <i data-lucide="coffee" class="w-4 h-4 text-orange-400"></i> Buy me a coffee
894
  </a>
895
+ <a href="https://huggingface.co/darkc0de" target="_blank" class="w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-yellow-900/20 transition text-left text-sm text-gray-300 no-underline" onclick="toggleStartMenu()">
896
+ <i data-lucide="smile" class="w-4 h-4 text-yellow-400"></i> Visit the Dev on HF
897
+ </a>
898
+ </div>
899
+ <div class="p-2 border-t border-cyan-900/30">
900
+ <button class="w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-red-900/20 transition text-left text-sm text-red-400">
901
+ <i data-lucide="power" class="w-4 h-4"></i> Shutdown
902
+ </button>
903
  </div>
904
  </div>
905
 
 
934
  window.style.zIndex = ++zIndexCounter;
935
  window.classList.add('active');
936
 
937
+ // Update taskbar
938
  if (taskbarBtn) taskbarBtn.classList.add('active');
939
 
940
+ // Animate opening
941
  window.style.transform = 'scale(0.9)';
942
  window.style.opacity = '0';
943
  setTimeout(() => {
 
945
  window.style.opacity = '1';
946
  }, 10);
947
  } else {
948
+ // If already open, just focus it
949
  focusWindow(windowId);
950
  }
951
+
952
  activeWindow = windowId;
953
  }
954
 
 
985
  const window = document.getElementById(`window-${windowId}`);
986
 
987
  if (window.dataset.maximized === 'true') {
988
+ // Restore
989
  window.style.width = window.dataset.prevWidth;
990
  window.style.height = window.dataset.prevHeight;
991
  window.style.top = window.dataset.prevTop;
992
  window.style.left = window.dataset.prevLeft;
993
  window.dataset.maximized = 'false';
994
  } else {
995
+ // Maximize
996
  window.dataset.prevWidth = window.style.width;
997
  window.dataset.prevHeight = window.style.height;
998
  window.dataset.prevTop = window.style.top;
 
1010
  const window = document.getElementById(`window-${windowId}`);
1011
  window.style.zIndex = ++zIndexCounter;
1012
 
1013
+ // Remove active class from all windows
1014
  document.querySelectorAll('.window').forEach(w => w.classList.remove('active'));
1015
  window.classList.add('active');
1016
  }
1017
 
1018
+ // Drag functionality
1019
  function startDrag(e, windowId) {
1020
+ if (e.target.closest('.window-btn')) return; // Don't drag if clicking buttons
1021
 
1022
  const window = document.getElementById(windowId);
1023
+ if (window.dataset.maximized === 'true') return; // Don't drag if maximized
1024
 
1025
  isDragging = true;
1026
  draggedWindow = window;
1027
 
1028
+ // TEMPORARILY DISABLE IFRAMES SO THEY DON'T TRAP THE MOUSE
1029
  document.querySelectorAll('iframe').forEach(iframe => {
1030
  iframe.style.pointerEvents = 'none';
1031
  });
 
1043
  let x = e.clientX - dragOffset.x;
1044
  let y = e.clientY - dragOffset.y;
1045
 
1046
+ // Keep within bounds
1047
  x = Math.max(0, Math.min(x, window.innerWidth - draggedWindow.offsetWidth));
1048
  y = Math.max(0, Math.min(y, window.innerHeight - draggedWindow.offsetHeight - 56));
1049
 
 
1055
  isDragging = false;
1056
  draggedWindow = null;
1057
 
1058
+ // RE-ENABLE IFRAMES
1059
  document.querySelectorAll('iframe').forEach(iframe => {
1060
  iframe.style.pointerEvents = 'auto';
1061
  });
1062
  });
1063
 
1064
+ // Add click handlers to windows for focus
1065
  document.querySelectorAll('.window').forEach(window => {
1066
  window.addEventListener('mousedown', () => {
1067
  const id = window.id.replace('window-', '');
 
1069
  });
1070
  });
1071
 
1072
+ // Start Menu Toggle
1073
  function toggleStartMenu() {
1074
  const menu = document.getElementById('start-menu');
1075
  if (menu.classList.contains('opacity-0')) {
 
1079
  }
1080
  }
1081
 
1082
+ // Close start menu when clicking outside
1083
  document.addEventListener('click', (e) => {
1084
  const menu = document.getElementById('start-menu');
1085
  const btn = document.querySelector('[onclick="toggleStartMenu()"]');
1086
 
1087
+ if (!menu.contains(e.target) && !btn.contains(e.target)) {
1088
  menu.classList.add('opacity-0', 'pointer-events-none', 'translate-y-4');
1089
  }
1090
  });
1091
 
1092
+ // Simulate network traffic
1093
+ setInterval(() => {
1094
+ const download = (Math.random() * 5 + 2).toFixed(1);
1095
+ const upload = (Math.random() * 2 + 0.5).toFixed(1);
1096
+ document.getElementById('download-speed').textContent = download;
1097
+ document.getElementById('upload-speed').textContent = upload;
1098
+ }, 3000);
1099
+
1100
+ // Update last login time
1101
+ const now = new Date();
1102
+ const loginStr = now.toLocaleDateString() + ', ' + now.toLocaleTimeString();
1103
+ document.getElementById('last-login').textContent = loginStr;
1104
+
1105
+ // Auto-open browser on launch
1106
+ setTimeout(() => {
1107
+ openWindow('browser');
1108
+ }, 500);
1109
+
1110
+ // Desktop icon selection
1111
  document.querySelectorAll('.desktop-icon').forEach(icon => {
1112
  icon.addEventListener('click', (e) => {
1113
  e.stopPropagation();
 
1120
  document.querySelectorAll('.desktop-icon').forEach(i => i.classList.remove('selected'));
1121
  });
1122
 
1123
+ // Mobile touch support for dragging
1124
+ let touchStartX, touchStartY;
1125
+
1126
+ document.querySelectorAll('.window-header').forEach(header => {
1127
+ header.addEventListener('touchstart', (e) => {
1128
+ const touch = e.touches[0];
1129
+ const windowId = header.parentElement.id;
1130
+ if (e.target.closest('.window-btn')) return;
1131
+
1132
+ const window = document.getElementById(windowId);
1133
+ if (window.dataset.maximized === 'true') return;
1134
+
1135
+ const rect = window.getBoundingClientRect();
1136
+ touchStartX = touch.clientX - rect.left;
1137
+ touchStartY = touch.clientY - rect.top;
1138
+
1139
+ // TEMPORARILY DISABLE IFRAMES SO THEY DON'T TRAP THE MOUSE
1140
+ document.querySelectorAll('iframe').forEach(iframe => {
1141
+ iframe.style.pointerEvents = 'none';
1142
+ });
1143
+
1144
+ focusWindow(windowId.replace('window-', ''));
1145
+ }, {passive: false});
1146
+
1147
+ header.addEventListener('touchmove', (e) => {
1148
+ if (!touchStartX) return;
1149
+ e.preventDefault();
1150
+
1151
+ const touch = e.touches[0];
1152
+ const windowId = header.parentElement.id;
1153
+ const window = document.getElementById(windowId);
1154
+
1155
+ let x = touch.clientX - touchStartX;
1156
+ let y = touch.clientY - touchStartY;
1157
+
1158
+ x = Math.max(0, Math.min(x, window.innerWidth - window.offsetWidth));
1159
+ y = Math.max(0, Math.min(y, window.innerHeight - window.offsetHeight - 56));
1160
+
1161
+ window.style.left = x + 'px';
1162
+ window.style.top = y + 'px';
1163
+ }, {passive: false});
1164
+
1165
+ header.addEventListener('touchend', () => {
1166
+ touchStartX = null;
1167
+ touchStartY = null;
1168
+
1169
+ // RE-ENABLE IFRAMES
1170
+ document.querySelectorAll('iframe').forEach(iframe => {
1171
+ iframe.style.pointerEvents = 'auto';
1172
+ });
1173
+ });
1174
+ });
1175
+
1176
+ // Prevent zoom on double tap for mobile
1177
+ let lastTouchEnd = 0;
1178
+ document.addEventListener('touchend', (e) => {
1179
+ const now = Date.now();
1180
+ if (now - lastTouchEnd <= 300) {
1181
+ e.preventDefault();
1182
+ }
1183
+ lastTouchEnd = now;
1184
+ }, false);
1185
 
1186
+ // Browser functionality
1187
+ let browserHistory = ['https://darkc0de-chat.hf.space/'];
1188
+ let browserHistoryIndex = 0;
1189
+
1190
+ function browserNavigate() {
1191
+ const url = document.getElementById('browser-url').value;
1192
+ const frame = document.getElementById('browser-frame');
1193
+ const loading = document.getElementById('browser-loading');
1194
+
1195
+ if (!url) return;
 
 
 
 
 
 
1196
 
1197
+ let fullUrl = url;
1198
+ if (!url.startsWith('http://') && !url.startsWith('https://')) {
1199
+ fullUrl = 'https://' + url;
1200
+ }
 
 
 
 
 
1201
 
1202
+ loading.classList.remove('hidden');
1203
+ frame.src = fullUrl;
1204
 
1205
+ // Update history
1206
+ if (browserHistoryIndex < browserHistory.length - 1) {
1207
+ browserHistory = browserHistory.slice(0, browserHistoryIndex + 1);
1208
+ }
1209
+ browserHistory.push(fullUrl);
1210
+ browserHistoryIndex++;
1211
+
1212
+ setTimeout(() => {
1213
+ loading.classList.add('hidden');
1214
+ }, 1000);
1215
  }
1216
 
1217
+ function browserBack() {
1218
+ if (browserHistoryIndex > 0) {
1219
+ browserHistoryIndex--;
1220
+ const url = browserHistory[browserHistoryIndex];
1221
+ document.getElementById('browser-url').value = url;
1222
+ document.getElementById('browser-frame').src = url;
1223
+ }
1224
  }
1225
 
1226
+ function browserForward() {
1227
+ if (browserHistoryIndex < browserHistory.length - 1) {
1228
+ browserHistoryIndex++;
1229
+ const url = browserHistory[browserHistoryIndex];
1230
+ document.getElementById('browser-url').value = url;
1231
+ document.getElementById('browser-frame').src = url;
 
 
1232
  }
1233
+ }
1234
 
1235
+ function browserRefresh() {
1236
+ const frame = document.getElementById('browser-frame');
1237
+ const loading = document.getElementById('browser-loading');
1238
+ loading.classList.remove('hidden');
1239
+ frame.src = frame.src;
1240
+ setTimeout(() => {
1241
+ loading.classList.add('hidden');
1242
+ }, 800);
1243
+ }
1244
 
1245
+ function browserHome() {
1246
+ document.getElementById('browser-url').value = 'https://darkc0de-chat.hf.space/';
1247
+ browserNavigate();
1248
+ }
1249
 
1250
+ // Calculator functionality
1251
+ let calcCurrent = '';
1252
+ let calcPrevious = '';
1253
+ let calcOperation = null;
1254
+ let calcResetNext = false;
 
 
 
1255
 
1256
+ function calcUpdateDisplay() {
1257
+ document.getElementById('calc-display').textContent = calcCurrent || '0';
1258
+ document.getElementById('calc-history').textContent = calcPrevious + (calcOperation || '');
1259
  }
1260
 
1261
+ function calcNumber(num) {
1262
+ if (calcResetNext) {
1263
+ calcCurrent = '';
1264
+ calcResetNext = false;
 
 
 
 
 
 
 
1265
  }
1266
+ if (num === '.' && calcCurrent.includes('.')) return;
1267
+ calcCurrent += num;
1268
+ calcUpdateDisplay();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1269
  }
1270
 
1271
+ function calcOperator(op) {
1272
+ calcCurrent += op;
1273
+ calcUpdateDisplay();
 
 
 
 
 
 
1274
  }
1275
 
1276
+ function calcClear() {
1277
+ calcCurrent = '';
1278
+ calcPrevious = '';
1279
+ calcOperation = null;
1280
+ calcResetNext = false;
1281
+ calcUpdateDisplay();
1282
+ }
1283
 
1284
+ function calcEquals() {
1285
+ try {
1286
+ if (!calcCurrent) return;
1287
+ const result = eval(calcCurrent);
1288
+ calcPrevious = calcCurrent;
1289
+ calcCurrent = String(result);
1290
+ calcResetNext = true;
1291
+ calcUpdateDisplay();
1292
+ } catch (e) {
1293
+ calcCurrent = 'Error';
1294
+ calcResetNext = true;
1295
+ calcUpdateDisplay();
1296
  }
1297
+ }
1298
 
1299
+ // Keyboard support for calculator when window is active
1300
+ document.addEventListener('keydown', (e) => {
1301
+ const calcWindow = document.getElementById('window-calculator');
1302
+ if (calcWindow.classList.contains('hidden')) return;
1303
+ if (!calcWindow.classList.contains('active')) return;
1304
+
1305
+ if (e.key >= '0' && e.key <= '9') calcNumber(e.key);
1306
+ if (e.key === '.') calcNumber('.');
1307
+ if (e.key === '+' || e.key === '-' || e.key === '*' || e.key === '/' || e.key === '(' || e.key === ')') calcOperator(e.key);
1308
+ if (e.key === 'Enter') calcEquals();
1309
+ if (e.key === 'Escape') calcClear();
1310
+ if (e.key === 'Backspace') {
1311
+ calcCurrent = calcCurrent.slice(0, -1);
1312
+ calcUpdateDisplay();
1313
+ }
1314
  });
 
1315
  </script>
1316
  </body>
1317
  </html>