Skip to content

feat(ui): add responsive hamburger navbar for mobile devices#25

Merged
omroy07 merged 2 commits into
omroy07:mainfrom
KGFCH2:fix/navbar-mobile-hamburger-menu
Jun 5, 2026
Merged

feat(ui): add responsive hamburger navbar for mobile devices#25
omroy07 merged 2 commits into
omroy07:mainfrom
KGFCH2:fix/navbar-mobile-hamburger-menu

Conversation

@KGFCH2

@KGFCH2 KGFCH2 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Related Issue

Closes #24

Summary

Adds a fully accessible hamburger menu for mobile viewports. The nav collapses below 768px, triggered by an animated 3-bar → X toggle button with complete keyboard support.

Changes Made

  • Add .hamburger button (CSS 3-bar animated to X when open)
  • Nav #navMenu hidden on mobile, revealed via .is-open class
  • ARIA: aria-expanded, aria-controls, aria-label on hamburger button
  • Escape key closes menu and returns focus to toggle
  • Nav links auto-close menu on click
  • Fix Windows-only backslash paths (log\login.htmllog/login.html)
  • Add <main> semantic wrapper and ARIA roles to index.html
  • Add explicit width/height on hero image (reduces CLS)

Testing

  • Tested at 375px (iPhone SE) — hamburger visible, menu functional
  • Tested at 768px — menu transitions correctly
  • Tested keyboard-only: Tab to hamburger, Enter to open, Escape to close
  • Verified no overflow at 320px width

Screenshots

Mobile (375px) — Closed Mobile (375px) — Open
3-bar hamburger visible Menu slides in, X animation

Checklist

  • Code follows project standards
  • Tested locally across viewport sizes
  • Responsive design verified
  • Accessibility considered (ARIA, Escape key, focus management)

The navigation bar had no mobile adaptation — on screens narrower than
768px, the nav links and auth buttons overflowed the viewport, causing
a broken horizontal-scroll experience.

Changes:
- Add .hamburger button (3-bar icon) visible only on mobile (≤768px)
- Nav slides in/out below the header when hamburger is toggled
- Hamburger animates into an X when menu is open (CSS transform)
- Proper ARIA attributes: aria-expanded, aria-controls, aria-label
- Escape key closes the menu and returns focus to the toggle button
- Nav links close the menu automatically on click
- Fix Windows-only backslash paths (log\login.html → log/login.html)
  which fail on Linux/macOS servers and GitHub Pages
- Add semantic <main> wrapper and role attributes for accessibility
- Add explicit width/height on hero image to reduce Cumulative Layout Shift
@vercel

vercel Bot commented Jun 2, 2026

Copy link
Copy Markdown

@KGFCH2 is attempting to deploy a commit to the Om Roy's projects Team on Vercel.

A member of the Team first needs to authorize it.

@omroy07

omroy07 commented Jun 3, 2026

Copy link
Copy Markdown
Owner

i don't accept your pr you directly do pr without assigning the issue to you

@KGFCH2

KGFCH2 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

Resolved...

@omroy07 omroy07 merged commit 938592c into omroy07:main Jun 5, 2026
2 of 4 checks passed
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 / UX] Navbar broken on mobile — no hamburger menu, links overflow viewport

2 participants