Spaces:
Running
Running
File size: 1,343 Bytes
84573c4 5036bf8 b23b7e7 5036bf8 b23b7e7 5036bf8 b23b7e7 84573c4 b23b7e7 5036bf8 b23b7e7 5036bf8 84573c4 5036bf8 84573c4 5036bf8 84573c4 5036bf8 b23b7e7 |
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 |
// 👻 GhostPack Spectral Interactivity 😈
// Smooth scrolling for nav links
document.querySelectorAll('a.nav-link').forEach(anchor => {
anchor.addEventListener('click', function(e) {
e.preventDefault();
const targetId = this.getAttribute('href').substring(1);
document.getElementById(targetId).scrollIntoView({ behavior: 'smooth' });
});
});
// Scroll reveal animations
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('animate__animated', 'animate__fadeInUp');
if (entry.target.classList.contains('card')) {
entry.target.classList.add('ghost-animation');
}
}
});
}, { threshold: 0.3 });
document.querySelectorAll('.card, h2, .lead, section').forEach(el => {
observer.observe(el);
});
// Neon glow on card hover
document.querySelectorAll('.card').forEach(card => {
card.addEventListener('mouseenter', () => {
card.style.transform = 'translateY(-10px) scale(1.03)';
card.style.boxShadow = '0 0 40px rgba(0, 255, 204, 0.8)';
});
card.addEventListener('mouseleave', () => {
card.style.transform = 'translateY(0) scale(1)';
card.style.boxShadow = '0 0 20px rgba(0, 255, 204, 0.4)';
});
}); |