Spaces:
Running
Running
File size: 1,554 Bytes
94536b8 670c590 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | 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
}
|