fix mobile menu

This commit is contained in:
MCHost
2025-07-06 22:07:36 -04:00
parent cdd69bd19b
commit 780b6a9c18
3 changed files with 37 additions and 18 deletions

View File

@@ -1,3 +1,21 @@
const sections = document.querySelectorAll('.section-bg');
const observer = new IntersectionObserver((entries) => {
entries.forEach((entry, index) => {
if (entry.isIntersecting) {
entry.target.style.transform = 'translateY(0)';
entry.target.style.opacity = '1';
entry.target.style.transitionDelay = `${index * 0.1}s`;
}
});
}, { threshold: 0.1 });
sections.forEach(section => {
section.style.transform = 'translateY(30px)';
section.style.opacity = '0';
section.style.transition = 'transform 0.7s ease-out, opacity 0.7s ease-out';
observer.observe(section);
});
const PARTICLE_POOL_SIZE = 50;
const particlePool = [];
const activeParticles = new Set();
@@ -62,23 +80,6 @@ function throttle(fn, wait) {
};
}
if (window.location.href === 'https://my-mc.link' || window.location.href === 'https://my-mc.link/') {
const hero = document.querySelector('.hero-bg');
if (hero) {
const heroImg = hero.querySelector('img');
if (heroImg) {
window.addEventListener(
'scroll',
throttle(() => {
const scrollPosition = window.pageYOffset;
if (heroImg.style.display === 'block') {
heroImg.style.transform = `translate(-50%, calc(-50% + ${scrollPosition * 0.3}px)) scale(1.2)`;
}
}, 16)
);
}
}
}
const buttons = document.querySelectorAll('.btn-minecraft');
buttons.forEach(button => {
@@ -125,4 +126,5 @@ document.addEventListener('click', (e) => {
mobileNav.classList.remove('active');
hamburger.classList.remove('active');
}
});
});