Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.pgv-scroll-to-top-bottom {
position: fixed;
bottom: calc(var(--section-padding) * 1 + (var(--pgv-offset-bottom, 0px)));
bottom: var(--section-padding);
right: calc(var(--section-padding) * 2);
display: flex;
gap: 0.375rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@ export default function ScrollToTopBottom() {
setIsAtTop(atTop);
setIsAtBottom(atBottom);
setIsScrollable(scrollable);

// Distance from bottom
const distanceFromBottom = docHeight - (scrollTop + windowHeight);

// Only trigger the offset if we're within 20px from the bottom
const offset = Math.max(0, Math.min(100, 100 - distanceFromBottom));

const root = document.documentElement;
root.style.setProperty("--pgv-offset-bottom", `${offset}px`);
};

updateScrollState();
Expand Down