Auto commit: 2025-09-17T13:30:15.962Z

This commit is contained in:
Flatlogic Bot 2025-09-17 13:30:15 +00:00
parent 08116d4507
commit 5fa7c3442b

View File

@ -1,25 +1,24 @@
// Gentle animations on scroll for job cards
document.addEventListener('DOMContentLoaded', function () { document.addEventListener('DOMContentLoaded', function () {
// 1. Gentle animations on scroll for job cards
const jobCards = document.querySelectorAll('.job-card'); 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 });
const observer = new IntersectionObserver(entries => { jobCards.forEach(card => {
entries.forEach(entry => { card.style.opacity = '0'; // Start transparent
if (entry.isIntersecting) { observer.observe(card);
entry.target.style.animation = 'fadeInUp 0.5s ease-out forwards';
observer.unobserve(entry.target);
}
}); });
}, { threshold: 0.1 });
jobCards.forEach(card => { // Add keyframes for the animation dynamically
card.style.opacity = '0'; // Start transparent const style = document.createElement('style');
observer.observe(card); style.innerHTML = `
});
});
// Add keyframes for the animation
const style = document.createElement('style');
style.innerHTML = `
@keyframes fadeInUp { @keyframes fadeInUp {
from { from {
opacity: 0; opacity: 0;
@ -31,17 +30,17 @@ style.innerHTML = `
} }
} }
`; `;
document.head.appendChild(style); document.head.appendChild(style);
}
// Toggle for the job search form // 2. Toggle for the job search form
document.addEventListener('DOMContentLoaded', function () {
const searchToggleBtn = document.getElementById('search-toggle-btn'); const searchToggleBtn = document.getElementById('search-toggle-btn');
const jobSearchForm = document.getElementById('job-search-form'); const jobSearchForm = document.getElementById('job-search-form');
if (searchToggleBtn && jobSearchForm) { if (searchToggleBtn && jobSearchForm) {
searchToggleBtn.addEventListener('click', function () { searchToggleBtn.addEventListener('click', function () {
jobSearchForm.classList.toggle('d-none'); jobSearchForm.classList.toggle('d-none');
// Optional: Change button text/icon
const isHidden = jobSearchForm.classList.contains('d-none'); const isHidden = jobSearchForm.classList.contains('d-none');
if (isHidden) { if (isHidden) {
searchToggleBtn.innerHTML = ` searchToggleBtn.innerHTML = `