document.addEventListener('DOMContentLoaded', function() { // Initialize animations initAnimations(); // Load projects loadProjects(); // Smooth scrolling for anchor links document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); document.querySelector(this.getAttribute('href')).scrollIntoView({ behavior: 'smooth' }); }); }); // Animate skill bars on scroll const skillBars = document.querySelectorAll('.skill-bar'); const observer = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { const percent = entry.target.getAttribute('data-percent'); entry.target.style.width = `${percent}%`; } }); }, {threshold: 0.5}); skillBars.forEach(bar => { observer.observe(bar); }); }); function initAnimations() { // Add hover effects to all tech icons const techIcons = document.querySelectorAll('.tech-icon'); techIcons.forEach(icon => { icon.addEventListener('mouseenter', () => { icon.querySelector('svg').style.transform = 'scale(1.2)'; }); icon.addEventListener('mouseleave', () => { icon.querySelector('svg').style.transform = 'scale(1)'; }); }); } function loadProjects() { // This function is now empty since we're using static HTML for bots }