Spaces:
Sleeping
Sleeping
Lê Đăng Khoa (Liam) commited on
Upd mermaid cache
Browse files1353 unmodified lines1354135513561357135813591360122 unmodified lines14831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505299 unmodified lines18051806180718081809181018111353 unmodified lines}// Cache mermaid src (before any render)cacheMermaidSources();function showToast(msg) {const t = $('#toast');122 unmodified linesbtn.addEventListener('click', () => {const group = btn.closest('[role="tablist"]') || btn.parentElement;const tabId = btn.dataset.tab;// activate tabs in the same group$$('.tab', group).forEach(t => t.classList.remove('active'));btn.classList.add('active');// show/hide related panels (by id)const root = group.closest('.card-body') || document;$$('.tabpanel', root).forEach(p => p.classList.add('hidden'));const panel = $('#' + tabId);if (panel) panel.classList.remove('hidden');// re-render mermaid if panel contains diagramsrequestAnimationFrame(() => await renderMermaid());});});}// ---------- Accordion ----------function initAccordion() {$$('.accordion-item').forEach(item => {299 unmodified lines// Render math + mermaid after libs loadsetTimeout(() => {renderMath();await renderMermaid();}, 0);initGSAP();1353 unmodified lines1354135513561357135813591360122 unmodified lines1483148414851486148714881489149014911492149314941495149614971498149915001501150215031504299 unmodified lines18041805180618071808180918101353 unmodified lines}// Cache mermaid src (before any render)window.addEventListener('DOMContentLoaded', cacheMermaidSources);function showToast(msg) {const t = $('#toast');122 unmodified linesbtn.addEventListener('click', () => {const group = btn.closest('[role="tablist"]') || btn.parentElement;const tabId = btn.dataset.tab;$$('.tab', group).forEach(t => t.classList.remove('active'));btn.classList.add('active');const root = group.closest('.card-body') || document;$$('.tabpanel', root).forEach(p => p.classList.add('hidden'));const panel = document.getElementById(tabId);if (panel) panel.classList.remove('hidden');requestAnimationFrame(() => { renderMermaid(); });});});}// ---------- Accordion ----------function initAccordion() {$$('.accordion-item').forEach(item => {299 unmodified lines// Render math + mermaid after libs loadsetTimeout(() => {renderMath();renderMermaid();}, 0);initGSAP();
index.html+9-10