File size: 46,516 Bytes
971c47a 4ffd82e b6410c0 4ffd82e 971c47a 4ffd82e b243d45 18ba748 b243d45 18ba748 4ffd82e b6410c0 18ba748 b6410c0 18ba748 4ffd82e 18ba748 4ffd82e 18ba748 4ffd82e b6410c0 18ba748 b6410c0 18ba748 b6410c0 4ffd82e 18ba748 16ae3f4 4ffd82e b6410c0 4ffd82e 93250f2 12e6bc2 e441b5d 25bc2b1 e441b5d 25bc2b1 e441b5d 971c47a e441b5d 971c47a e441b5d 971c47a e441b5d 25bc2b1 c6aaa20 e441b5d c6aaa20 e441b5d c6aaa20 e441b5d c6aaa20 e441b5d c6aaa20 e441b5d c6aaa20 e441b5d c6aaa20 e441b5d c6aaa20 e441b5d c6aaa20 e441b5d c6aaa20 e441b5d c6aaa20 971c47a c6aaa20 971c47a e441b5d 971c47a |
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 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 |
<!DOCTYPE html>
<html lang="en" class="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CodeGenius AI - Smart Coding Companion</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<script src="https://cdn.tailwindcss.com"></script>
<script>
function copyComments() {
const content = document.getElementById('commentsPanel').textContent;
navigator.clipboard.writeText(content);
const notification = document.createElement('div');
notification.className = 'fixed bottom-4 right-4 bg-green-500 text-white px-4 py-2 rounded-md shadow-lg';
notification.textContent = 'Comments copied to clipboard!';
document.body.appendChild(notification);
setTimeout(() => {
notification.remove();
}, 2000);
}
function copyDocumentation() {
const content = document.getElementById('documentationPanel').textContent;
navigator.clipboard.writeText(content);
const notification = document.createElement('div');
notification.className = 'fixed bottom-4 right-4 bg-green-500 text-white px-4 py-2 rounded-md shadow-lg';
notification.textContent = 'Documentation copied to clipboard!';
document.body.appendChild(notification);
setTimeout(() => {
notification.remove();
}, 2000);
}
function copyBugAnalysis() {
const content = document.getElementById('bugTerminal').textContent;
navigator.clipboard.writeText(content);
const notification = document.createElement('div');
notification.className = 'fixed bottom-4 right-4 bg-green-500 text-white px-4 py-2 rounded-md shadow-lg';
notification.textContent = 'Bug analysis copied to clipboard!';
document.body.appendChild(notification);
setTimeout(() => {
notification.remove();
}, 2000);
}
function downloadBugAnalysis() {
const content = document.getElementById('bugTerminal').textContent;
const blob = new Blob([content], { type: 'text/plain' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'bug-analysis.txt';
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
function copyFixedCode() {
const code = document.getElementById('fixedCode').textContent;
navigator.clipboard.writeText(code);
const notification = document.createElement('div');
notification.className = 'fixed bottom-4 right-4 bg-green-500 text-white px-4 py-2 rounded-md shadow-lg';
notification.textContent = 'Fixed code copied to clipboard!';
document.body.appendChild(notification);
setTimeout(() => {
notification.remove();
}, 2000);
}
function downloadFixedCode() {
const code = document.getElementById('fixedCode').textContent;
const blob = new Blob([code], { type: 'text/javascript' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'fixed-code.js';
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
function downloadDocumentation() {
const content = document.getElementById('documentationPanel').textContent;
const blob = new Blob([content], { type: 'text/plain' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'documentation.txt';
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
function downloadComments() {
const content = document.getElementById('commentsPanel').textContent;
const blob = new Blob([content], { type: 'text/plain' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'code-comments.txt';
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
tailwind.config = {
theme: {
extend: {
colors: {
primary: '#6366f1',
secondary: '#8b5cf6',
dark: '#0f172a',
light: '#f8fafc'
}
}
}
}
</script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.globe.min.js"></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&display=swap');
body {
font-family: 'Fira Code', monospace;
}
.code-editor {
background-color: #1e293b;
border-radius: 0.75rem;
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.gradient-text {
background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
.vanta-container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
}
.feature-card:hover {
transform: translateY(-5px);
transition: all 0.3s ease;
}
.glow {
box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}
</style>
</head>
<body class="bg-dark text-light min-h-screen">
<div id="vanta-bg" class="vanta-container"></div>
<!-- Navigation -->
<nav class="bg-dark/80 backdrop-blur-md border-b border-gray-800 fixed w-full z-50">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex items-center justify-between h-16">
<div class="flex items-center">
<div class="flex-shrink-0 flex items-center">
<i data-feather="code" class="text-primary h-6 w-6"></i>
<span class="ml-2 text-xl font-bold gradient-text">CodeGenius AI</span>
</div>
</div>
<div class="hidden md:block">
<div class="ml-10 flex items-baseline space-x-4">
<a href="#" class="text-primary px-3 py-2 rounded-md text-sm font-medium">Home</a>
<a href="#" class="text-gray-300 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Features</a>
<a href="#" class="text-gray-300 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Pricing</a>
<a href="#" class="text-gray-300 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Docs</a>
<a href="#" class="text-gray-300 hover:text-white px-3 py-2 rounded-md text-sm font-medium">About</a>
</div>
</div>
<div class="hidden md:block">
<div class="ml-4 flex items-center md:ml-6">
<button class="bg-primary hover:bg-primary/90 text-white px-4 py-2 rounded-md text-sm font-medium flex items-center">
<i data-feather="log-in" class="mr-2 h-4 w-4"></i> Sign In
</button>
</div>
</div>
<div class="-mr-2 flex md:hidden">
<button type="button" class="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-white hover:bg-gray-700 focus:outline-none">
<i data-feather="menu"></i>
</button>
</div>
</div>
</div>
</nav>
<!-- Hero Section -->
<div class="relative pt-32 pb-20 px-4 sm:px-6 lg:pt-40 lg:pb-28 lg:px-8">
<div class="max-w-7xl mx-auto">
<div class="text-center">
<h1 class="text-4xl tracking-tight font-extrabold sm:text-5xl md:text-6xl">
<span class="block">AI-Powered</span>
<span class="block gradient-text">Coding Companion</span>
</h1>
<p class="mt-3 max-w-md mx-auto text-base text-gray-300 sm:text-lg md:mt-5 md:text-xl md:max-w-3xl">
Supercharge your development workflow with our AI-powered tools that detect bugs, fix code, explain logic, and generate documentation automatically.
</p>
<div class="mt-10 sm:flex sm:justify-center">
<div class="rounded-md shadow">
<a href="#" class="w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-primary hover:bg-primary/90 md:py-4 md:text-lg md:px-10">
Get Started
</a>
</div>
<div class="mt-3 rounded-md shadow sm:mt-0 sm:ml-3">
<a href="#" class="w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-primary bg-white hover:bg-gray-50 md:py-4 md:text-lg md:px-10">
Live Demo
</a>
</div>
</div>
</div>
</div>
</div>
<!-- Features Section -->
<div class="py-12 bg-dark/50 backdrop-blur-sm">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="lg:text-center">
<h2 class="text-base text-primary font-semibold tracking-wide uppercase">Features</h2>
<p class="mt-2 text-3xl leading-8 font-extrabold tracking-tight text-white sm:text-4xl">
Everything you need to code smarter
</p>
</div>
<div class="mt-10">
<div class="grid grid-cols-1 gap-10 sm:grid-cols-2 lg:grid-cols-3">
<!-- Feature 1 -->
<div class="feature-card bg-gray-800/50 p-6 rounded-lg border border-gray-700 hover:border-primary">
<div class="flex items-center justify-center h-12 w-12 rounded-md bg-primary/10 text-primary mb-4">
<i data-feather="bug"></i>
</div>
<h3 class="text-lg font-medium text-white mb-2">AI Bug Detector</h3>
<p class="text-gray-300">
Real-time scanning and detection of bugs, errors, and vulnerabilities in your code with detailed reports.
</p>
</div>
<!-- Feature 2 -->
<div class="feature-card bg-gray-800/50 p-6 rounded-lg border border-gray-700 hover:border-primary">
<div class="flex items-center justify-center h-12 w-12 rounded-md bg-primary/10 text-primary mb-4">
<i data-feather="check-circle"></i>
</div>
<h3 class="text-lg font-medium text-white mb-2">AI Bug Fixer</h3>
<p class="text-gray-300">
Automated suggestions and fixes for identified bugs, with options to apply changes instantly.
</p>
</div>
<!-- Feature 3 -->
<div class="feature-card bg-gray-800/50 p-6 rounded-lg border border-gray-700 hover:border-primary">
<div class="flex items-center justify-center h-12 w-12 rounded-md bg-primary/10 text-primary mb-4">
<i data-feather="book-open"></i>
</div>
<h3 class="text-lg font-medium text-white mb-2">AI Code Explainer</h3>
<p class="text-gray-300">
In-depth breakdowns of complex code segments, simplifying logic and functionality for better understanding.
</p>
</div>
<!-- Feature 4 -->
<div class="feature-card bg-gray-800/50 p-6 rounded-lg border border-gray-700 hover:border-primary">
<div class="flex items-center justify-center h-12 w-12 rounded-md bg-primary/10 text-primary mb-4">
<i data-feather="file-text"></i>
</div>
<h3 class="text-lg font-medium text-white mb-2">AI Documentation Maker</h3>
<p class="text-gray-300">
Auto-generates comprehensive, well-structured documentation for projects in various formats.
</p>
</div>
<!-- Feature 5 -->
<div class="feature-card bg-gray-800/50 p-6 rounded-lg border border-gray-700 hover:border-primary">
<div class="flex items-center justify-center h-12 w-12 rounded-md bg-primary/10 text-primary mb-4">
<i data-feather="message-square"></i>
</div>
<h3 class="text-lg font-medium text-white mb-2">AI Auto-Commentor</h3>
<p class="text-gray-300">
Intelligently adds descriptive comments to code, improving readability and maintainability.
</p>
</div>
<!-- Feature 6 -->
<div class="feature-card bg-gray-800/50 p-6 rounded-lg border border-gray-700 hover:border-primary">
<div class="flex items-center justify-center h-12 w-12 rounded-md bg-primary/10 text-primary mb-4">
<i data-feather="users"></i>
</div>
<h3 class="text-lg font-medium text-white mb-2">Real-time Collaboration</h3>
<p class="text-gray-300">
Work together with your team in real-time with built-in collaboration tools and version control.
</p>
</div>
</div>
</div>
</div>
</div>
<!-- Interactive Code Section -->
<div class="py-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto">
<div class="grid grid-cols-1 gap-8">
<!-- Input JS Editor -->
<div class="code-editor p-4 glow">
<div class="flex items-center justify-between mb-4">
<div class="flex items-center">
<div class="flex space-x-2 mr-4">
<div class="w-3 h-3 rounded-full bg-red-500"></div>
<div class="w-3 h-3 rounded-full bg-yellow-500"></div>
<div class="w-3 h-3 rounded-full bg-green-500"></div>
</div>
<div class="text-sm text-gray-400">input.js</div>
</div>
<div class="flex space-x-2">
<button onclick="copyCode()" class="group relative text-gray-400 hover:text-white p-1.5 rounded hover:bg-gray-700/50 transition-all duration-200" title="Copy Code">
<i data-feather="copy" class="w-4 h-4"></i>
<span class="absolute top-full left-1/2 transform -translate-x-1/2 mt-1 px-2 py-1 text-xs text-white bg-gray-800 rounded opacity-0 group-hover:opacity-100 transition-opacity duration-200">Copy</span>
</button>
<button onclick="downloadCode()" class="group relative text-gray-400 hover:text-white p-1.5 rounded hover:bg-gray-700/50 transition-all duration-200" title="Download Code">
<i data-feather="download" class="w-4 h-4"></i>
<span class="absolute top-full left-1/2 transform -translate-x-1/2 mt-1 px-2 py-1 text-xs text-white bg-gray-800 rounded opacity-0 group-hover:opacity-100 transition-opacity duration-200">Download</span>
</button>
</div>
</div>
<div id="codeEditor" class="w-full h-96 bg-gray-800 text-gray-300 font-mono text-sm p-4 rounded overflow-auto">
<div>
<div class="text-primary font-medium">Function Declaration:</div>
<div class="text-gray-400 ml-4"><span class="text-purple-400">function</span> <span class="text-yellow-300">calculateTotal</span>(<span class="text-blue-400">items</span>) {</div>
</div>
<div class="mt-2">
<div class="text-primary font-medium">Input Validation:</div>
<div class="text-gray-400 ml-4"><span class="text-green-400">if</span> (!Array.isArray(<span class="text-blue-400">items</span>)) {</div>
<div class="text-gray-400 ml-8"><span class="text-green-400">throw</span> <span class="text-purple-400">new</span> <span class="text-blue-400">Error</span>(<span class="text-orange-300">'Items must be an array'</span>);</div>
<div class="text-gray-400 ml-4">}</div>
</div>
<div class="mt-2">
<div class="text-primary font-medium">Total Calculation:</div>
<div class="text-gray-400 ml-4"><span class="text-purple-400">let</span> total = <span class="text-blue-400">0</span>;</div>
<div class="text-gray-400 ml-4"><span class="text-blue-400">items</span>.forEach(<span class="text-blue-400">item</span> => {</div>
<div class="text-gray-400 ml-8"><span class="text-purple-400">const</span> price = <span class="text-blue-400">Number</span>(<span class="text-blue-400">item</span>.price) || <span class="text-blue-400">0</span>;</div>
<div class="text-gray-400 ml-8">total += price * (<span class="text-blue-400">item</span>.quantity || <span class="text-blue-400">1</span>);</div>
<div class="text-gray-400 ml-4">});</div>
</div>
<div class="mt-2">
<div class="text-primary font-medium">Return Value:</div>
<div class="text-gray-400 ml-4"><span class="text-green-400">return</span> total;</div>
<div class="text-gray-400 ml-4">}</div>
</div>
</div>
<div class="grid grid-cols-5 gap-3 mt-4">
<button onclick="explainCode()" class="group relative bg-gray-700/70 hover:bg-gray-600/80 border border-gray-600 hover:border-blue-500 text-white py-2.5 px-3 rounded-lg text-sm font-medium flex items-center justify-center transition-all duration-200 shadow-md hover:shadow-blue-500/20">
<div class="absolute inset-0 bg-blue-500/10 group-hover:bg-blue-500/20 rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-300"></div>
<i data-feather="book-open" class="mr-2 w-4 h-4 text-blue-400"></i>
<span class="relative">Explain</span>
</button>
<button onclick="commentCode()" class="group relative bg-gray-700/70 hover:bg-gray-600/80 border border-gray-600 hover:border-purple-500 text-white py-2.5 px-3 rounded-lg text-sm font-medium flex items-center justify-center transition-all duration-200 shadow-md hover:shadow-purple-500/20">
<div class="absolute inset-0 bg-purple-500/10 group-hover:bg-purple-500/20 rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-300"></div>
<i data-feather="message-square" class="mr-2 w-4 h-4 text-purple-400"></i>
<span class="relative">Comment</span>
</button>
<button onclick="analyzeCode()" class="group relative bg-gray-700/70 hover:bg-gray-600/80 border border-gray-600 hover:border-red-500 text-white py-2.5 px-3 rounded-lg text-sm font-medium flex items-center justify-center transition-all duration-200 shadow-md hover:shadow-red-500/20">
<div class="absolute inset-0 bg-red-500/10 group-hover:bg-red-500/20 rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-300"></div>
<i data-feather="bug" class="mr-2 w-4 h-4 text-red-400"></i>
<span class="relative">Find Bugs</span>
</button>
<button onclick="documentCode()" class="group relative bg-gray-700/70 hover:bg-gray-600/80 border border-gray-600 hover:border-green-500 text-white py-2.5 px-3 rounded-lg text-sm font-medium flex items-center justify-center transition-all duration-200 shadow-md hover:shadow-green-500/20">
<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>
<i data-feather="file-text" class="mr-2 w-4 h-4 text-green-400"></i>
<span class="relative">Document</span>
</button>
<button onclick="fixCode()" class="group relative bg-gray-700/70 hover:bg-gray-600/80 border border-gray-600 hover:border-indigo-500 text-white py-2.5 px-3 rounded-lg text-sm font-medium flex items-center justify-center transition-all duration-200 shadow-md hover:shadow-indigo-500/20">
<div class="absolute inset-0 bg-indigo-500/10 group-hover:bg-indigo-500/20 rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-300"></div>
<i data-feather="wrench" class="mr-2 w-4 h-4 text-indigo-400"></i>
<span class="relative">Fix Code</span>
</button>
</div>
</div>
<!-- Combined Analysis Panel -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
<!-- Left Column - Bug Analysis and Fixed Code -->
<div class="space-y-8">
<!-- Bug Analysis -->
<div class="code-editor p-4 glow">
<div class="flex items-center justify-between mb-4">
<div class="flex items-center">
<div class="flex space-x-2 mr-4">
<div class="w-3 h-3 rounded-full bg-red-500"></div>
<div class="w-3 h-3 rounded-full bg-yellow-500"></div>
<div class="w-3 h-3 rounded-full bg-green-500"></div>
</div>
<div class="text-sm text-gray-400">Bug Analysis</div>
</div>
<div class="flex space-x-2">
<button onclick="copyBugAnalysis()" class="text-gray-400 hover:text-white p-1 rounded hover:bg-gray-700/50 transition-all duration-200" title="Copy Analysis">
<i data-feather="copy" class="w-4 h-4"></i>
</button>
<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">
<i data-feather="download" class="w-4 h-4"></i>
</button>
</div>
</div>
<div id="bugTerminal" class="w-full h-48 bg-gray-800 text-gray-300 font-mono text-sm p-4 rounded overflow-y-auto">
<div class="text-green-400">$ Waiting for code analysis...</div>
</div>
</div>
<!-- Fixed Code -->
<div class="code-editor p-4 glow">
<div class="flex items-center justify-between mb-4">
<div class="flex items-center">
<div class="flex space-x-2 mr-4">
<div class="w-3 h-3 rounded-full bg-red-500"></div>
<div class="w-3 h-3 rounded-full bg-yellow-500"></div>
<div class="w-3 h-3 rounded-full bg-green-500"></div>
</div>
<div class="text-sm text-gray-400">fixed.js</div>
</div>
<div class="flex space-x-2">
<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">
<i data-feather="copy" class="w-4 h-4"></i>
</button>
<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">
<i data-feather="download" class="w-4 h-4"></i>
</button>
</div>
</div>
<pre id="fixedCode" class="text-gray-300 text-sm font-mono h-48 overflow-auto bg-gray-800 p-4 rounded">
<span class="text-gray-500">// Fixed code will appear here after analysis</span></pre>
<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">
<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>
<i data-feather="check-circle" class="mr-2 text-green-400 w-4 h-4"></i>
<span class="relative">Apply Fix</span>
</button>
</div>
</div>
<!-- Right Column - Documentation and Comments -->
<div class="space-y-8">
<!-- Documentation -->
<div class="code-editor p-4 glow">
<div class="flex items-center justify-between mb-4">
<div class="flex items-center">
<div class="flex space-x-2 mr-4">
<div class="w-3 h-3 rounded-full bg-blue-500"></div>
<div class="w-3 h-3 rounded-full bg-purple-500"></div>
<div class="w-3 h-3 rounded-full bg-pink-500"></div>
</div>
<div class="text-sm text-gray-400">Documentation</div>
</div>
<div class="flex space-x-2">
<button onclick="copyDocumentation()" class="text-gray-400 hover:text-white p-1 rounded hover:bg-gray-700/50 transition-all duration-200" title="Copy Documentation">
<i data-feather="copy" class="w-4 h-4"></i>
</button>
<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">
<i data-feather="download" class="w-4 h-4"></i>
</button>
</div>
</div>
<div id="documentationPanel" class="w-full h-48 bg-gray-800 text-gray-300 font-mono text-sm p-4 rounded overflow-y-auto">
<div class="text-blue-400">/**
* <span class="text-purple-400">@function</span> calculateTotal
* <span class="text-purple-400">@description</span> Calculates the total price of items in a shopping cart
* <span class="text-purple-400">@param</span> {Array} items - Array of item objects with price and quantity
* <span class="text-purple-400">@returns</span> {Number} Total calculated amount
* <span class="text-purple-400">@throws</span> {Error} If items is not an array
*/</div>
</div>
</div>
<!-- Comments -->
<div class="code-editor p-4 glow">
<div class="flex items-center justify-between mb-4">
<div class="flex items-center">
<div class="flex space-x-2 mr-4">
<div class="w-3 h-3 rounded-full bg-green-500"></div>
<div class="w-3 h-3 rounded-full bg-yellow-500"></div>
<div class="w-3 h-3 rounded-full bg-red-500"></div>
</div>
<div class="text-sm text-gray-400">Comments</div>
</div>
<div class="flex space-x-2">
<button onclick="copyComments()" class="text-gray-400 hover:text-white p-1 rounded hover:bg-gray-700/50 transition-all duration-200" title="Copy Comments">
<i data-feather="copy" class="w-4 h-4"></i>
</button>
<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">
<i data-feather="download" class="w-4 h-4"></i>
</button>
</div>
</div>
<div id="commentsPanel" class="w-full h-48 bg-gray-800 text-gray-300 font-mono text-sm p-4 rounded overflow-y-auto">
<div class="text-green-400">// Function declaration with items parameter</div>
<div class="text-green-400 mt-2">// Input validation - checks if items is an array</div>
<div class="text-green-400 mt-2">// Initialize total to 0</div>
<div class="text-green-400 mt-2">// Loop through each item in the array</div>
<div class="text-green-400 mt-2">// Convert price to number, default to 0 if invalid</div>
<div class="text-green-400 mt-2">// Calculate line total (price * quantity)</div>
<div class="text-green-400 mt-2">// Return the calculated total</div>
</div>
<button onclick="applyComments()" class="group relative mt-4 w-full bg-gray-800/50 hover:bg-gray-700/70 border border-gray-700 hover:border-purple-500 text-white py-2 px-4 rounded-md font-medium flex items-center justify-center transition-all duration-200 shadow-md hover:shadow-purple-500/20">
<div class="absolute inset-0 bg-purple-500/10 group-hover:bg-purple-500/20 rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-300"></div>
<i data-feather="check-circle" class="mr-2 text-purple-400 w-4 h-4"></i>
<span class="relative">Apply Comments</span>
</button>
</div>
</div>
</div>
</div>
</div>
<script>
</script>
<!-- Enhanced Code Explanation Section -->
<div class="py-16 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto bg-gradient-to-br from-gray-800/50 to-gray-900/60 rounded-lg border border-gray-700/50">
<div class="text-center mb-12">
<h2 class="text-3xl font-extrabold text-white sm:text-4xl">
<span class="gradient-text">AI-Powered Code Explanation</span>
</h2>
<p class="mt-3 max-w-2xl mx-auto text-lg text-gray-300">
Our AI analyzes your code structure, logic flow, and provides actionable insights.
</p>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
<!-- Interactive Code Breakdown -->
<div class="code-editor p-4 glow">
<div class="flex items-center justify-between mb-4">
<div class="text-sm text-gray-400">Interactive Code Breakdown</div>
<button onclick="toggleComplexity()" class="text-xs bg-gray-700/50 hover:bg-gray-600/70 text-gray-300 px-3 py-1 rounded-full">
<span id="complexityToggle">Show Advanced</span>
</button>
</div>
<div id="codeExplanation" class="text-gray-300 text-sm font-mono space-y-4">
<div class="bg-gray-800/50 p-3 rounded-lg border-l-4 border-primary">
<div class="flex items-center">
<i data-feather="chevron-right" class="text-primary mr-2"></i>
<div class="text-primary font-medium">Function Declaration</div>
</div>
<div class="mt-2 ml-6 text-gray-400">
<p>• Public function: calculateTotal(items)</p>
<p>• Accepts single parameter: items array</p>
<p>• Implicit return type: Number</p>
</div>
</div>
<div class="bg-gray-800/50 p-3 rounded-lg border-l-4 border-red-400">
<div class="flex items-center">
<i data-feather="shield" class="text-red-400 mr-2"></i>
<div class="text-red-400 font-medium">Input Validation</div>
</div>
<div class="mt-2 ml-6 text-gray-400">
<p>• Type check: Array.isArray()</p>
<p>• Throws Error on invalid input</p>
<p>• Missing: Element validation</p>
</div>
</div>
<div class="bg-gray-800/50 p-3 rounded-lg border-l-4 border-yellow-400">
<div class="flex items-center">
<i data-feather="repeat" class="text-yellow-400 mr-2"></i>
<div class="text-yellow-400 font-medium">Iteration Logic</div>
</div>
<div class="mt-2 ml-6 text-gray-400">
<p>• Array traversal: forEach</p>
<p>• Type coercion: Number()</p>
<p>• Default quantity: 1</p>
</div>
</div>
</div>
</div>
<!-- Advanced Analysis & Metrics -->
<div class="code-editor p-4 glow">
<div class="flex items-center justify-between mb-4">
<div class="text-sm text-gray-400">Advanced Analysis & Metrics</div>
<div class="flex space-x-2">
<button onclick="showPerformance()" class="text-xs bg-gray-700/50 hover:bg-gray-600/70 text-gray-300 px-3 py-1 rounded-full">Performance</button>
<button onclick="showSecurity()" class="text-xs bg-gray-700/50 hover:bg-gray-600/70 text-gray-300 px-3 py-1 rounded-full">Security</button>
<button onclick="showBestPractices()" class="text-xs bg-gray-700/50 hover:bg-gray-600/70 text-gray-300 px-3 py-1 rounded-full">Best Practices</button>
</div>
</div>
<div id="analysisMetrics" class="text-gray-300 text-sm font-mono space-y-4">
<div class="bg-gray-800/50 p-3 rounded-lg">
<div class="flex items-center justify-between">
<div class="font-medium flex items-center">
<i data-feather="clock" class="text-blue-400 mr-2"></i>
<span>Time Complexity</span>
</div>
<span class="text-green-400 text-xs bg-green-400/10 px-2 py-0.5 rounded-full">O(n)</span>
</div>
<div class="mt-2 text-gray-400">
<p>• Linear time operation based on input size</p>
<p>• No nested loops or recursive calls</p>
</div>
</div>
<div class="bg-gray-800/50 p-3 rounded-lg">
<div class="flex items-center justify-between">
<div class="font-medium flex items-center">
<i data-feather="cpu" class="text-purple-400 mr-2"></i>
<span>Memory Usage</span>
</div>
<span class="text-yellow-400 text-xs bg-yellow-400/10 px-2 py-0.5 rounded-full">O(1)</span>
</div>
<div class="mt-2 text-gray-400">
<p>• Constant space complexity</p>
<p>• Only primitive variables used</p>
</div>
</div>
<div class="bg-gray-800/50 p-3 rounded-lg">
<div class="flex items-center justify-between">
<div class="font-medium flex items-center">
<i data-feather="alert-triangle" class="text-red-400 mr-2"></i>
<span>Potential Issues</span>
</div>
<span class="text-red-400 text-xs bg-red-400/10 px-2 py-0.5 rounded-full">2 found</span>
</div>
<div class="mt-2 text-gray-400">
<p>• Floating point precision (currency)</p>
<p>• No input sanitization</p>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
</script>
<!-- CTA Section -->
<div class="bg-gradient-to-r from-primary/20 to-secondary/20 py-16 px-4 sm:px-6 lg:px-8">
<div class="max-w-3xl mx-auto text-center">
<h2 class="text-3xl font-extrabold text-white sm:text-4xl">
Ready to revolutionize your coding workflow?
</h2>
<p class="mt-3 text-xl text-gray-300">
Join thousands of developers who are coding smarter with AI assistance.
</p>
<div class="mt-10 sm:flex sm:justify-center">
<div class="rounded-md shadow">
<a href="#" class="w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-primary hover:bg-primary/90 md:py-4 md:text-lg md:px-10">
Start free trial
</a>
</div>
<div class="mt-3 rounded-md shadow sm:mt-0 sm:ml-3">
<a href="#" class="w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-primary bg-white hover:bg-gray-50 md:py-4 md:text-lg md:px-10">
See pricing
</a>
</div>
</div>
</div>
</div>
<!-- Footer -->
<footer class="bg-gray-900/80 backdrop-blur-md border-t border-gray-800 mt-20">
<div class="max-w-7xl mx-auto py-12 px-4 sm:px-6 lg:px-8">
<div class="grid grid-cols-2 md:grid-cols-4 gap-8">
<div>
<h3 class="text-sm font-semibold text-gray-400 tracking-wider uppercase">Product</h3>
<ul class="mt-4 space-y-4">
<li><a href="#" class="text-base text-gray-300 hover:text-white">Features</a></li>
<li><a href="#" class="text-base text-gray-300 hover:text-white">Pricing</a></li>
<li><a href="#" class="text-base text-gray-300 hover:text-white">API</a></li>
<li><a href="#" class="text-base text-gray-300 hover:text-white">Integrations</a></li>
</ul>
</div>
<div>
<h3 class="text-sm font-semibold text-gray-400 tracking-wider uppercase">Resources</h3>
<ul class="mt-4 space-y-4">
<li><a href="#" class="text-base text-gray-300 hover:text-white">Documentation</a></li>
<li><a href="#" class="text-base text-gray-300 hover:text-white">Guides</a></li>
<li><a href="#" class="text-base text-gray-300 hover:text-white">Blog</a></li>
<li><a href="#" class="text-base text-gray-300 hover:text-white">Support</a></li>
</ul>
</div>
<div>
<h3 class="text-sm font-semibold text-gray-400 tracking-wider uppercase">Company</h3>
<ul class="mt-4 space-y-4">
<li><a href="#" class="text-base text-gray-300 hover:text-white">About</a></li
</body>
</html> |