Manu97423's picture
create portfolio with calendar booking feature for courses:
4d2b883 verified
raw
history blame contribute delete
875 Bytes
// Shared functionality
document.addEventListener('DOMContentLoaded', () => {
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
// Add fade-in animation to sections when they come into view
const sections = document.querySelectorAll('section');
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('fade-in');
}
});
}, { threshold: 0.1 });
sections.forEach(section => {
observer.observe(section);
});
});