document.addEventListener('DOMContentLoaded', function () { // 1. Gentle animations on scroll for job cards const jobCards = document.querySelectorAll('.job-card'); if (jobCards.length > 0) { const observer = new IntersectionObserver(entries => { entries.forEach(entry => { if (entry.isIntersecting) { entry.target.style.animation = 'fadeInUp 0.5s ease-out forwards'; observer.unobserve(entry.target); } }); }, { threshold: 0.1 }); jobCards.forEach(card => { card.style.opacity = '0'; // Start transparent observer.observe(card); }); // Add keyframes for the animation dynamically const style = document.createElement('style'); style.innerHTML = ` @keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } `; document.head.appendChild(style); } // 2. Toggle for the job search form const searchToggleBtn = document.getElementById('search-toggle-btn'); const jobSearchForm = document.getElementById('job-search-form'); if (searchToggleBtn && jobSearchForm) { searchToggleBtn.addEventListener('click', function () { jobSearchForm.classList.toggle('d-none'); const isHidden = jobSearchForm.classList.contains('d-none'); if (isHidden) { searchToggleBtn.innerHTML = ` Search Job Listings`; } else { searchToggleBtn.innerHTML = ` Close Search`; } }); } });