dev-Rachitgarg commited on
Commit
b6410c0
·
verified ·
1 Parent(s): 6040446

make the comment div same size as other fixed.js and other and also add copy and download icon in all features

Browse files
Files changed (1) hide show
  1. index.html +69 -14
index.html CHANGED
@@ -7,7 +7,48 @@
7
  <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
8
  <script src="https://cdn.tailwindcss.com"></script>
9
  <script>
10
- function downloadBugAnalysis() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  const content = document.getElementById('bugTerminal').textContent;
12
  const blob = new Blob([content], { type: 'text/plain' });
13
  const url = URL.createObjectURL(blob);
@@ -364,11 +405,16 @@ tailwind.config = {
364
  </div>
365
  <div class="text-sm text-gray-400">Bug Analysis</div>
366
  </div>
367
- <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">
368
- <i data-feather="download" class="w-4 h-4"></i>
369
- </button>
 
 
 
 
 
370
  </div>
371
- <div id="bugTerminal" class="w-full h-48 bg-gray-800 text-gray-300 font-mono text-sm p-4 rounded overflow-y-auto">
372
  <div class="text-green-400">$ Waiting for code analysis...</div>
373
  </div>
374
  </div>
@@ -416,11 +462,16 @@ tailwind.config = {
416
  </div>
417
  <div class="text-sm text-gray-400">Documentation</div>
418
  </div>
419
- <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">
420
- <i data-feather="download" class="w-4 h-4"></i>
421
- </button>
 
 
 
 
 
422
  </div>
423
- <div id="documentationPanel" class="w-full h-48 bg-gray-800 text-gray-300 font-mono text-sm p-4 rounded overflow-y-auto">
424
  <div class="text-blue-400">/**
425
  * <span class="text-purple-400">@function</span> calculateTotal
426
  * <span class="text-purple-400">@description</span> Calculates the total price of items in a shopping cart
@@ -430,7 +481,6 @@ tailwind.config = {
430
  */</div>
431
  </div>
432
  </div>
433
-
434
  <!-- Comments -->
435
  <div class="code-editor p-4 glow">
436
  <div class="flex items-center justify-between mb-4">
@@ -442,9 +492,14 @@ tailwind.config = {
442
  </div>
443
  <div class="text-sm text-gray-400">Comments</div>
444
  </div>
445
- <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">
446
- <i data-feather="download" class="w-4 h-4"></i>
447
- </button>
 
 
 
 
 
448
  </div>
449
  <div id="commentsPanel" class="w-full h-48 bg-gray-800 text-gray-300 font-mono text-sm p-4 rounded overflow-y-auto">
450
  <div class="text-green-400">// Function declaration with items parameter</div>
@@ -456,7 +511,7 @@ tailwind.config = {
456
  <div class="text-green-400 mt-2">// Return the calculated total</div>
457
  </div>
458
  </div>
459
- </div>
460
  </div>
461
  </div>
462
  </div>
 
7
  <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
8
  <script src="https://cdn.tailwindcss.com"></script>
9
  <script>
10
+ function copyComments() {
11
+ const content = document.getElementById('commentsPanel').textContent;
12
+ navigator.clipboard.writeText(content);
13
+
14
+ const notification = document.createElement('div');
15
+ notification.className = 'fixed bottom-4 right-4 bg-green-500 text-white px-4 py-2 rounded-md shadow-lg';
16
+ notification.textContent = 'Comments copied to clipboard!';
17
+ document.body.appendChild(notification);
18
+
19
+ setTimeout(() => {
20
+ notification.remove();
21
+ }, 2000);
22
+ }
23
+
24
+ function copyDocumentation() {
25
+ const content = document.getElementById('documentationPanel').textContent;
26
+ navigator.clipboard.writeText(content);
27
+
28
+ const notification = document.createElement('div');
29
+ notification.className = 'fixed bottom-4 right-4 bg-green-500 text-white px-4 py-2 rounded-md shadow-lg';
30
+ notification.textContent = 'Documentation copied to clipboard!';
31
+ document.body.appendChild(notification);
32
+
33
+ setTimeout(() => {
34
+ notification.remove();
35
+ }, 2000);
36
+ }
37
+
38
+ function copyBugAnalysis() {
39
+ const content = document.getElementById('bugTerminal').textContent;
40
+ navigator.clipboard.writeText(content);
41
+
42
+ const notification = document.createElement('div');
43
+ notification.className = 'fixed bottom-4 right-4 bg-green-500 text-white px-4 py-2 rounded-md shadow-lg';
44
+ notification.textContent = 'Bug analysis copied to clipboard!';
45
+ document.body.appendChild(notification);
46
+
47
+ setTimeout(() => {
48
+ notification.remove();
49
+ }, 2000);
50
+ }
51
+ function downloadBugAnalysis() {
52
  const content = document.getElementById('bugTerminal').textContent;
53
  const blob = new Blob([content], { type: 'text/plain' });
54
  const url = URL.createObjectURL(blob);
 
405
  </div>
406
  <div class="text-sm text-gray-400">Bug Analysis</div>
407
  </div>
408
+ <div class="flex space-x-2">
409
+ <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">
410
+ <i data-feather="copy" class="w-4 h-4"></i>
411
+ </button>
412
+ <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">
413
+ <i data-feather="download" class="w-4 h-4"></i>
414
+ </button>
415
+ </div>
416
  </div>
417
+ <div id="bugTerminal" class="w-full h-48 bg-gray-800 text-gray-300 font-mono text-sm p-4 rounded overflow-y-auto">
418
  <div class="text-green-400">$ Waiting for code analysis...</div>
419
  </div>
420
  </div>
 
462
  </div>
463
  <div class="text-sm text-gray-400">Documentation</div>
464
  </div>
465
+ <div class="flex space-x-2">
466
+ <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">
467
+ <i data-feather="copy" class="w-4 h-4"></i>
468
+ </button>
469
+ <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">
470
+ <i data-feather="download" class="w-4 h-4"></i>
471
+ </button>
472
+ </div>
473
  </div>
474
+ <div id="documentationPanel" class="w-full h-48 bg-gray-800 text-gray-300 font-mono text-sm p-4 rounded overflow-y-auto">
475
  <div class="text-blue-400">/**
476
  * <span class="text-purple-400">@function</span> calculateTotal
477
  * <span class="text-purple-400">@description</span> Calculates the total price of items in a shopping cart
 
481
  */</div>
482
  </div>
483
  </div>
 
484
  <!-- Comments -->
485
  <div class="code-editor p-4 glow">
486
  <div class="flex items-center justify-between mb-4">
 
492
  </div>
493
  <div class="text-sm text-gray-400">Comments</div>
494
  </div>
495
+ <div class="flex space-x-2">
496
+ <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">
497
+ <i data-feather="copy" class="w-4 h-4"></i>
498
+ </button>
499
+ <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">
500
+ <i data-feather="download" class="w-4 h-4"></i>
501
+ </button>
502
+ </div>
503
  </div>
504
  <div id="commentsPanel" class="w-full h-48 bg-gray-800 text-gray-300 font-mono text-sm p-4 rounded overflow-y-auto">
505
  <div class="text-green-400">// Function declaration with items parameter</div>
 
511
  <div class="text-green-400 mt-2">// Return the calculated total</div>
512
  </div>
513
  </div>
514
+ </div>
515
  </div>
516
  </div>
517
  </div>