Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ // Smooth scroll for navigation links
+ document.querySelectorAll('a[href^="#"]').forEach(anchor => {
+ anchor.addEventListener('click', function (e) {
+ e.preventDefault();
+ document.querySelector(this.getAttribute('href')).scrollIntoView({
+ behavior: 'smooth'
+ });
+ });
+ });
+
+ // Animate progress circle on scroll
+ const progressCircles = document.querySelectorAll('.progress-circle');
+
+ const animateProgress = () => {
+ progressCircles.forEach(circle => {
+ const rect = circle.getBoundingClientRect();
+ if (rect.top < window.innerHeight && rect.bottom > 0) {
+ const progress = circle.getAttribute('data-progress');
+ circle.style.background = `conic-gradient(var(--secondary) ${progress}%, #ecf0f1 0)`;
+ }
+ });
+ };
+
+ window.addEventListener('scroll', animateProgress);
+ animateProgress(); // Initial check
+
+ // Add animation class to timeline items when they come into view
+ const timelineItems = document.querySelectorAll('.timeline-item');
+
+ const animateTimeline = () => {
+ timelineItems.forEach(item => {
+ const rect = item.getBoundingClientRect();
+ if (rect.top < window.innerHeight * 0.8) {
+ item.style.opacity = '1';
+ item.style.transform = 'translateY(0)';
+ }
+ });
+ };
+
+ window.addEventListener('scroll', animateTimeline);
+
+ // Initialize timeline items with starting styles
+ timelineItems.forEach(item => {
+ item.style.opacity = '0';
+ item.style.transform = 'translateY(20px)';
+ item.style.transition = 'all 0.5s ease-out';
+ });
+
+ animateTimeline(); // Initial check
+ });