rtik007's picture
Goal: Create a visually engaging and logically organized infographic that summarizes and enhances understanding of the provided content.
0398dc6 verified
raw
history blame contribute delete
845 Bytes
document.addEventListener('DOMContentLoaded', () => {
// Animate cards on scroll
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('animate-fade-in');
}
});
}, { threshold: 0.1 });
document.querySelectorAll('.service-card, infographic-card').forEach(card => {
observer.observe(card);
});
// Feather icons replacement
feather.replace();
});
// Helper function for dynamic content
function toggleAccordion(element) {
element.classList.toggle('active');
const content = element.nextElementSibling;
if (content.style.maxHeight) {
content.style.maxHeight = null;
} else {
content.style.maxHeight = content.scrollHeight + "px";
}
}