Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added a back to top button feature #1780

Closed
wants to merge 1 commit into from

Conversation

imrehankhan
Copy link

@imrehankhan imrehankhan commented Dec 13, 2024

Fixed issue #748

Description:
This PR introduces a “Back to Top” button to enhance user navigation and improve accessibility on the website. The button appears when the user scrolls down the page and allows them to return to the top with a smooth scrolling animation.

Changes Made:
1. Created a reusable BackToTop component.
2. Added functionality to detect scroll position and conditionally render the button.
3. Implemented smooth scrolling behaviour for better user experience.
4. Styled the button for consistency with the website’s design.

Files Added/Modified:
• components/BackToTop/back.jsx
• components/BackToTop/back.css

Preview:
• The button is visible when the user scrolls down by 200px or more.
• Smooth scrolling effect is implemented for modern browsers.

Testing Instructions:
1. Scroll down the page to see the “Back to Top” button appear.
2. Click the button to ensure it scrolls smoothly to the top.
3. Verify that the button is hidden when scrolled back to the top.

Additional Notes:
• The component is modular and can be reused across pages.
• Added responsive styles to ensure proper rendering on all screen sizes.

Screenshot:
Screenshot 2024-12-13 at 10 40 04 AM

Copy link

vercel bot commented Dec 13, 2024

@imrehankhan is attempting to deploy a commit to the Piyush Garg's projects Team on Vercel.

A member of the Team first needs to authorize it.

@imrehankhan imrehankhan changed the title Added a back to top button feature feat: Added a back to top button feature Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant