Skip to content
Open
Changes from 3 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
164 changes: 87 additions & 77 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 @@ -52,93 +52,103 @@ const Navbar = () => {
" 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-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 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>
</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>
Comment on lines 101 to 120
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

replace hardcoded hex colors with design-token tailwind classes

both the desktop and mobile “contribute” buttons use arbitrary hex colors (bg-[#0d1117], hover:bg-[#161b22], border-[#30363d]), which violates the “never use hardcoded hex values” rule and bypasses the design token system.

please swap these for semantic tailwind classes backed by the design tokens (e.g. bg-surface-primary, hover:bg-surface-primary-hover, border-border-subtle, text-text-primary or similar from design-tokens.ts / tailwind.config.ts).

Also applies to: 140-148

{/* 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