fix: add scroll-to-top button to remaining pages (closes #920) - #922
Open
Quantumboy80 wants to merge 1 commit into
Open
fix: add scroll-to-top button to remaining pages (closes #920)#922Quantumboy80 wants to merge 1 commit into
Quantumboy80 wants to merge 1 commit into
Conversation
|
@Quantumboy80 is attempting to deploy a commit to the adithyansubramani1-1657's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #920
What was actually going on
While investigating, I found the feature was already half-built:
script.jsalready has a workingscrollToTop()function and a scrolllistener wired to
#scrollTopBtnstyle.cssalready had a#scrollTopBtn:hoverrule, but no base rule(no position, size, or default
display: none) — so the button wasunstyled wherever it existed
index.html,about.html,privacy-policy.html,refund-policy.html, andterms-of-service.html,but missing from
birthday.html,contact.html,favourites.html,and
products.htmlChanges
#scrollTopBtn(fixed position,bottom-right, circular, dark mode variant, mobile sizing)
<button id="scrollTopBtn" onclick="scrollToTop()">element to the 4 pages that didn't have it
(
bottom: 80px; /* sits above the back-to-top button */), so the twobuttons now stack correctly instead of overlapping
Testing
Tested locally on all 4 fixed pages plus the 2 pages that already had
the button (to confirm no regression), in both light/dark mode and at
mobile width:
Note for maintainer
Not part of this PR, but I noticed
scrollToTop()is defined twice inscript.js(once ~line 1020, once ~line 1621) — harmless dead code,happy to clean it up in a separate PR if useful.