make the bug anlysis and fixed .js and doccumentation and comment together only 4 divs in a box
Browse files- index.html +95 -133
index.html
CHANGED
|
@@ -273,55 +273,113 @@ tailwind.config = {
|
|
| 273 |
<!-- Interactive Code Section -->
|
| 274 |
<div class="py-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto">
|
| 275 |
<div class="grid grid-cols-1 gap-8">
|
| 276 |
-
<!--
|
| 277 |
-
<div class="grid grid-cols-1
|
| 278 |
-
<!-- Bug
|
| 279 |
-
<div class="
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
<div class="
|
| 285 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 286 |
</div>
|
| 287 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 288 |
</div>
|
| 289 |
-
<button onclick="downloadBugAnalysis()" class="text-gray-400 hover:text-white p-1 rounded hover:bg-gray-700/50 transition-all duration-200" title="Download Analysis">
|
| 290 |
-
<i data-feather="download" class="w-4 h-4"></i>
|
| 291 |
-
</button>
|
| 292 |
</div>
|
| 293 |
-
|
| 294 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 295 |
</div>
|
| 296 |
</div>
|
| 297 |
|
| 298 |
-
<!--
|
| 299 |
-
<div class="
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
<div class="
|
| 305 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 306 |
</div>
|
| 307 |
-
<
|
| 308 |
-
|
| 309 |
-
<div class="flex space-x-2">
|
| 310 |
-
<button onclick="copyFixedCode()" class="text-gray-400 hover:text-white p-1 rounded hover:bg-gray-700/50 transition-all duration-200" title="Copy Code">
|
| 311 |
-
<i data-feather="copy" class="w-4 h-4"></i>
|
| 312 |
</button>
|
| 313 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 314 |
<i data-feather="download" class="w-4 h-4"></i>
|
| 315 |
</button>
|
| 316 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 317 |
</div>
|
| 318 |
-
<pre id="fixedCode" class="text-gray-300 text-sm font-mono h-64 overflow-auto bg-gray-800 p-4 rounded">
|
| 319 |
-
<span class="text-gray-500">// Fixed code will appear here after analysis</span></pre>
|
| 320 |
-
<button onclick="applyFix()" class="group relative mt-4 w-full bg-gray-800/50 hover:bg-gray-700/70 border border-gray-700 hover:border-green-500 text-white py-3 px-4 rounded-lg font-medium flex items-center justify-center transition-all duration-200 shadow-md hover:shadow-green-500/20">
|
| 321 |
-
<div class="absolute inset-0 bg-green-500/10 group-hover:bg-green-500/20 rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-300"></div>
|
| 322 |
-
<i data-feather="check-circle" class="mr-2 text-green-400"></i>
|
| 323 |
-
<span class="relative">Apply Fix</span>
|
| 324 |
-
</button>
|
| 325 |
</div>
|
| 326 |
</div>
|
| 327 |
<!-- Enhanced Code Editor with VS Code-like styling -->
|
|
@@ -400,102 +458,6 @@ tailwind.config = {
|
|
| 400 |
</div>
|
| 401 |
</div>
|
| 402 |
</div>
|
| 403 |
-
<!-- Documentation Panel -->
|
| 404 |
-
<div class="code-editor p-4 glow">
|
| 405 |
-
<div class="flex items-center mb-4">
|
| 406 |
-
<div class="flex space-x-2 mr-4">
|
| 407 |
-
<div class="w-3 h-3 rounded-full bg-blue-500"></div>
|
| 408 |
-
<div class="w-3 h-3 rounded-full bg-purple-500"></div>
|
| 409 |
-
<div class="w-3 h-3 rounded-full bg-pink-500"></div>
|
| 410 |
-
</div>
|
| 411 |
-
<div class="text-sm text-gray-400">Documentation</div>
|
| 412 |
-
</div>
|
| 413 |
-
<div id="documentationPanel" class="w-full h-64 bg-gray-800 text-gray-300 font-mono text-sm p-4 rounded overflow-y-auto">
|
| 414 |
-
<div class="text-blue-400">/**
|
| 415 |
-
* <span class="text-purple-400">@function</span> calculateTotal
|
| 416 |
-
* <span class="text-purple-400">@description</span> Calculates the total price of items in a shopping cart
|
| 417 |
-
* <span class="text-purple-400">@param</span> {Array} items - Array of item objects with price and quantity
|
| 418 |
-
* <span class="text-purple-400">@returns</span> {Number} Total calculated amount
|
| 419 |
-
* <span class="text-purple-400">@throws</span> {Error} If items is not an array
|
| 420 |
-
*/</div>
|
| 421 |
-
</div>
|
| 422 |
-
</div>
|
| 423 |
-
|
| 424 |
-
<!-- Comments Panel -->
|
| 425 |
-
<div class="code-editor p-4 glow">
|
| 426 |
-
<div class="flex items-center mb-4">
|
| 427 |
-
<div class="flex space-x-2 mr-4">
|
| 428 |
-
<div class="w-3 h-3 rounded-full bg-green-500"></div>
|
| 429 |
-
<div class="w-3 h-3 rounded-full bg-yellow-500"></div>
|
| 430 |
-
<div class="w-3 h-3 rounded-full bg-red-500"></div>
|
| 431 |
-
</div>
|
| 432 |
-
<div class="text-sm text-gray-400">Comments</div>
|
| 433 |
-
</div>
|
| 434 |
-
<div id="commentsPanel" class="w-full h-64 bg-gray-800 text-gray-300 font-mono text-sm p-4 rounded overflow-y-auto">
|
| 435 |
-
<div class="text-green-400">// Function declaration with items parameter</div>
|
| 436 |
-
<div class="text-green-400 mt-2">// Input validation - checks if items is an array</div>
|
| 437 |
-
<div class="text-green-400 mt-2">// Initialize total to 0</div>
|
| 438 |
-
<div class="text-green-400 mt-2">// Loop through each item in the array</div>
|
| 439 |
-
<div class="text-green-400 mt-2">// Convert price to number, default to 0 if invalid</div>
|
| 440 |
-
<div class="text-green-400 mt-2">// Calculate line total (price * quantity)</div>
|
| 441 |
-
<div class="text-green-400 mt-2">// Return the calculated total</div>
|
| 442 |
-
</div>
|
| 443 |
-
</div>
|
| 444 |
-
</div>
|
| 445 |
-
<!-- Documentation and Comments Section -->
|
| 446 |
-
<div class="grid grid-cols-1 md:grid-cols-2 gap-8 mt-8">
|
| 447 |
-
<!-- Documentation Panel -->
|
| 448 |
-
<div class="code-editor p-4 glow">
|
| 449 |
-
<div class="flex items-center justify-between mb-4">
|
| 450 |
-
<div class="flex items-center">
|
| 451 |
-
<div class="flex space-x-2 mr-4">
|
| 452 |
-
<div class="w-3 h-3 rounded-full bg-blue-500"></div>
|
| 453 |
-
<div class="w-3 h-3 rounded-full bg-purple-500"></div>
|
| 454 |
-
<div class="w-3 h-3 rounded-full bg-pink-500"></div>
|
| 455 |
-
</div>
|
| 456 |
-
<div class="text-sm text-gray-400">Documentation</div>
|
| 457 |
-
</div>
|
| 458 |
-
<button onclick="downloadDocumentation()" class="text-gray-400 hover:text-white p-1 rounded hover:bg-gray-700/50 transition-all duration-200" title="Download Documentation">
|
| 459 |
-
<i data-feather="download" class="w-4 h-4"></i>
|
| 460 |
-
</button>
|
| 461 |
-
</div>
|
| 462 |
-
<div id="documentationPanel" class="w-full h-64 bg-gray-800 text-gray-300 font-mono text-sm p-4 rounded overflow-y-auto">
|
| 463 |
-
<div class="text-blue-400">/**
|
| 464 |
-
* <span class="text-purple-400">@function</span> calculateTotal
|
| 465 |
-
* <span class="text-purple-400">@description</span> Calculates the total price of items in a shopping cart
|
| 466 |
-
* <span class="text-purple-400">@param</span> {Array} items - Array of item objects with price and quantity
|
| 467 |
-
* <span class="text-purple-400">@returns</span> {Number} Total calculated amount
|
| 468 |
-
* <span class="text-purple-400">@throws</span> {Error} If items is not an array
|
| 469 |
-
*/</div>
|
| 470 |
-
</div>
|
| 471 |
-
</div>
|
| 472 |
-
|
| 473 |
-
<!-- Comments Panel -->
|
| 474 |
-
<div class="code-editor p-4 glow">
|
| 475 |
-
<div class="flex items-center justify-between mb-4">
|
| 476 |
-
<div class="flex items-center">
|
| 477 |
-
<div class="flex space-x-2 mr-4">
|
| 478 |
-
<div class="w-3 h-3 rounded-full bg-green-500"></div>
|
| 479 |
-
<div class="w-3 h-3 rounded-full bg-yellow-500"></div>
|
| 480 |
-
<div class="w-3 h-3 rounded-full bg-red-500"></div>
|
| 481 |
-
</div>
|
| 482 |
-
<div class="text-sm text-gray-400">Comments</div>
|
| 483 |
-
</div>
|
| 484 |
-
<button onclick="downloadComments()" class="text-gray-400 hover:text-white p-1 rounded hover:bg-gray-700/50 transition-all duration-200" title="Download Comments">
|
| 485 |
-
<i data-feather="download" class="w-4 h-4"></i>
|
| 486 |
-
</button>
|
| 487 |
-
</div>
|
| 488 |
-
<div id="commentsPanel" class="w-full h-64 bg-gray-800 text-gray-300 font-mono text-sm p-4 rounded overflow-y-auto">
|
| 489 |
-
<div class="text-green-400">// Function declaration with items parameter</div>
|
| 490 |
-
<div class="text-green-400 mt-2">// Input validation - checks if items is an array</div>
|
| 491 |
-
<div class="text-green-400 mt-2">// Initialize total to 0</div>
|
| 492 |
-
<div class="text-green-400 mt-2">// Loop through each item in the array</div>
|
| 493 |
-
<div class="text-green-400 mt-2">// Convert price to number, default to 0 if invalid</div>
|
| 494 |
-
<div class="text-green-400 mt-2">// Calculate line total (price * quantity)</div>
|
| 495 |
-
<div class="text-green-400 mt-2">// Return the calculated total</div>
|
| 496 |
-
</div>
|
| 497 |
-
</div>
|
| 498 |
-
</div>
|
| 499 |
</div>
|
| 500 |
<script>
|
| 501 |
function copyCode() {
|
|
|
|
| 273 |
<!-- Interactive Code Section -->
|
| 274 |
<div class="py-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto">
|
| 275 |
<div class="grid grid-cols-1 gap-8">
|
| 276 |
+
<!-- Combined Analysis Panel -->
|
| 277 |
+
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
|
| 278 |
+
<!-- Left Column - Bug Analysis and Fixed Code -->
|
| 279 |
+
<div class="space-y-8">
|
| 280 |
+
<!-- Bug Analysis -->
|
| 281 |
+
<div class="code-editor p-4 glow">
|
| 282 |
+
<div class="flex items-center justify-between mb-4">
|
| 283 |
+
<div class="flex items-center">
|
| 284 |
+
<div class="flex space-x-2 mr-4">
|
| 285 |
+
<div class="w-3 h-3 rounded-full bg-red-500"></div>
|
| 286 |
+
<div class="w-3 h-3 rounded-full bg-yellow-500"></div>
|
| 287 |
+
<div class="w-3 h-3 rounded-full bg-green-500"></div>
|
| 288 |
+
</div>
|
| 289 |
+
<div class="text-sm text-gray-400">Bug Analysis</div>
|
| 290 |
</div>
|
| 291 |
+
<button onclick="downloadBugAnalysis()" class="text-gray-400 hover:text-white p-1 rounded hover:bg-gray-700/50 transition-all duration-200" title="Download Analysis">
|
| 292 |
+
<i data-feather="download" class="w-4 h-4"></i>
|
| 293 |
+
</button>
|
| 294 |
+
</div>
|
| 295 |
+
<div id="bugTerminal" class="w-full h-48 bg-gray-800 text-gray-300 font-mono text-sm p-4 rounded overflow-y-auto">
|
| 296 |
+
<div class="text-green-400">$ Waiting for code analysis...</div>
|
| 297 |
</div>
|
|
|
|
|
|
|
|
|
|
| 298 |
</div>
|
| 299 |
+
|
| 300 |
+
<!-- Fixed Code -->
|
| 301 |
+
<div class="code-editor p-4 glow">
|
| 302 |
+
<div class="flex items-center justify-between mb-4">
|
| 303 |
+
<div class="flex items-center">
|
| 304 |
+
<div class="flex space-x-2 mr-4">
|
| 305 |
+
<div class="w-3 h-3 rounded-full bg-red-500"></div>
|
| 306 |
+
<div class="w-3 h-3 rounded-full bg-yellow-500"></div>
|
| 307 |
+
<div class="w-3 h-3 rounded-full bg-green-500"></div>
|
| 308 |
+
</div>
|
| 309 |
+
<div class="text-sm text-gray-400">fixed.js</div>
|
| 310 |
+
</div>
|
| 311 |
+
<div class="flex space-x-2">
|
| 312 |
+
<button onclick="copyFixedCode()" class="text-gray-400 hover:text-white p-1 rounded hover:bg-gray-700/50 transition-all duration-200" title="Copy Code">
|
| 313 |
+
<i data-feather="copy" class="w-4 h-4"></i>
|
| 314 |
+
</button>
|
| 315 |
+
<button onclick="downloadFixedCode()" class="text-gray-400 hover:text-white p-1 rounded hover:bg-gray-700/50 transition-all duration-200" title="Download Code">
|
| 316 |
+
<i data-feather="download" class="w-4 h-4"></i>
|
| 317 |
+
</button>
|
| 318 |
+
</div>
|
| 319 |
+
</div>
|
| 320 |
+
<pre id="fixedCode" class="text-gray-300 text-sm font-mono h-48 overflow-auto bg-gray-800 p-4 rounded">
|
| 321 |
+
<span class="text-gray-500">// Fixed code will appear here after analysis</span></pre>
|
| 322 |
+
<button onclick="applyFix()" class="group relative mt-4 w-full bg-gray-800/50 hover:bg-gray-700/70 border border-gray-700 hover:border-green-500 text-white py-2 px-4 rounded-md font-medium flex items-center justify-center transition-all duration-200 shadow-md hover:shadow-green-500/20">
|
| 323 |
+
<div class="absolute inset-0 bg-green-500/10 group-hover:bg-green-500/20 rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-300"></div>
|
| 324 |
+
<i data-feather="check-circle" class="mr-2 text-green-400 w-4 h-4"></i>
|
| 325 |
+
<span class="relative">Apply Fix</span>
|
| 326 |
+
</button>
|
| 327 |
</div>
|
| 328 |
</div>
|
| 329 |
|
| 330 |
+
<!-- Right Column - Documentation and Comments -->
|
| 331 |
+
<div class="space-y-8">
|
| 332 |
+
<!-- Documentation -->
|
| 333 |
+
<div class="code-editor p-4 glow">
|
| 334 |
+
<div class="flex items-center justify-between mb-4">
|
| 335 |
+
<div class="flex items-center">
|
| 336 |
+
<div class="flex space-x-2 mr-4">
|
| 337 |
+
<div class="w-3 h-3 rounded-full bg-blue-500"></div>
|
| 338 |
+
<div class="w-3 h-3 rounded-full bg-purple-500"></div>
|
| 339 |
+
<div class="w-3 h-3 rounded-full bg-pink-500"></div>
|
| 340 |
+
</div>
|
| 341 |
+
<div class="text-sm text-gray-400">Documentation</div>
|
| 342 |
</div>
|
| 343 |
+
<button onclick="downloadDocumentation()" class="text-gray-400 hover:text-white p-1 rounded hover:bg-gray-700/50 transition-all duration-200" title="Download Documentation">
|
| 344 |
+
<i data-feather="download" class="w-4 h-4"></i>
|
|
|
|
|
|
|
|
|
|
| 345 |
</button>
|
| 346 |
+
</div>
|
| 347 |
+
<div id="documentationPanel" class="w-full h-48 bg-gray-800 text-gray-300 font-mono text-sm p-4 rounded overflow-y-auto">
|
| 348 |
+
<div class="text-blue-400">/**
|
| 349 |
+
* <span class="text-purple-400">@function</span> calculateTotal
|
| 350 |
+
* <span class="text-purple-400">@description</span> Calculates the total price of items in a shopping cart
|
| 351 |
+
* <span class="text-purple-400">@param</span> {Array} items - Array of item objects with price and quantity
|
| 352 |
+
* <span class="text-purple-400">@returns</span> {Number} Total calculated amount
|
| 353 |
+
* <span class="text-purple-400">@throws</span> {Error} If items is not an array
|
| 354 |
+
*/</div>
|
| 355 |
+
</div>
|
| 356 |
+
</div>
|
| 357 |
+
|
| 358 |
+
<!-- Comments -->
|
| 359 |
+
<div class="code-editor p-4 glow">
|
| 360 |
+
<div class="flex items-center justify-between mb-4">
|
| 361 |
+
<div class="flex items-center">
|
| 362 |
+
<div class="flex space-x-2 mr-4">
|
| 363 |
+
<div class="w-3 h-3 rounded-full bg-green-500"></div>
|
| 364 |
+
<div class="w-3 h-3 rounded-full bg-yellow-500"></div>
|
| 365 |
+
<div class="w-3 h-3 rounded-full bg-red-500"></div>
|
| 366 |
+
</div>
|
| 367 |
+
<div class="text-sm text-gray-400">Comments</div>
|
| 368 |
+
</div>
|
| 369 |
+
<button onclick="downloadComments()" class="text-gray-400 hover:text-white p-1 rounded hover:bg-gray-700/50 transition-all duration-200" title="Download Comments">
|
| 370 |
<i data-feather="download" class="w-4 h-4"></i>
|
| 371 |
</button>
|
| 372 |
</div>
|
| 373 |
+
<div id="commentsPanel" class="w-full h-48 bg-gray-800 text-gray-300 font-mono text-sm p-4 rounded overflow-y-auto">
|
| 374 |
+
<div class="text-green-400">// Function declaration with items parameter</div>
|
| 375 |
+
<div class="text-green-400 mt-2">// Input validation - checks if items is an array</div>
|
| 376 |
+
<div class="text-green-400 mt-2">// Initialize total to 0</div>
|
| 377 |
+
<div class="text-green-400 mt-2">// Loop through each item in the array</div>
|
| 378 |
+
<div class="text-green-400 mt-2">// Convert price to number, default to 0 if invalid</div>
|
| 379 |
+
<div class="text-green-400 mt-2">// Calculate line total (price * quantity)</div>
|
| 380 |
+
<div class="text-green-400 mt-2">// Return the calculated total</div>
|
| 381 |
+
</div>
|
| 382 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 383 |
</div>
|
| 384 |
</div>
|
| 385 |
<!-- Enhanced Code Editor with VS Code-like styling -->
|
|
|
|
| 458 |
</div>
|
| 459 |
</div>
|
| 460 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 461 |
</div>
|
| 462 |
<script>
|
| 463 |
function copyCode() {
|