Closed Palmistry2310 closed 1 month ago
The changes introduce a "Scroll to Top" button in the index.html
file, along with associated styles and functionality in scroll.js
. The button appears when the user scrolls down more than 200 pixels and allows for smooth scrolling back to the top when clicked. The implementation includes responsive design considerations, ensuring the button is appropriately styled and positioned for various screen sizes.
File | Change Summary |
---|---|
index.html | Added a new button <button id="scrollToTopBtn" title="Go to top">↑</button> and a <style> block for its design. Linked a new script scroll.js . |
scroll.js | Implemented functionality for the "Scroll to Top" button, including visibility control based on scroll position and smooth scrolling behavior. |
Objective | Addressed | Explanation |
---|---|---|
A button/icon that appears once the user scrolls down a certain distance (296) | ✅ | |
Button should be fixed at the bottom-right corner of the screen (296) | ✅ | |
When clicked, the page should smoothly scroll to the top (296) | ✅ | |
Ensure the button is hidden when the user is near the top of the page (296) | ✅ | |
The button design should match the website’s style and be mobile-friendly (296) | ✅ |
index.html
and the introduction of a smooth scrolling functionality in script.js
, which are both related to enhancing user navigation, similar to the "Scroll to Top" button feature in the main PR.🐰 In the land of code, a button does hop,
To whisk you away, to the top, non-stop!
With a click and a scroll, it dances with glee,
A friend for the user, as swift as can be!
So scroll down, dear friend, don’t you fret,
For the "Scroll to Top" is the best feature yet! 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Name | Link |
---|---|
Latest commit | 66d884303db33a79468f990956517f18927651e5 |
Latest deploy log | https://app.netlify.com/sites/manageyourwaste/deploys/6714c951929edb0008cf117c |
Issues Identification
Closes: #296
Description
Implemented a "Scroll to Top" button that allows users to quickly navigate back to the top of the page, enhancing user experience for long pages.
Details
Include any detailed information about the changes in this pull request. Design Considerations:
Tasks performed: 1 Design the "Scroll to Top" button (icon, size, color). 2 Implement the button in HTML/CSS. 3 Add JavaScript for the smooth scroll functionality. 4 Set the button to appear only when the user scrolls down (e.g., 200px from the top). 5 Test the feature across different devices and browsers. 6 Ensure the feature does not interfere with other elements on the page.
Types of Changes
Please check the boxes that apply
Checklist
Please check the boxes that apply
Screenshots
https://github.com/user-attachments/assets/44f1113c-3f90-472e-a561-30dc7d116190
If applicable, please attach screenshots of the changes made to the user interface.
Additional Information
Please provide any other information that is relevant to this pull request.
Summary by CodeRabbit