Skip to content

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

Open
KGFCH2 wants to merge 1 commit into
omroy07:mainfrom
KGFCH2:fix/navbar-mobile-hamburger-menu
Open

feat(ui): add responsive hamburger navbar for mobile devices#25
KGFCH2 wants to merge 1 commit into
omroy07:mainfrom
KGFCH2:fix/navbar-mobile-hamburger-menu

Conversation

@KGFCH2
Copy link
Copy Markdown
Contributor

@KGFCH2 KGFCH2 commented Jun 2, 2026

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
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

@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
Copy link
Copy Markdown
Owner

omroy07 commented Jun 3, 2026

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

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.

🐛 [Bug / UX] Navbar broken on mobile — no hamburger menu, links overflow viewport

2 participants