34148-vm/assets/js/main.js
2025-09-17 12:59:18 +00:00

34 lines
924 B
JavaScript

// Gentle animations on scroll for job cards
document.addEventListener('DOMContentLoaded', function () {
const jobCards = document.querySelectorAll('.job-card');
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
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);