Spaces:
Running
Running
File size: 38,559 Bytes
a2439c9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DevInsight - Advanced Debugging Tool</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<script>
tailwind.config = {
theme: {
extend: {
colors: {
debug: {
primary: '#4F46E5',
secondary: '#6366F1',
accent: '#8B5CF6',
dark: '#1E293B',
light: '#F1F5F9'
}
}
}
}
}
</script>
<style>
.graph-bar {
transition: height 0.3s ease;
}
.console-log-item:hover {
background-color: rgba(99, 102, 241, 0.1);
}
.network-row:hover {
background-color: rgba(99, 102, 241, 0.05);
}
.memory-chart {
transition: width 0.5s ease;
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.resize-handle {
transition: background-color 0.2s;
}
.resize-handle:hover {
background-color: #6366F1;
}
.call-stack-item {
transition: transform 0.2s;
}
.call-stack-item:hover {
transform: translateX(5px);
}
</style>
</head>
<body class="bg-debug-light text-debug-dark font-sans">
<!-- Header -->
<header class="bg-debug-dark text-white py-4 px-6 flex justify-between items-center">
<div class="flex items-center space-x-3">
<i class="fas fa-bug text-debug-secondary text-2xl"></i>
<h1 class="text-xl font-bold">DevInsight Debugger</h1>
</div>
<div class="flex items-center space-x-4">
<button id="record-btn" class="bg-debug-primary hover:bg-debug-secondary px-4 py-2 rounded-md flex items-center">
<i class="fas fa-record-vinyl mr-2"></i> Start Recording
</button>
<button id="export-btn" class="border border-debug-secondary text-debug-secondary hover:bg-debug-secondary hover:text-white px-4 py-2 rounded-md flex items-center">
<i class="fas fa-file-export mr-2"></i> Export Session
</button>
</div>
</header>
<!-- Main Content -->
<div class="flex flex-col md:flex-row h-[calc(100vh-120px)]">
<!-- Left Panel - Controls -->
<div class="w-full md:w-64 bg-white p-4 border-r border-gray-200">
<div class="mb-6">
<h2 class="font-semibold text-lg mb-3 text-debug-primary">Execution Control</h2>
<div class="grid grid-cols-2 gap-2">
<button class="bg-debug-primary text-white py-2 rounded-md hover:bg-debug-secondary">
<i class="fas fa-play mr-1"></i> Start
</button>
<button class="bg-gray-200 py-2 rounded-md hover:bg-gray-300">
<i class="fas fa-pause mr-1"></i> Pause
</button>
<button class="bg-gray-200 py-2 rounded-md hover:bg-gray-300">
<i class="fas fa-step-forward mr-1"></i> Step Over
</button>
<button class="bg-gray-200 py-2 rounded-md hover:bg-gray-300">
<i class="fas fa-level-down-alt mr-1"></i> Step Into
</button>
<button class="bg-gray-200 py-2 rounded-md hover:bg-gray-300">
<i class="fas fa-level-up-alt mr-1"></i> Step Out
</button>
<button class="bg-red-500 text-white py-2 rounded-md hover:bg-red-600">
<i class="fas fa-stop mr-1"></i> Stop
</button>
</div>
</div>
<div class="mb-6">
<h2 class="font-semibold text-lg mb-3 text-debug-primary">Breakpoints</h2>
<div class="space-y-2">
<div class="flex items-center justify-between bg-gray-100 p-2 rounded">
<span>app.js:45</span>
<button class="text-red-500 hover:text-red-700">
<i class="fas fa-times"></i>
</button>
</div>
<div class="flex items-center justify-between bg-gray-100 p-2 rounded">
<span>utils.js:12</span>
<button class="text-red-500 hover:text-red-700">
<i class="fas fa-times"></i>
</button>
</div>
<button class="w-full bg-debug-secondary text-white py-1 rounded-md hover:bg-debug-primary">
<i class="fas fa-plus mr-1"></i> Add Breakpoint
</button>
</div>
</div>
<div>
<h2 class="font-semibold text-lg mb-3 text-debug-primary">Call Stack</h2>
<div class="space-y-2 max-h-40 overflow-y-auto">
<div class="call-stack-item bg-gray-100 p-2 rounded text-sm">
<div class="font-mono">calculateTotal (cart.js:32)</div>
<div class="text-xs text-gray-500">Local variables: 3</div>
</div>
<div class="call-stack-item bg-gray-100 p-2 rounded text-sm">
<div class="font-mono">updateCart (main.js:18)</div>
<div class="text-xs text-gray-500">Local variables: 2</div>
</div>
<div class="call-stack-item bg-gray-100 p-2 rounded text-sm">
<div class="font-mono">onClick (button.js:7)</div>
<div class="text-xs text-gray-500">Local variables: 1</div>
</div>
</div>
</div>
</div>
<!-- Main Debugging Area -->
<div class="flex-1 flex flex-col">
<!-- Tab Navigation -->
<div class="bg-white border-b border-gray-200">
<nav class="flex flex-wrap">
<button data-tab="performance" class="tab-btn active px-4 py-3 font-medium text-debug-primary border-b-2 border-debug-primary">
<i class="fas fa-tachometer-alt mr-2"></i> Performance
</button>
<button data-tab="memory" class="tab-btn px-4 py-3 font-medium text-gray-600 hover:text-debug-primary">
<i class="fas fa-memory mr-2"></i> Memory
</button>
<button data-tab="network" class="tab-btn px-4 py-3 font-medium text-gray-600 hover:text-debug-primary">
<i class="fas fa-network-wired mr-2"></i> Network
</button>
<button data-tab="console" class="tab-btn px-4 py-3 font-medium text-gray-600 hover:text-debug-primary">
<i class="fas fa-terminal mr-2"></i> Console
</button>
<button data-tab="variables" class="tab-btn px-4 py-3 font-medium text-gray-600 hover:text-debug-primary">
<i class="fas fa-code mr-2"></i> Variables
</button>
</nav>
</div>
<!-- Tab Content -->
<div class="flex-1 overflow-auto">
<!-- Performance Tab -->
<div id="performance" class="tab-content active p-6">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
<div class="bg-white p-4 rounded-lg shadow">
<h3 class="font-semibold mb-3 text-debug-primary">CPU Usage</h3>
<div class="h-40 flex items-end space-x-1" id="cpu-usage-graph">
<!-- Graph bars will be generated by JS -->
</div>
</div>
<div class="bg-white p-4 rounded-lg shadow">
<h3 class="font-semibold mb-3 text-debug-primary">Frame Rate</h3>
<div class="flex items-center justify-center">
<div class="text-4xl font-bold text-debug-primary">60</div>
<div class="ml-2 text-gray-500">FPS</div>
</div>
<div class="mt-4 h-24" id="fps-graph">
<!-- FPS graph will be generated by JS -->
</div>
</div>
</div>
<div class="bg-white p-4 rounded-lg shadow">
<h3 class="font-semibold mb-3 text-debug-primary">Function Timing</h3>
<table class="w-full">
<thead>
<tr class="bg-gray-100">
<th class="text-left p-2">Function</th>
<th class="text-left p-2">Calls</th>
<th class="text-left p-2">Total Time</th>
<th class="text-left p-2">Avg. Time</th>
</tr>
</thead>
<tbody>
<tr class="border-b border-gray-200">
<td class="p-2 font-mono">renderComponent</td>
<td class="p-2">142</td>
<td class="p-2">1,240ms</td>
<td class="p-2">8.7ms</td>
</tr>
<tr class="border-b border-gray-200">
<td class="p-2 font-mono">fetchData</td>
<td class="p-2">24</td>
<td class="p-2">980ms</td>
<td class="p-2">40.8ms</td>
</tr>
<tr class="border-b border-gray-200">
<td class="p-2 font-mono">calculateLayout</td>
<td class="p-2">18</td>
<td class="p-2">420ms</td>
<td class="p-2">23.3ms</td>
</tr>
<tr>
<td class="p-2 font-mono">handleClick</td>
<td class="p-2">56</td>
<td class="p-2">320ms</td>
<td class="p-2">5.7ms</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Memory Tab -->
<div id="memory" class="tab-content p-6">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
<div class="bg-white p-4 rounded-lg shadow">
<h3 class="font-semibold mb-3 text-debug-primary">Memory Usage</h3>
<div class="flex items-center mb-4">
<div class="text-3xl font-bold text-debug-primary">84.2</div>
<div class="ml-2 text-gray-500">MB / 256 MB</div>
</div>
<div class="w-full bg-gray-200 rounded-full h-4">
<div class="memory-chart bg-debug-primary h-4 rounded-full" style="width: 33%"></div>
</div>
<div class="flex justify-between text-xs text-gray-500 mt-1">
<span>0 MB</span>
<span>128 MB</span>
<span>256 MB</span>
</div>
</div>
<div class="bg-white p-4 rounded-lg shadow">
<h3 class="font-semibold mb-3 text-debug-primary">Heap Allocation</h3>
<div class="h-40 flex items-end space-x-1" id="heap-graph">
<!-- Graph bars will be generated by JS -->
</div>
</div>
</div>
<div class="bg-white p-4 rounded-lg shadow">
<h3 class="font-semibold mb-3 text-debug-primary">Object Allocation</h3>
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
<div class="bg-gray-100 p-3 rounded">
<div class="text-debug-primary font-bold">1,248</div>
<div class="text-sm text-gray-600">DOM Nodes</div>
</div>
<div class="bg-gray-100 p-3 rounded">
<div class="text-debug-primary font-bold">4,812</div>
<div class="text-sm text-gray-600">Event Listeners</div>
</div>
<div class="bg-gray-100 p-3 rounded">
<div class="text-debug-primary font-bold">12,482</div>
<div class="text-sm text-gray-600">Objects</div>
</div>
<div class="bg-gray-100 p-3 rounded">
<div class="text-debug-primary font-bold">2,147</div>
<div class="text-sm text-gray-600">Closures</div>
</div>
</div>
</div>
</div>
<!-- Network Tab -->
<div id="network" class="tab-content p-6">
<div class="mb-4 flex justify-between items-center">
<div class="flex items-center">
<button class="bg-debug-primary text-white px-3 py-1 rounded mr-2">
<i class="fas fa-sync"></i>
</button>
<div class="relative">
<input type="text" placeholder="Filter requests..." class="border border-gray-300 rounded pl-8 pr-3 py-1">
<i class="fas fa-search absolute left-2 top-2 text-gray-400"></i>
</div>
</div>
<div class="text-sm">
<span class="font-semibold">Requests:</span> 24
<span class="mx-2">|</span>
<span class="font-semibold">Transferred:</span> 1.8 MB
</div>
</div>
<div class="bg-white rounded-lg shadow overflow-hidden">
<table class="w-full">
<thead class="bg-gray-100">
<tr>
<th class="text-left p-3">Method</th>
<th class="text-left p-3">Status</th>
<th class="text-left p-3">URL</th>
<th class="text-left p-3">Size</th>
<th class="text-left p-3">Time</th>
<th class="text-left p-3">Timeline</th>
</tr>
</thead>
<tbody>
<tr class="network-row border-b border-gray-200 hover:bg-gray-50">
<td class="p-3"><span class="bg-green-100 text-green-800 px-2 py-1 rounded text-xs">GET</span></td>
<td class="p-3"><span class="bg-green-100 text-green-800 px-2 py-1 rounded text-xs">200</span></td>
<td class="p-3 font-mono text-sm">/api/products</td>
<td class="p-3">42.8 KB</td>
<td class="p-3">128 ms</td>
<td class="p-3">
<div class="w-32 h-2 bg-gray-200 rounded-full overflow-hidden">
<div class="bg-debug-primary h-full" style="width: 80%"></div>
</div>
</td>
</tr>
<tr class="network-row border-b border-gray-200 hover:bg-gray-50">
<td class="p-3"><span class="bg-green-100 text-green-800 px-2 py-1 rounded text-xs">GET</span></td>
<td class="p-3"><span class="bg-green-100 text-green-800 px-2 py-1 rounded text-xs">200</span></td>
<td class="p-3 font-mono text-sm">/static/css/main.css</td>
<td class="p-3">18.2 KB</td>
<td class="p-3">42 ms</td>
<td class="p-3">
<div class="w-32 h-2 bg-gray-200 rounded-full overflow-hidden">
<div class="bg-debug-primary h-full" style="width: 30%"></div>
</div>
</td>
</tr>
<tr class="network-row border-b border-gray-200 hover:bg-gray-50">
<td class="p-3"><span class="bg-blue-100 text-blue-800 px-2 py-1 rounded text-xs">POST</span></td>
<td class="p-3"><span class="bg-green-100 text-green-800 px-2 py-1 rounded text-xs">201</span></td>
<td class="p-3 font-mono text-sm">/api/cart</td>
<td class="p-3">1.2 KB</td>
<td class="p-3">86 ms</td>
<td class="p-3">
<div class="w-32 h-2 bg-gray-200 rounded-full overflow-hidden">
<div class="bg-debug-primary h-full" style="width: 60%"></div>
</div>
</td>
</tr>
<tr class="network-row border-b border-gray-200 hover:bg-gray-50">
<td class="p-3"><span class="bg-green-100 text-green-800 px-2 py-1 rounded text-xs">GET</span></td>
<td class="p-3"><span class="bg-yellow-100 text-yellow-800 px-2 py-1 rounded text-xs">304</span></td>
<td class="p-3 font-mono text-sm">/static/img/logo.png</td>
<td class="p-3">0 B</td>
<td class="p-3">12 ms</td>
<td class="p-3">
<div class="w-32 h-2 bg-gray-200 rounded-full overflow-hidden">
<div class="bg-debug-primary h-full" style="width: 10%"></div>
</div>
</td>
</tr>
<tr class="network-row hover:bg-gray-50">
<td class="p-3"><span class="bg-red-100 text-red-800 px-2 py-1 rounded text-xs">GET</span></td>
<td class="p-3"><span class="bg-red-100 text-red-800 px-2 py-1 rounded text-xs">404</span></td>
<td class="p-3 font-mono text-sm">/api/user/avatar</td>
<td class="p-3">0 B</td>
<td class="p-3">64 ms</td>
<td class="p-3">
<div class="w-32 h-2 bg-gray-200 rounded-full overflow-hidden">
<div class="bg-red-500 h-full" style="width: 50%"></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Console Tab -->
<div id="console" class="tab-content flex flex-col h-full p-0">
<div class="flex-1 overflow-auto bg-gray-900 text-gray-200 p-4 font-mono text-sm" id="console-output">
<div class="console-log-item py-1 px-2 border-l-2 border-blue-500">
<span class="text-blue-400">[LOG]</span> Application initialized
</div>
<div class="console-log-item py-1 px-2 border-l-2 border-green-500">
<span class="text-green-400">[INFO]</span> Connected to API server
</div>
<div class="console-log-item py-1 px-2 border-l-2 border-yellow-500">
<span class="text-yellow-400">[WARN]</span> Deprecated function used: oldFormat()
</div>
<div class="console-log-item py-1 px-2 border-l-2 border-red-500">
<span class="text-red-400">[ERROR]</span> Failed to load resource: /api/config
</div>
<div class="console-log-item py-1 px-2 border-l-2 border-blue-500">
<span class="text-blue-400">[LOG]</span> User session created: ID-2389
</div>
<div class="console-log-item py-1 px-2">
<span class="text-purple-400">></span> let x = 10;
</div>
<div class="console-log-item py-1 px-2">
<span class="text-purple-400">></span> console.log(x * 2);
</div>
<div class="console-log-item py-1 px-2 border-l-2 border-blue-500">
20
</div>
</div>
<div class="border-t border-gray-700 bg-gray-800 p-2">
<div class="flex">
<div class="text-purple-400 mr-2 pt-1">></div>
<input type="text" class="flex-1 bg-gray-800 text-white outline-none font-mono" placeholder="Enter debug command..." id="console-input">
<button class="ml-2 bg-debug-primary text-white px-3 py-1 rounded">
<i class="fas fa-arrow-right"></i>
</button>
</div>
<div class="text-xs text-gray-500 mt-1">
<span class="mr-3">↑↓ History</span>
<span>Ctrl+L Clear console</span>
</div>
</div>
</div>
<!-- Variables Tab -->
<div id="variables" class="tab-content p-6">
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
<div class="bg-white rounded-lg shadow">
<div class="border-b border-gray-200 p-3 font-semibold text-debug-primary">
<i class="fas fa-globe-americas mr-2"></i>Global Variables
</div>
<div class="p-3">
<div class="variable-item mb-2">
<div class="flex justify-between items-center cursor-pointer">
<div class="font-mono">window</div>
<i class="fas fa-chevron-down text-gray-400"></i>
</div>
<div class="ml-4 mt-1 text-sm hidden">
<div>location: "https://app.example.com"</div>
<div>innerWidth: 1280</div>
</div>
</div>
<div class="variable-item mb-2">
<div class="flex justify-between items-center cursor-pointer">
<div class="font-mono">document</div>
<i class="fas fa-chevron-down text-gray-400"></i>
</div>
</div>
<div class="variable-item mb-2">
<div class="flex justify-between items-center cursor-pointer">
<div class="font-mono">appConfig</div>
<i class="fas fa-chevron-down text-gray-400"></i>
</div>
<div class="ml-4 mt-1 text-sm hidden">
<div>theme: "dark"</div>
<div>version: "2.3.1"</div>
<div>debugMode: true</div>
</div>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow">
<div class="border-b border-gray-200 p-3 font-semibold text-debug-primary">
<i class="fas fa-cube mr-2"></i>Local Variables
</div>
<div class="p-3">
<div class="variable-item mb-2">
<div class="flex justify-between items-center cursor-pointer">
<div class="font-mono">currentUser</div>
<i class="fas fa-chevron-down text-gray-400"></i>
</div>
<div class="ml-4 mt-1 text-sm hidden">
<div>id: "usr-2389"</div>
<div>name: "Alex Johnson"</div>
<div>email: "alex@example.com"</div>
<div>role: "admin"</div>
</div>
</div>
<div class="variable-item mb-2">
<div class="flex justify-between items-center cursor-pointer">
<div class="font-mono">cart</div>
<i class="fas fa-chevron-down text-gray-400"></i>
</div>
<div class="ml-4 mt-1 text-sm hidden">
<div>items: Array(3)</div>
<div>total: 149.97</div>
<div>currency: "USD"</div>
</div>
</div>
<div class="variable-item mb-2">
<div class="flex justify-between items-center cursor-pointer">
<div class="font-mono">isLoading</div>
<div class="text-debug-primary font-mono">false</div>
</div>
</div>
<div class="variable-item mb-2">
<div class="flex justify-between items-center cursor-pointer">
<div class="font-mono">apiEndpoint</div>
<div class="text-debug-primary font-mono">"https://api.example.com/v2"</div>
</div>
</div>
</div>
</div>
</div>
<div class="mt-6 bg-white rounded-lg shadow">
<div class="border-b border-gray-200 p-3 font-semibold text-debug-primary">
<i class="fas fa-binoculars mr-2"></i>Watch Expressions
</div>
<div class="p-3">
<div class="flex mb-2">
<input type="text" class="flex-1 border border-gray-300 rounded-l p-2 font-mono" value="cart.items.length">
<button class="bg-debug-primary text-white px-4 rounded-r">
<i class="fas fa-plus"></i>
</button>
</div>
<table class="w-full">
<tr class="border-b border-gray-200">
<td class="p-2 font-mono">cart.total > 100</td>
<td class="p-2 text-green-500 font-mono">true</td>
<td class="p-2 w-10">
<button class="text-red-500">
<i class="fas fa-times"></i>
</button>
</td>
</tr>
<tr class="border-b border-gray-200">
<td class="p-2 font-mono">currentUser.role === 'admin'</td>
<td class="p-2 text-green-500 font-mono">true</td>
<td class="p-2 w-10">
<button class="text-red-500">
<i class="fas fa-times"></i>
</button>
</td>
</tr>
<tr>
<td class="p-2 font-mono">window.innerWidth</td>
<td class="p-2 font-mono">1280</td>
<td class="p-2 w-10">
<button class="text-red-500">
<i class="fas fa-times"></i>
</button>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
// Tab switching functionality
document.querySelectorAll('.tab-btn').forEach(button => {
button.addEventListener('click', () => {
// Remove active class from all buttons and content
document.querySelectorAll('.tab-btn').forEach(btn => btn.classList.remove('active', 'text-debug-primary', 'border-debug-primary'));
document.querySelectorAll('.tab-btn').forEach(btn => btn.classList.add('text-gray-600'));
document.querySelectorAll('.tab-content').forEach(content => content.classList.remove('active'));
// Add active class to clicked button
button.classList.add('active', 'text-debug-primary', 'border-debug-primary');
button.classList.remove('text-gray-600');
// Show corresponding content
const tabId = button.getAttribute('data-tab');
document.getElementById(tabId).classList.add('active');
});
});
// Generate CPU usage graph
const cpuGraph = document.getElementById('cpu-usage-graph');
for (let i = 0; i < 40; i++) {
const bar = document.createElement('div');
bar.className = 'graph-bar bg-debug-primary';
bar.style.height = `${Math.floor(Math.random() * 100) + 20}px`;
bar.style.width = '8px';
bar.style.marginRight = '2px';
cpuGraph.appendChild(bar);
}
// Generate heap allocation graph
const heapGraph = document.getElementById('heap-graph');
for (let i = 0; i < 30; i++) {
const bar = document.createElement('div');
bar.className = 'graph-bar bg-debug-accent';
bar.style.height = `${Math.floor(Math.random() * 80) + 10}px`;
bar.style.width = '10px';
bar.style.marginRight = '3px';
heapGraph.appendChild(bar);
}
// Console input handling
const consoleInput = document.getElementById('console-input');
const consoleOutput = document.getElementById('console-output');
consoleInput.addEventListener('keypress', (e) => {
if (e.key === 'Enter') {
const command = consoleInput.value.trim();
if (command) {
// Add command to console
const commandElement = document.createElement('div');
commandElement.className = 'console-log-item py-1 px-2';
commandElement.innerHTML = `<span class="text-purple-400">></span> ${command}`;
consoleOutput.appendChild(commandElement);
// Clear input
consoleInput.value = '';
// Scroll to bottom
consoleOutput.scrollTop = consoleOutput.scrollHeight;
}
}
});
// Variable inspection toggle
document.querySelectorAll('.variable-item').forEach(item => {
const header = item.querySelector('.flex');
const content = item.querySelector('.hidden');
if (content) {
header.addEventListener('click', () => {
content.classList.toggle('hidden');
const icon = header.querySelector('i');
icon.classList.toggle('fa-chevron-down');
icon.classList.toggle('fa-chevron-up');
});
}
});
// Record button toggle
const recordBtn = document.getElementById('record-btn');
recordBtn.addEventListener('click', () => {
const isRecording = recordBtn.classList.contains('bg-debug-primary');
if (isRecording) {
recordBtn.classList.remove('bg-debug-primary');
recordBtn.classList.add('bg-red-500');
recordBtn.innerHTML = '<i class="fas fa-stop mr-2"></i> Stop Recording';
} else {
recordBtn.classList.add('bg-debug-primary');
recordBtn.classList.remove('bg-red-500');
recordBtn.innerHTML = '<i class="fas fa-record-vinyl mr-2"></i> Start Recording';
}
});
// Export button functionality
document.getElementById('export-btn').addEventListener('click', () => {
alert('Debug session exported successfully!');
});
// Simulate performance data updates
setInterval(() => {
// Update CPU usage graph
const bars = cpuGraph.querySelectorAll('.graph-bar');
bars.forEach(bar => {
const currentHeight = parseInt(bar.style.height);
const newHeight = Math.max(20, Math.min(120, currentHeight + (Math.random() * 40 - 20)));
bar.style.height = `${newHeight}px`;
});
// Update memory chart
const memoryChart = document.querySelector('.memory-chart');
const currentWidth = parseInt(memoryChart.style.width);
const newWidth = Math.max(10, Math.min(90, currentWidth + (Math.random() * 10 - 5)));
memoryChart.style.width = `${newWidth}%`;
// Update memory text
const memoryText = document.querySelector('.text-3xl');
const currentMem = parseFloat(memoryText.textContent);
const newMem = Math.max(50, Math.min(240, currentMem + (Math.random() * 4 - 2)));
memoryText.textContent = newMem.toFixed(1);
}, 2000);
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Darkxx91/devinsight-debugger" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |