Initial commit

This commit is contained in:
Kirchik
2025-08-02 11:45:16 +02:00
parent a6a820aba2
commit a0ba937a46
1078 changed files with 7800 additions and 1115 deletions
@@ -0,0 +1,30 @@
<div id="global-back-to-top" class="back-to-top-btn" onclick="scrollToTop()">
</div>
<script>
function scrollToTop() {
window.scrollTo({
top: 0,
behavior: 'smooth'
});
}
window.addEventListener('scroll', function() {
const backToTopBtn = document.getElementById('global-back-to-top');
// Вычисляем высоту страницы и положение скролла
const documentHeight = document.documentElement.scrollHeight;
const windowHeight = window.innerHeight;
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
// Показываем кнопку только в последней трети страницы
const scrollPercent = (scrollTop + windowHeight) / documentHeight;
if (scrollPercent > 0.66) { // Показываем когда прокрутили 66% страницы
backToTopBtn.classList.add('show');
} else {
backToTopBtn.classList.remove('show');
}
});
</script>