Skip to content

fix(web-app): resolve hover contrast, sidebar layout shifting, and mobile menu toggle bugs (#1279) - #1348

Merged
steam-bell-92 merged 3 commits into
steam-bell-92:mainfrom
omnipotentchaos:fix/surprise-me-and-sidebar-1279
Jun 23, 2026
Merged

fix(web-app): resolve hover contrast, sidebar layout shifting, and mobile menu toggle bugs (#1279)#1348
steam-bell-92 merged 3 commits into
steam-bell-92:mainfrom
omnipotentchaos:fix/surprise-me-and-sidebar-1279

Conversation

@omnipotentchaos

Copy link
Copy Markdown
Contributor

📝 Description

This PR resolves multiple UI and layout bugs reported in issue #1279, improving screen responsiveness, dark mode visibility, and navigation interactions on mobile.

1. "Surprise Me" Button Hover Contrast State

  • Issue: Hovering over the "Surprise Me" button in the hero section turned the background white. In dark mode, because the text/icon was also white, this caused zero contrast (white-on-white text).
  • Fix: Added color: #0c0f1a (dark slate) to .btn-secondary-hero:hover in styles.css. The text and icon now correctly transition to dark slate against the white hover background.

2. Sidebar Dock Layout Overlapping Content on Medium viewports

  • Issue: On viewports between 768px and 1100px, the sidebar docked on the left, but content shifting paddings were set to 0 by a max-width override, causing the sidebar to overlap the leftmost project cards (like "Coin Flip").
  • Fix: Aligned the layout shifting media queries in styles.css so that the desktop paddings (296px / 128px) apply for all screens >= 768px, while the mobile layout overrides are confined to viewports < 768px (max-width: 767px).

3. Mobile Sidebar Drawer Autoloading on Scroll

  • Issue: On viewports <= 768px, scrolling past the hero section triggered the scroll observer, automatically sliding in the mobile drawer and displaying the backdrop, blocking user interaction.
  • Fix:
    • Updated checkAndToggleSidebar in main.js to return early on screens <= 768px, preventing scroll-based automatic triggers on mobile.
    • Added click event handlers for mobileMenuToggle to toggle sidebar-active and synchronized aria-expanded attributes.
    • Configured category tab click handlers in main.js to automatically close the mobile sidebar drawer after selection.

4. Broken Link Tags & FontAwesome Loading Failures

  • Issue:
    • A syntax error in the FontAwesome <link> tags in all HTML files closed the tag prematurely and rendered a stray /> character sequence at the top left of the screen.
    • Mismatched Subresource Integrity (SRI) hashes caused browsers to block FontAwesome stylesheet requests, rendering theme-toggle and menu icons blank.
  • Fix: Corrected all <link> tag syntax errors and updated them to use the correct SHA-512 integrity hashes.

🔄 Related Issue

Closes #1279

💻 Environment & Testing

  • Browsers Tested: Chrome / Firefox / Safari (via Playwright / Web Server testing)
  • Responsive Breakpoints Verified: Desktop (>1100px), Tablet (768px–1100px), and Mobile (<768px)

Copilot AI review requested due to automatic review settings June 23, 2026 15:11
@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

@omnipotentchaos is attempting to deploy a commit to the Anuj's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses several front-end UI/UX regressions in the web app (issue #1279), focusing on improving dark-mode contrast, preventing sidebar/content overlap on medium viewports, and fixing mobile navigation behavior and icon loading.

Changes:

  • Fixes “Surprise Me” hero button hover contrast in dark mode by updating hover text/icon color.
  • Aligns sidebar-aware layout padding breakpoints so medium screens (≥768px) don’t get overlapped by the docked sidebar.
  • Prevents scroll-based auto-opening of the sidebar on mobile and adds a manual mobile toggle/close flow, plus fixes FontAwesome link tag syntax/SRI.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
web-app/css/styles.css Adjusts responsive layout/media-query behavior and hover styling; includes formatting/organization updates.
web-app/js/main.js Updates sidebar observer + adds mobile sidebar toggle/close behaviors and aria-expanded syncing.
web-app/index.html Fixes FontAwesome <link> syntax and SRI hash.
web-app/404.html Fixes FontAwesome <link> syntax and SRI hash.
web-app/faq.html Fixes FontAwesome <link> syntax and SRI hash.
web-app/games.html Fixes FontAwesome <link> syntax and SRI hash.
web-app/math.html Fixes FontAwesome <link> syntax and SRI hash.
web-app/privacy-policy.html Fixes FontAwesome <link> syntax and SRI hash.
web-app/utilities.html Fixes FontAwesome <link> syntax and SRI hash.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread web-app/js/main.js
Comment on lines +372 to 374
if (window.innerWidth <= 768) {
closeMobileSidebar();
}
Comment thread web-app/js/main.js
Comment on lines +596 to +598
if (window.innerWidth <= 768) {
closeMobileSidebar();
}
Comment thread web-app/js/main.js
Comment on lines +624 to +626
if (window.innerWidth <= 768) {
closeMobileSidebar();
}
Comment thread web-app/js/main.js
Comment on lines +649 to +651
if (window.innerWidth <= 768) {
closeMobileSidebar();
}
Comment thread web-app/js/main.js
Comment on lines 742 to +745
const checkAndToggleSidebar = () => {
if (window.innerWidth <= 768) {
return;
}
Comment thread web-app/css/styles.css Outdated
}
}

@media (max-width: 768px) {
@steam-bell-92 steam-bell-92 added type:bug Something isn't working level:beginner gssoc:approved GSSoC 2026 approving tag labels Jun 23, 2026
@steam-bell-92
steam-bell-92 merged commit 793620e into steam-bell-92:main Jun 23, 2026
1 check failed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Thank you for your contribution!

Your Pull Request has been merged successfully.
Thanks again for your support! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC 2026 approving tag level:beginner type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 [Bug]: Surprise me button, on hovering, changes completely to white. also, also, this sidebar is also wrongly overlaying.

3 participants