mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 05:09:46 +00:00
Доработан навбар и адаптирован под мобильную версию
This commit is contained in:
1 parent
e7d59c19ae
commit
402067cd3c
2 files changed
+27
-36
No files matched your search
@@ -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); // Показываем кнопку
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user