akhaliq HF Staff commited on
Commit
7ae5863
·
1 Parent(s): 55d069f

refactor: remove redundant tab button elements and event listeners from the UI logic

Browse files
Files changed (1) hide show
  1. index.html +1 -10
index.html CHANGED
@@ -474,29 +474,20 @@
474
  pSlider.oninput = () => pVal.textContent = pSlider.value;
475
  kSlider.oninput = () => kVal.textContent = kSlider.value;
476
  framesSlider.oninput = () => framesVal.textContent = framesSlider.value;
477
- // Tab Switching
478
- const tabChatBtn = document.getElementById('tab-chat-btn');
479
- const tabFewshotBtn = document.getElementById('tab-fewshot-btn');
480
  const tabChat = document.getElementById('tab-chat');
481
  const tabFewshot = document.getElementById('tab-fewshot');
482
 
483
  function switchTab(target) {
484
  if (target === 'chat') {
485
- tabChatBtn.classList.add('active');
486
- tabFewshotBtn.classList.remove('active');
487
  tabChat.classList.add('active');
488
  tabFewshot.classList.remove('active');
489
  } else {
490
- tabFewshotBtn.classList.add('active');
491
- tabChatBtn.classList.remove('active');
492
  tabFewshot.classList.add('active');
493
  tabChat.classList.remove('active');
494
  }
495
  }
496
 
497
- tabChatBtn.onclick = () => switchTab('chat');
498
- tabFewshotBtn.onclick = () => switchTab('fewshot');
499
-
500
  // Few-Shot Builder
501
  const fsFile = document.getElementById('fs-file');
502
  const fsPreview = document.getElementById('fs-preview');
 
474
  pSlider.oninput = () => pVal.textContent = pSlider.value;
475
  kSlider.oninput = () => kVal.textContent = kSlider.value;
476
  framesSlider.oninput = () => framesVal.textContent = framesSlider.value;
477
+ // Tab Switching Logic
 
 
478
  const tabChat = document.getElementById('tab-chat');
479
  const tabFewshot = document.getElementById('tab-fewshot');
480
 
481
  function switchTab(target) {
482
  if (target === 'chat') {
 
 
483
  tabChat.classList.add('active');
484
  tabFewshot.classList.remove('active');
485
  } else {
 
 
486
  tabFewshot.classList.add('active');
487
  tabChat.classList.remove('active');
488
  }
489
  }
490
 
 
 
 
491
  // Few-Shot Builder
492
  const fsFile = document.getElementById('fs-file');
493
  const fsPreview = document.getElementById('fs-preview');