Skip to content

Added reusable Back to Top button#352

Merged
komalharshita merged 4 commits into
komalharshita:mainfrom
Suhas334:add-back-to-top-button
Jun 2, 2026
Merged

Added reusable Back to Top button#352
komalharshita merged 4 commits into
komalharshita:mainfrom
Suhas334:add-back-to-top-button

Conversation

@Suhas334
Copy link
Copy Markdown
Contributor

Summary [required]

This PR adds a reusable "Back to Top" button to improve navigation and user experience across long pages of the website. The button appears after scrolling down and smoothly scrolls the user back to the top when clicked. The implementation is responsive, lightweight, and aligned with the existing UI design.

Related Issue [required]

Closes #267

Type of Change [required]

  • Bug fix — resolves a broken behaviour
  • Feature — adds new functionality
  • Data — adds new projects to data/projects.json
  • Documentation — updates docs, README, or code comments only
  • Style — CSS or visual changes only, no logic change
  • Refactor — restructures code without changing behaviour
  • Test — adds or updates tests

What Was Changed [required]

File Change made
templates/index.html Added floating Back to Top button
static/style.css Added responsive styling and hover effects
static/script.js Added smooth scroll and scroll visibility logic

Before | After
image
image

How to Test This PR [required]

  1. Clone this branch:
    git checkout feat/back-to-top-button

  2. Install dependencies:
    pip install -r requirements.txt

  3. Run the app:
    python app.py

  4. Open:
    http://127.0.0.1:5000

  5. Scroll down the page

  6. Verify that:

    • The button appears after scrolling
    • Clicking the button smoothly scrolls to the top
    • The button remains fixed at the bottom-right corner
    • The feature works on both desktop and mobile screens

Test Results [required]

Application runs successfully without errors.
Back to Top button appears correctly.
Smooth scrolling functionality works as expected.
Responsive behavior verified on desktop and mobile views.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

@Suhas334 is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Owner

@komalharshita komalharshita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. The Back to Top feature is a useful UX improvement, but I cannot approve this PR in its current state.

Main concerns:

  • DevPath already contains an existing scroll-to-top button/logic (#scroll-top-btn). This PR introduces a second implementation (#backToTopBtn) instead of extending or improving the existing component.
  • Button visibility is controlled through direct inline style changes (style.display = "block"/"none"). Please follow the existing project pattern of toggling CSS classes for UI state management.
  • The new JavaScript does not check whether backToTopBtn exists before attaching event listeners, which may lead to runtime errors in future template variations.
  • The PR currently has merge conflicts that must be resolved before further review.

Please refactor this feature to reuse the existing scroll-to-top system, resolve merge conflicts, and update the implementation accordingly. Once those changes are made, I’ll be happy to review again.

@Suhas334
Copy link
Copy Markdown
Contributor Author

Suhas334 commented Jun 2, 2026

hi @komalharshita I make the changes as you expected.You can Review Now and tell if there are any issues.

@komalharshita
Copy link
Copy Markdown
Owner

@Suhas334 kindly resolve the merge conflicts

@Suhas334
Copy link
Copy Markdown
Contributor Author

Suhas334 commented Jun 2, 2026

hi @komalharshita Merge conflicts is solved

@komalharshita komalharshita merged commit 3cb809e into komalharshita:main Jun 2, 2026
7 of 8 checks passed
@komalharshita
Copy link
Copy Markdown
Owner

Approved for merge

@komalharshita komalharshita added gssoc:approved and removed need review Further information is requested labels Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Duplicate placeholder text rendered in Skills input field

2 participants