Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 89 additions & 79 deletions apps/web/src/components/landing-sections/navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"use client";
import React, { useState } from "react";
import PrimaryButton from "../ui/custom-button";
import { motion, useScroll, useMotionValueEvent } from "framer-motion";
import Image from "next/image";
import { Terminal, Github, Menu, X } from "lucide-react";
import { Github, Menu, Terminal, X } from "lucide-react";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { cn } from "@/lib/utils";
import PrimaryButton from "../ui/custom-button";

const Navbar = () => {
const { scrollYProgress } = useScroll();
Expand Down Expand Up @@ -37,7 +37,7 @@ const Navbar = () => {
{ name: "Pricing", href: "/pricing" },
{ name: "Features", href: "/#features" },
{ name: "Demo", href: "/#demo" },
{ name: "How it works", href: "/#HIW" },
{ name: "working", href: "/#HIW" },
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

inconsistent navigation link label

the link label "working" is inconsistent with other properly capitalized navigation items and appears incomplete. based on the href /#HIW (How It Works), this should likely be "How It Works" or "How it Works" to match the capitalization pattern of other links.

apply this diff:

-    { name: "working", href: "/#HIW" },
+    { name: "How It Works", href: "/#HIW" },
📝 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
{ name: "working", href: "/#HIW" },
{ name: "How It Works", href: "/#HIW" },
🤖 Prompt for AI Agents
In apps/web/src/components/landing-sections/navbar.tsx around line 40, the
navigation item label is "working" which is inconsistent and likely meant to be
"How It Works"; update the object so its name property is "How It Works" (or
"How it Works" to match project capitalization rules) ensuring the rest of the
nav array and any tests or i18n keys referencing this label are updated if
needed.

{ name: "Stats", href: "/#Stats" },
{ name: "Contact", href: "/#Contact" },
{ name: "FAQ", href: "/#faq" },
Expand All @@ -46,99 +46,109 @@ const Navbar = () => {
return (
<motion.nav
initial={{ opacity: 0 }}
animate={showNavbar ? { opacity: 1 } : { opacity: 0, display: 'none' }}
animate={showNavbar ? { opacity: 1 } : { opacity: 0, display: "none" }}
transition={{ duration: 0.3 }}
className={cn(
" z-40 flex items-center justify-between px-4 py-3 bg-neutral-900/5 backdrop-blur-xl border-white/10",
isPricingPage
? "relative h-max md:w-full top-0 border-b"
: "fixed rounded-3xl top-4 border w-[94%] md:w-[80%] mx-auto left-1/2 -translate-x-1/2"
: "fixed rounded-3xl top-4 border w-[96%] md:w-[80%] mx-auto left-1/2 -translate-x-1/2"
)}
>
<div className="flex items-center gap-3">
<button
className="md:hidden text-white"
onClick={() => setIsOpen(!isOpen)}
aria-label="Toggle navigation menu"
aria-expanded={isOpen}
>
{isOpen ? <X size={28} /> : <Menu size={28} />}
</button>
<div className="text-xl md:text-2xl font-medium tracking-tighter flex items-center gap-2">
<div className="w-8 md:w-10 aspect-square overflow-hidden relative">
<Image
src="/assets/logo.svg"
alt="background"
fill
className="object-cover w-full h-full"
/>
<div className="flex items-center gap-3 w-full justify-between">
{/* opensox logo */}
<div className="flex items-center gap-1 lg:gap-3">
<button
className="md:hidden text-white"
onClick={() => setIsOpen(!isOpen)}
aria-label="Toggle navigation menu"
aria-expanded={isOpen}
>
{isOpen ? <X size={28} /> : <Menu size={28} />}
</button>
<div className="text-base lg:text-2xl font-medium tracking-tighter flex items-center gap-2">
<div className="w-8 md:w-10 aspect-square overflow-hidden relative">
<Image
src="/assets/logo.svg"
alt="background"
fill
className="object-cover w-full h-full"
/>
</div>
<span className="text-nowrap">Opensox AI</span>
Comment on lines +70 to +78
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

image alt text is not descriptive

the logo image currently uses alt="background", which doesn’t describe the content and conflicts with the “provide alt text for images” guideline.

use a more meaningful alt, e.g. alt="opensox ai logo" so screen readers can correctly announce the brand.

🤖 Prompt for AI Agents
In apps/web/src/components/landing-sections/navbar.tsx around lines 70 to 78,
the logo Image uses alt="background" which is not descriptive; change the alt to
a meaningful label such as "Opensox AI logo" (or "Opensox AI" depending on style
guide) so screen readers announce the brand correctly, and ensure casing matches
other UI text.

</div>
<span>Opensox AI</span>
</div>
</div>
<div className="hidden md:flex items-center gap-5 tracking-tight text-lg font-light text-text-tertiary">
{links.map((link, index) => {
const isActive = pathname === link.href;
return (
<Link
key={index}
href={link.href}
className={cn(
"cursor-pointer hover:text-white",
isActive && "text-white"
)}
>
{link.name}
</Link>
);
})}
</div>
<div className="flex items-center gap-3">
<Link
href="https://github.com/apsinghdev/opensox"
target="_blank"
rel="noopener noreferrer"
className="hidden lg:flex items-center gap-2 px-4 py-2.5 bg-[#0d1117] hover:bg-[#161b22] transition-colors rounded-lg border border-[#30363d] text-white"
>
<Github className="w-5 h-5" />
<span className="text-sm font-medium">Contribute</span>
</Link>
<Link href="/dashboard/home" className="cursor-pointer z-30">
<PrimaryButton classname="px-3 py-2 text-sm whitespace-nowrap md:px-5 md:py-3 md:text-base">
<Terminal className="w-4 h-4 md:w-5 md:h-5" />
<span>Get Started</span>
</PrimaryButton>
</Link>
</div>
{isOpen && (
<motion.div
initial={{ opacity: 0, y: -10 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.25 }}
className="absolute top-full mt-2 left-0 w-full bg-neutral-900/90 backdrop-blur-xl border border-white/10 md:hidden flex flex-col items-center py-5 space-y-4 z-50 rounded-3xl"
>
{links.map((link, index) => (
<Link
key={index}
href={link.href}
onClick={() => setIsOpen(false)}
className="text-white hover:text-gray-300 text-lg"
>
{link.name}
</Link>
))}
{/* links to be rendered */}
<div className="hidden md:flex items-center gap-5 tracking-tight text-sm lg:text-base xl:text-lg font-light text-text-tertiary">
{links.map((link, index) => {
const isActive = pathname === link.href;
return (
<Link
key={index}
href={link.href}
className={cn(
"cursor-pointer hover:text-white text-sm lg:text-base",
isActive && "text-white"
)}
>
{link.name}
</Link>
);
})}
</div>

{/* git link */}
<div className="flex items-center gap-3">
<Link
href="https://github.com/apsinghdev/opensox"
target="_blank"
rel="noopener noreferrer"
onClick={() => setIsOpen(false)}
className="flex items-center gap-2 px-4 py-2 bg-[#0d1117] hover:bg-[#161b22] rounded-lg border border-[#30363d] text-white transition-colors"
className="hidden xl:flex items-center gap-2 px-4 py-2.5 bg-[#0d1117] hover:bg-[#161b22] transition-colors rounded-lg border border-[#30363d] text-white"
>
<Github className="w-5 h-5" />
<span className="text-sm font-medium">Contribute</span>
</Link>
</motion.div>
)}
<Link
href="/dashboard/home"
className="flex md:hidden lg:flex cursor-pointer z-30"
>
<PrimaryButton classname=" px-3 py-2 text-sm whitespace-nowrap md:px-5 md:py-3 md:text-base">
<Terminal className="w-4 h-4 md:w-5 md:h-5" />
<span>Get Started</span>
</PrimaryButton>
</Link>
</div>
{/* mobile nav dropdown */}
{isOpen && (
<motion.div
initial={{ opacity: 0, y: -10 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.25 }}
className="absolute top-full mt-2 left-0 w-full bg-neutral-900/90 backdrop-blur-xl border border-white/10 md:hidden flex flex-col items-center py-5 space-y-4 z-50 rounded-3xl"
>
{links.map((link, index) => (
<Link
key={index}
href={link.href}
onClick={() => setIsOpen(false)}
className="text-white hover:text-gray-300 text-lg"
>
{link.name}
</Link>
))}
<Link
href="https://github.com/apsinghdev/opensox"
target="_blank"
rel="noopener noreferrer"
onClick={() => setIsOpen(false)}
className="flex items-center gap-2 px-4 py-2 bg-[#0d1117] hover:bg-[#161b22] rounded-lg border border-[#30363d] text-white transition-colors"
>
<Github className="w-5 h-5" />
<span className="text-sm font-medium">Contribute</span>
</Link>
</motion.div>
)}
</div>
</motion.nav>
);
};
Expand Down