refactor: move tab logic and implement Quill editor and GitHub commit integration in scratch_test.js
This commit is contained in:
@@ -799,42 +799,7 @@
|
||||
<script src="https://cdn.jsdelivr.net/npm/quill@2.0.2/dist/quill.js"></script>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script>
|
||||
// Tab Switch Logic
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const tabButtons = document.querySelectorAll('.tab-btn');
|
||||
const tabPanels = document.querySelectorAll('.tab-panel');
|
||||
|
||||
tabButtons.forEach(button => {
|
||||
button.addEventListener('click', () => {
|
||||
// Deactivate active tab
|
||||
tabButtons.forEach(btn => {
|
||||
btn.classList.remove('active', 'bg-blue-50', 'border-blue-100', 'text-blue-900');
|
||||
btn.classList.add('bg-transparent', 'border-transparent', 'text-slate-600');
|
||||
btn.querySelector('.tab-icon').classList.remove('bg-blue-600', 'text-white');
|
||||
btn.querySelector('.tab-icon').classList.add('bg-slate-50', 'text-slate-500');
|
||||
btn.setAttribute('aria-selected', 'false');
|
||||
});
|
||||
|
||||
// Hide active panels
|
||||
tabPanels.forEach(panel => {
|
||||
panel.classList.add('hidden');
|
||||
});
|
||||
|
||||
// Activate clicked tab
|
||||
button.classList.add('active', 'bg-blue-50', 'border-blue-100', 'text-blue-900');
|
||||
button.classList.remove('bg-transparent', 'border-transparent', 'text-slate-600');
|
||||
button.querySelector('.tab-icon').classList.add('bg-blue-600', 'text-white');
|
||||
button.querySelector('.tab-icon').classList.remove('bg-slate-50', 'text-slate-500');
|
||||
button.setAttribute('aria-selected', 'true');
|
||||
|
||||
// Show targets panel
|
||||
const targetId = button.getAttribute('data-tab-target');
|
||||
const targetPanel = document.getElementById(targetId + '-panel');
|
||||
if (targetPanel) {
|
||||
targetPanel.classList.remove('hidden');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
let quill;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user