-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.js
More file actions
49 lines (43 loc) · 1.54 KB
/
scripts.js
File metadata and controls
49 lines (43 loc) · 1.54 KB
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
// Animación de entrada para las secciones
document.addEventListener('DOMContentLoaded', () => {
const sections = document.querySelectorAll('.section');
const observerOptions = {
threshold: 0.1,
rootMargin: '0px'
};
const sectionObserver = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.style.opacity = '1';
entry.target.style.transform = 'translateY(0)';
}
});
}, observerOptions);
sections.forEach(section => {
section.style.opacity = '0';
section.style.transform = 'translateY(20px)';
section.style.transition = 'all 0.5s ease-out';
sectionObserver.observe(section);
});
// Animación para las habilidades técnicas
const skillItems = document.querySelectorAll('.skill-category li');
skillItems.forEach(item => {
item.addEventListener('mouseenter', () => {
item.style.transform = 'scale(1.05)';
item.style.color = 'var(--secondary-color)';
});
item.addEventListener('mouseleave', () => {
item.style.transform = 'scale(1)';
item.style.color = 'var(--text-color)';
});
});
});
// Animación para el header
const header = document.querySelector('.header');
window.addEventListener('scroll', () => {
if (window.scrollY > 50) {
header.style.transform = 'translateY(-10px)';
} else {
header.style.transform = 'translateY(0)';
}
});