Доработан навбар и адаптирован под мобильную версию

This commit is contained in:
mimi committed 2025-03-04 17:04:10 +03:00
1 parent e7d59c19ae
commit 402067cd3c
2 files changed
+27 -36

No files matched your search

+2 -2
View File
@@ -14,7 +14,7 @@ function Root() {
const [setRef, isTargetVisible] = useElementOnScreen({
root: null,
rootMargin: '0px',
threshold: 0.0,
threshold: 0.9,
});
const [isOnTopVisible, setIsOnTopVisible] = useState(false); // Состояние для видимости кнопки
@@ -42,7 +42,7 @@ function Root() {
const handleScroll = () => {
const headerHeight = document.getElementById('mainpageheader')?.offsetHeight || 0;
if (window.scrollY > headerHeight && !hasScrolled) {
setHasScrolled(true); // Обновим флаг, когда пользователь прокрутит страницу
setHasScrolled(true);
}
setIsOnTopVisible(window.scrollY > headerHeight); // Показываем кнопку
};