feat: built navbar component with active section tracking#18
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a site-wide sticky Navbar with section anchor links and active-section highlighting, plus global smooth-scrolling, to support single-page navigation on the landing page.
Changes:
- Introduces a new client-side
Navbarcomponent that tracks the active section viaIntersectionObserver. - Renders the
Navbarinapp/layout.tsxso it appears on every page. - Enables smooth scrolling for anchor navigation in global styles.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| components/Navbar.tsx | New sticky navbar with anchor links and IntersectionObserver-based active section tracking |
| app/layout.tsx | Imports and renders Navbar globally via the root layout |
| app/globals.css | Adds smooth scrolling behavior to global styles |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
28
to
32
| <body | ||
| className={`${geistSans.variable} ${geistMono.variable} antialiased`} | ||
| > | ||
| > <Navbar /> | ||
| {children} | ||
| </body> |
Comment on lines
31
to
36
| body { | ||
| background: var(--color-page-background); | ||
| color: var(--color-text-primary); | ||
| font-family: var(--font-sans); | ||
| scroll-behavior: smooth; | ||
| } |
Contributor
There was a problem hiding this comment.
Implemented in 34953b7: moved scroll-behavior: smooth; from body to :root in app/globals.css.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Member
|
Made a few fixes:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Creates the Navbar component with GPK logo on the left and anchor links (Home, About, Challenges, Team) on the right. Active section is tracked via IntersectionObserver and highlighted with a filled white box. Navbar is sticky, sits above all content, and includes a backdrop blur for readability over hero content. Imported into layout.tsx so it renders on every page. Also adds scroll-behavior: smooth to globals.css.
Closes Notion task 'Build Navbar Component'. (https://app.notion.com/p/graphicsprogrammingknights/T4-Navbar-Build-Navbar-component-37b4589a9ffa80a48c89ee3e72d14244?source=copy_link)
Type of Change
feat: New featurefix: Bug fixchore: Maintenance (dependencies, config, etc.)docs: Documentation onlystyle: Code style (formatting, no logic change)refactor: Code refactor (no new feature or fix)Changes Made
Screenshots (if applicable)
Checklist
npm run lintpasses without errorsnpm run buildcompletes successfullyRelated Issues