Skip to content

Fix navbar#340

Open
mayankrajput5455 wants to merge 2 commits intoAOSSIE-Org:mainfrom
mayankrajput5455:main
Open

Fix navbar#340
mayankrajput5455 wants to merge 2 commits intoAOSSIE-Org:mainfrom
mayankrajput5455:main

Conversation

@mayankrajput5455
Copy link

@mayankrajput5455 mayankrajput5455 commented Mar 16, 2026

Description

The sticky navbar remained visible throughout the entire page, including sections where it visually conflicted with the bottom sections and some readable part also get under the navbar.

Fixes # (264)

Type of change

  • Added a scroll trigger at the end of the features section

  • Implemented scroll detection in Navbar component

  • Navbar now hides after the "Real-time messaging" feature

  • Also decrease the opacity of navbar background that text should not visible from there.

  • Bug fix (non-breaking CHANGE which fixes an issue)

  • New feature (non-breaking change which adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

  • Refactor (does not change functionality, e.g. code style improvements, linting)

  • UI/UX update (design changes, interface improvements)

How Has This Been Tested?

  • Ran the application locally using npm install and npm run dev.
  • Opened the website in the browser at http://localhost:3000.
  • Scrolled through the page from the hero section down to the features section.
  • Verified that the navbar remains visible through all feature sections including Real-time messaging.
  • Continued scrolling past the features section to the Tech Stack and footer sections.
  • Confirmed that the navbar hides correctly after the features section and no longer overlaps visually with the footer area.
  • Tested responsiveness on different screen sizes (desktop and mobile view using browser dev tools).
WhatsApp.Video.2026-03-16.at.10.21.31.AM.mp4

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Maintainer Checklist

Summary by CodeRabbit

Release Notes

  • New Features

    • Navbar now automatically hides and shows based on scroll position
    • Enhanced mobile navigation with animated hamburger menu
    • Added anchor link for features section
  • Style

    • Improved navbar visual styling with stronger background, enhanced blur, border, and shadow effects
    • Added smooth animations for navbar transitions

@mayankrajput5455 mayankrajput5455 requested a review from a team as a code owner March 16, 2026 04:55
@coderabbitai
Copy link

coderabbitai bot commented Mar 16, 2026

📝 Walkthrough

Walkthrough

This PR enhances the navbar's visual presentation and interaction model by introducing scroll-based visibility toggling with improved styling. It adds blur effects, enhanced shadows, and show/hide animations to the navbar, plus a marker-based scroll detector. Additionally, a Features section anchor point is added.

Changes

Cohort / File(s) Summary
Navbar Styling
app/components/Layout/NavBar/Navbar.css
Enhanced navbar appearance with stronger translucent background, increased blur, backdrop-filter effects, and border/shadow properties. Introduces .navbar.hide and .navbar.show classes for vertical slide and opacity animations, plus .navbar.scrolled state for adjusted styling during scroll. Adds responsive mobile hamburger and menu animation styling.
Navbar Logic
app/components/Layout/NavBar/index.jsx
Adds scroll event detection via useEffect with marker element tracking to toggle navbar visibility. Introduces handleToggleMenu for mobile menu state inversion and simplifies handleLinkClick. Applies dynamic classNames (show/hide) based on visibility state with smooth CSS transitions.
Features Anchor
app/components/Features/Features.jsx
Adds DOM anchor id (features-end) to the last feature item when feature.id equals 4, enabling in-page navigation without altering component rendering logic.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Browser
    participant Navbar as Navbar Component
    participant Marker as Marker Element
    participant DOM

    User->>Browser: Scrolls page
    Browser->>Navbar: Fires scroll event
    Navbar->>Marker: Checks marker position via getBoundingClientRect()
    
    alt Marker in viewport
        Navbar->>Navbar: Set visible = true
    else Marker out of viewport
        Navbar->>Navbar: Set visible = false
    end
    
    Navbar->>DOM: Apply className: "navbar show" or "navbar hide"
    DOM->>DOM: Trigger CSS transition animation
    DOM->>User: Navbar smoothly animates in/out
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

new-design

Suggested reviewers

  • M4dhav

Poem

🐰 A navbar that dances with every scroll,
Hiding and showing to keep things whole,
With blur and shadow, a visual delight,
The Features anchor guides users just right,
Polish and grace in each animated glide! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The addition of anchor id='features-end' to the Features component is out of scope and not mentioned in linked issue #262, which focuses on navbar styling and visibility. Remove the unrelated feature item anchor ID change or clarify its purpose in a separate issue, as it is not part of the navbar fix requirements.
Title check ❓ Inconclusive The title 'Fix navbar' is vague and generic. While it refers to a real change, it doesn't clearly convey what the fix actually accomplishes—scroll detection, visibility toggling, styling improvements, or all of these. Use a more specific title such as 'Add scroll-based navbar hiding and improve styling' or 'Implement navbar visibility toggle on scroll' to better clarify the main changes.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The pull request addresses issue #262 by implementing scroll-based navbar visibility, improving styling with blur/shadow, and adjusting opacity, which aligns with the proposed solutions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mayankrajput5455 mayankrajput5455 changed the title Fix navbar #262 Fix navbar Mar 16, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
app/components/Layout/NavBar/index.jsx (1)

41-41: navbar.scrolled styles are currently unreachable from JSX.

Line 41 only toggles show/hide, but CSS defines .navbar.scrolled styles. Either wire a scrolled class from component state or remove the unused CSS block to avoid dead styling paths.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/components/Layout/NavBar/index.jsx` at line 41, The JSX for the nav only
toggles visibility via the className expression `navbar ${visible ? "show" :
"hide"}` while the stylesheet contains a `.navbar.scrolled` rule that never gets
applied; either add component state/logic to track scroll (e.g., a `scrolled`
boolean in the NavBar component) and include it in the nav's className alongside
`visible` so the `scrolled` class can be emitted, or remove the
`.navbar.scrolled` CSS block; update references to the nav element and the
className expression in NavBar (`nav` element and the `visible` variable usage)
accordingly so the scrolled styling is reachable when appropriate.
app/components/Features/Features.jsx (1)

40-43: Avoid hard-coding the marker to feature.id === 4.

Line 43 couples navbar behavior to a specific data value. If feature IDs/order change, the features-end marker disappears and scroll detection breaks. Prefer assigning the marker to the last rendered feature item.

♻️ Suggested fix
-      {featuresData.map((feature) => (
+      {featuresData.map((feature, index) => (
         <div
           key={feature.id}
-          id={feature.id === 4 ? "features-end" : undefined}
+          id={index === featuresData.length - 1 ? "features-end" : undefined}
           className={`feature-item ${
             feature.align === "right" ? "reverse" : ""
           }`}
         >
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/components/Features/Features.jsx` around lines 40 - 43, The code
currently hard-codes the marker to feature.id === 4; update the featuresData.map
callback to use the map index and assign id="features-end" to the last rendered
item instead (e.g., map((feature, index) => ...) and check index ===
featuresData.length - 1) so the marker is always on the final feature; change
the id assignment that references feature.id to use the index check in the
Features.jsx component where featuresData.map is used.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/components/Layout/NavBar/index.jsx`:
- Around line 21-38: The effect should initialize visibility on mount and handle
the missing "#features-end" element explicitly: inside the useEffect, after
defining handleScroll, call handleScroll() once to evaluate initial state, and
change the early return when marker is not found to setVisible(true) (or the
intended default) instead of returning so visibility can't remain stale; update
references to handleScroll and setVisible to implement this logic for the
"features-end" element.

In `@app/components/Layout/NavBar/Navbar.css`:
- Around line 2-22: The .navbar rule in Navbar.css has extra blank lines before
several declarations causing stylelint's declaration-empty-line-before failures;
open the .navbar selector (the block containing background, backdrop-filter,
color, padding, margin, border-radius, max-width, width, position, top, z-index,
transition, border, box-shadow) and remove the empty lines so each declaration
directly follows the previous one (or follow your project's configured spacing
convention), ensuring there are no blank lines immediately before declarations
that triggered the linter errors.

---

Nitpick comments:
In `@app/components/Features/Features.jsx`:
- Around line 40-43: The code currently hard-codes the marker to feature.id ===
4; update the featuresData.map callback to use the map index and assign
id="features-end" to the last rendered item instead (e.g., map((feature, index)
=> ...) and check index === featuresData.length - 1) so the marker is always on
the final feature; change the id assignment that references feature.id to use
the index check in the Features.jsx component where featuresData.map is used.

In `@app/components/Layout/NavBar/index.jsx`:
- Line 41: The JSX for the nav only toggles visibility via the className
expression `navbar ${visible ? "show" : "hide"}` while the stylesheet contains a
`.navbar.scrolled` rule that never gets applied; either add component
state/logic to track scroll (e.g., a `scrolled` boolean in the NavBar component)
and include it in the nav's className alongside `visible` so the `scrolled`
class can be emitted, or remove the `.navbar.scrolled` CSS block; update
references to the nav element and the className expression in NavBar (`nav`
element and the `visible` variable usage) accordingly so the scrolled styling is
reachable when appropriate.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d02a2172-1d1f-4134-9377-acda806e7b41

📥 Commits

Reviewing files that changed from the base of the PR and between ee40ec9 and f516d09.

📒 Files selected for processing (3)
  • app/components/Features/Features.jsx
  • app/components/Layout/NavBar/Navbar.css
  • app/components/Layout/NavBar/index.jsx

Comment on lines +21 to +38
useEffect(() => {
const handleScroll = () => {
const marker = document.getElementById("features-end");

if (!marker) return;

// Toggle mobile menu
const handleToggleMenu = useCallback(() => setOpen((prev) => !prev), []);
const markerTop = marker.getBoundingClientRect().top;

if (markerTop < 80) {
setVisible(false);
} else {
setVisible(true);
}
};

window.addEventListener("scroll", handleScroll);
return () => window.removeEventListener("scroll", handleScroll);
}, []);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Handle missing marker safely and initialize visibility on mount.

Line 25 exits without updating state, so visibility can become stale when #features-end is absent. Also, the effect never evaluates once on mount, so a refresh below the marker won’t hide the navbar until the next scroll event.

🛠️ Suggested fix
   useEffect(() => {
     const handleScroll = () => {
       const marker = document.getElementById("features-end");

-      if (!marker) return;
+      if (!marker) {
+        setVisible(true);
+        return;
+      }

       const markerTop = marker.getBoundingClientRect().top;

       if (markerTop < 80) {
         setVisible(false);
       } else {
         setVisible(true);
       }
     };

+    handleScroll(); // initialize state for current scroll position
     window.addEventListener("scroll", handleScroll);
     return () => window.removeEventListener("scroll", handleScroll);
   }, []);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
useEffect(() => {
const handleScroll = () => {
const marker = document.getElementById("features-end");
if (!marker) return;
// Toggle mobile menu
const handleToggleMenu = useCallback(() => setOpen((prev) => !prev), []);
const markerTop = marker.getBoundingClientRect().top;
if (markerTop < 80) {
setVisible(false);
} else {
setVisible(true);
}
};
window.addEventListener("scroll", handleScroll);
return () => window.removeEventListener("scroll", handleScroll);
}, []);
useEffect(() => {
const handleScroll = () => {
const marker = document.getElementById("features-end");
if (!marker) {
setVisible(true);
return;
}
const markerTop = marker.getBoundingClientRect().top;
if (markerTop < 80) {
setVisible(false);
} else {
setVisible(true);
}
};
handleScroll(); // initialize state for current scroll position
window.addEventListener("scroll", handleScroll);
return () => window.removeEventListener("scroll", handleScroll);
}, []);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/components/Layout/NavBar/index.jsx` around lines 21 - 38, The effect
should initialize visibility on mount and handle the missing "#features-end"
element explicitly: inside the useEffect, after defining handleScroll, call
handleScroll() once to evaluate initial state, and change the early return when
marker is not found to setVisible(true) (or the intended default) instead of
returning so visibility can't remain stale; update references to handleScroll
and setVisible to implement this logic for the "features-end" element.

Comment on lines +2 to +22
background: rgba(10, 10, 10, 0.75);
backdrop-filter: blur(14px);
-webkit-backdrop-filter: blur(14px);

color: white;
padding: 15px 30px;
margin: 20px auto;

border-radius: 50px;
max-width: 1200px;
width: 90%;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);

position: sticky;
top: 20px;
z-index: 1000;

transition: transform 0.3s ease, opacity 0.3s ease;

border: 1px solid rgba(255,255,255,0.08);
box-shadow: 0 8px 20px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix Stylelint failures in .navbar declaration spacing.

The empty lines before declarations in this block (e.g., Line 6, Line 10, Line 14, Line 18, Line 20) match the reported declaration-empty-line-before errors and can fail lint checks.

🧹 Suggested fix
 .navbar {
   background: rgba(10, 10, 10, 0.75);
   backdrop-filter: blur(14px);
   -webkit-backdrop-filter: blur(14px);
-
   color: white;
   padding: 15px 30px;
   margin: 20px auto;
-
   border-radius: 50px;
   max-width: 1200px;
   width: 90%;
-
   position: sticky;
   top: 20px;
   z-index: 1000;
-
   transition: transform 0.3s ease, opacity 0.3s ease;
-
   border: 1px solid rgba(255,255,255,0.08);
   box-shadow: 0 8px 20px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
background: rgba(10, 10, 10, 0.75);
backdrop-filter: blur(14px);
-webkit-backdrop-filter: blur(14px);
color: white;
padding: 15px 30px;
margin: 20px auto;
border-radius: 50px;
max-width: 1200px;
width: 90%;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
position: sticky;
top: 20px;
z-index: 1000;
transition: transform 0.3s ease, opacity 0.3s ease;
border: 1px solid rgba(255,255,255,0.08);
box-shadow: 0 8px 20px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
}
background: rgba(10, 10, 10, 0.75);
backdrop-filter: blur(14px);
-webkit-backdrop-filter: blur(14px);
color: white;
padding: 15px 30px;
margin: 20px auto;
border-radius: 50px;
max-width: 1200px;
width: 90%;
position: sticky;
top: 20px;
z-index: 1000;
transition: transform 0.3s ease, opacity 0.3s ease;
border: 1px solid rgba(255,255,255,0.08);
box-shadow: 0 8px 20px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
}
🧰 Tools
🪛 Stylelint (17.4.0)

[error] 6-6: Unexpected empty line before declaration (declaration-empty-line-before)

(declaration-empty-line-before)


[error] 10-10: Unexpected empty line before declaration (declaration-empty-line-before)

(declaration-empty-line-before)


[error] 14-14: Unexpected empty line before declaration (declaration-empty-line-before)

(declaration-empty-line-before)


[error] 18-18: Unexpected empty line before declaration (declaration-empty-line-before)

(declaration-empty-line-before)


[error] 20-20: Unexpected empty line before declaration (declaration-empty-line-before)

(declaration-empty-line-before)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/components/Layout/NavBar/Navbar.css` around lines 2 - 22, The .navbar
rule in Navbar.css has extra blank lines before several declarations causing
stylelint's declaration-empty-line-before failures; open the .navbar selector
(the block containing background, backdrop-filter, color, padding, margin,
border-radius, max-width, width, position, top, z-index, transition, border,
box-shadow) and remove the empty lines so each declaration directly follows the
previous one (or follow your project's configured spacing convention), ensuring
there are no blank lines immediately before declarations that triggered the
linter errors.

@reach2saksham
Copy link

Hi @mayankrajput5455, we keep the navbar sticky throughout the page so users can easily see the key CTAs (Click to Actions) like Download Now, GitHub link, etc. Your approach currently undermines that logic, neither reducing the navbar's heaviness nor improving CTA accessibility throughout. It hides the navbar in particular sections at the end for no specific reason. I think you should discuss some approaches to the related issue first and then create a PR.

@mayankrajput5455
Copy link
Author

Hello @reach2saksham can u plz mentor me i m new in this open source thing.
Can u tell me exactly what i can change in the code so the navbar will be perfect and tell me if i can work on footer also because it also not have proper content.
Thank 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.

Issue: Fixed Navbar UI Breaks Visual Flow while Scrolling

2 participants