58 lines
1.7 KiB
JavaScript
58 lines
1.7 KiB
JavaScript
|
|
// Services page scripts (moved from inline in pages/services.html)
|
||
|
|
// Depends on ../main.js which initializes feather and other globals
|
||
|
|
|
||
|
|
(function() {
|
||
|
|
document.addEventListener('DOMContentLoaded', () => {
|
||
|
|
// Timeline Animation
|
||
|
|
const timeline = document.getElementById('process-timeline');
|
||
|
|
const steps = document.querySelectorAll('.process-step');
|
||
|
|
|
||
|
|
function animateTimeline() {
|
||
|
|
if (!timeline) return;
|
||
|
|
const timelineTop = timeline.getBoundingClientRect().top;
|
||
|
|
|
||
|
|
if (timelineTop < window.innerHeight - 200) {
|
||
|
|
timeline.classList.add('animated');
|
||
|
|
|
||
|
|
// Animate steps sequentially
|
||
|
|
steps.forEach((step, index) => {
|
||
|
|
setTimeout(() => {
|
||
|
|
step.classList.add('active');
|
||
|
|
}, index * 400);
|
||
|
|
});
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
window.addEventListener('scroll', animateTimeline);
|
||
|
|
window.addEventListener('load', animateTimeline);
|
||
|
|
|
||
|
|
// Service Tabs
|
||
|
|
const tabBtns = document.querySelectorAll('.service-tab-btn');
|
||
|
|
const tabContents = document.querySelectorAll('.service-tab-content');
|
||
|
|
|
||
|
|
if (tabBtns.length && tabContents.length) {
|
||
|
|
tabBtns.forEach(btn => {
|
||
|
|
btn.addEventListener('click', () => {
|
||
|
|
const tabId = btn.dataset.tab;
|
||
|
|
|
||
|
|
// Update buttons
|
||
|
|
tabBtns.forEach(b => b.classList.remove('active'));
|
||
|
|
btn.classList.add('active');
|
||
|
|
|
||
|
|
// Update content
|
||
|
|
tabContents.forEach(content => {
|
||
|
|
content.classList.remove('active');
|
||
|
|
if (content.id === 'tab-' + tabId) {
|
||
|
|
content.classList.add('active');
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
// Re-init feather icons for new content (safe if feather is loaded)
|
||
|
|
if (window.feather) window.feather.replace();
|
||
|
|
});
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
});
|
||
|
|
})();
|