Skip to content

feat(ux): smooth fade and polished states for scroll-to-top button - #1687

Open
singhanurag0317-bit wants to merge 1 commit into
souma9830:masterfrom
singhanurag0317-bit:feat/issue-933
Open

feat(ux): smooth fade and polished states for scroll-to-top button#1687
singhanurag0317-bit wants to merge 1 commit into
souma9830:masterfrom
singhanurag0317-bit:feat/issue-933

Conversation

@singhanurag0317-bit

Copy link
Copy Markdown

Closes #933

What

The global scroll-to-top button (ScrollToTopButton, rendered in App.jsx) appeared/disappeared abruptly — it returned null when hidden — and lacked polished hover, active, focus, and dark-theme states.

Changes

  • frontend/src/components/ScrollToTopButton.jsx
    • Button now stays in the DOM and toggles a .show class, so it fades in/out smoothly based on scroll position instead of popping in.
    • Uses a ChevronUp icon with aria-hidden for a cleaner look.
  • frontend/src/components/ScrollToTopButton.css
    • Fade/scale/visibility transitions for smooth appearance and disappearance.
    • Polished :hover (lift + stronger shadow) and :active (press-down scale) states.
    • :focus-visible outline for keyboard accessibility.
    • Theme-aware colors using --color-primary tokens plus a [data-theme='dark'] gold variant for proper contrast.
    • Mobile sizing and a prefers-reduced-motion guard.
  • Added ScrollToTopButton.test.jsx (4 tests): hidden at top, fades in on scroll, fades out at top, smooth scroll on click.

Verification

  • npx vitest run src/test/__tests__/ScrollToTopButton.test.jsx — 4 passed.

@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

@singhanurag0317-bit is attempting to deploy a commit to the souma9830's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

[FEATURE]: Improve Scroll-to-Top button behavior and UX

1 participant