Skip to content

Commit

Permalink
remove scrollbtn when scrolling down
Browse files Browse the repository at this point in the history
  • Loading branch information
svbaelen committed Apr 12, 2024
1 parent 7f8ed2d commit 94a1e6c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/html/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -832,10 +832,15 @@ input:checked + .slider:before {
#btn-scroll-bottom svg {
transform: rotate(180deg);
}

#btn-scroll-bottom:hover svg,
#btn-scroll-top:hover svg {
stroke: var(--color-link);
}
#btn-scroll-bottom:focus svg,
#btn-scroll-top:focus svg {
stroke: #aaa;
}

/*#sidebar-right:hover #btn-scroll-bottom,*/
#scroll-buttons:hover #btn-scroll-top {
Expand Down
2 changes: 2 additions & 0 deletions src/scripts/scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ function mainScrollBtns() {
let scrollTop = window.pageYOffset || document.documentElement.scrollTop;
if (scrollTop > LAST_SCROLL_TOP) {
// downscroll code
if (newTimeout) clearTimeout(newTimeout);
btnScrollTop.style.display = 'none';
} else if (scrollTop < LAST_SCROLL_TOP) {
// upscroll code
btnScrollTop.style.display = 'flex';
Expand Down

0 comments on commit 94a1e6c

Please sign in to comment.