bf phase v

This commit is contained in:
juanatsap
2025-11-12 19:54:56 +00:00
parent 81f8161dd2
commit f48ae9388e
6 changed files with 746 additions and 34 deletions
+6 -25
View File
@@ -547,35 +547,16 @@
}
}
// Show/hide back to top button
if (currentScroll > 300) {
backToTopBtn.style.display = 'flex';
} else {
backToTopBtn.style.display = 'none';
}
// Add/remove at-bottom class for both buttons
if (isAtBottom) {
if (backToTopBtn) backToTopBtn.classList.add('at-bottom');
if (infoBtn) infoBtn.classList.add('at-bottom');
} else {
if (backToTopBtn) backToTopBtn.classList.remove('at-bottom');
if (infoBtn) infoBtn.classList.remove('at-bottom');
}
// Show/hide back to top button + at-bottom positioning
backToTopBtn.style.display = currentScroll > 300 ? 'flex' : 'none';
backToTopBtn?.classList.toggle('at-bottom', isAtBottom);
infoBtn?.classList.toggle('at-bottom', isAtBottom);
lastScrollTop = currentScroll <= 0 ? 0 : currentScroll;
}, false);
// Back to top button click handler
const backToTopBtn = document.getElementById('back-to-top');
if (backToTopBtn) {
backToTopBtn.addEventListener('click', function() {
window.scrollTo({
top: 0,
behavior: 'smooth'
});
});
}
// Back to top - now uses native anchor link with CSS smooth scroll
// No click handler needed! Native <a href="#top"> with scroll-behavior: smooth
}
// =============================================================================