AI_Review / script.js
Soha85's picture
Update script.js
a2488a3 verified
Raw History Blame Contribute Delete
610 Bytes
function toggleCard(element) {
// Check if clicked card is already expanded
const isExpanded = element.classList.contains('expanded');
// Close all other cards first (Accordion behavior)
document.querySelectorAll('.era-card').forEach(card => {
card.classList.remove('expanded');
});
// If it wasn't expanded, expand it now
if (!isExpanded) {
element.classList.add('expanded');
// Smooth scroll to the expanded card
setTimeout(() => {
element.scrollIntoView({ behavior: 'smooth', block: 'center' });
}, 300);
}
}