Improved nav

This commit is contained in:
2026-02-02 14:15:51 +01:00
parent f3fd59c831
commit 9762f61a73
2 changed files with 44 additions and 31 deletions
+2 -3
View File
@@ -68,9 +68,8 @@ const Landing = () => {
className="text-xl text-muted-foreground max-w-2xl mx-auto mb-10 leading-relaxed animate-fade-in stagger-2 opacity-0" className="text-xl text-muted-foreground max-w-2xl mx-auto mb-10 leading-relaxed animate-fade-in stagger-2 opacity-0"
style={{ animationFillMode: "forwards" }} style={{ animationFillMode: "forwards" }}
> >
DevRun is competitive programming reimagined. Race the clock Race the clock through challenges, track your splits, and compete
through algorithmic challenges, track your splits, and compete for for the fastest runs on the global leaderboard.
the fastest runs on the global leaderboard.
</p> </p>
{/* CTA Buttons */} {/* CTA Buttons */}
+42 -28
View File
@@ -1,7 +1,36 @@
"use client";
import Link from "next/link"; import Link from "next/link";
import { Timer, Trophy, User, Zap } from "lucide-react"; import { Timer, Trophy, User, Zap } from "lucide-react";
import { usePathname } from "next/navigation";
import { cn } from "@/lib/utils";
const navs = [
{
link: "/problems",
icon: Zap,
name: "Problems",
},
{
link: "/run",
icon: Timer,
name: "Run",
},
{
link: "/leaderboards",
icon: Trophy,
name: "Leaderboards",
},
{
link: "/profile",
icon: User,
name: "Profile",
},
];
const Navbar = () => { const Navbar = () => {
const pathname = usePathname();
return ( return (
<nav className="fixed top-0 left-0 right-0 z-50 border-b border-border bg-background/80 backdrop-blur-xl"> <nav className="fixed top-0 left-0 right-0 z-50 border-b border-border bg-background/80 backdrop-blur-xl">
<div className="container mx-auto px-6"> <div className="container mx-auto px-6">
@@ -23,34 +52,19 @@ const Navbar = () => {
{/* Navigation Links */} {/* Navigation Links */}
<div className="hidden md:flex items-center gap-1"> <div className="hidden md:flex items-center gap-1">
<Link {navs.map(({ link, icon: Icon, name }) => (
href="/problems" <Link
className="flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-all duration-300 text-muted-foreground hover:text-foreground hover:bg-secondary" key={link}
> href={link}
<Zap className="h-4 w-4" /> className={cn(
Problems "flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-all duration-300 text-muted-foreground hover:text-foreground hover:bg-secondary",
</Link> pathname === link && "text-primary",
<Link )}
href="/run" >
className="flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-all duration-300 text-muted-foreground hover:text-foreground hover:bg-secondary" <Icon className="h-4 w-4" />
> {name}
<Timer className="h-4 w-4" /> </Link>
Run ))}
</Link>
<Link
href="/leaderboards"
className="flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-all duration-300 text-muted-foreground hover:text-foreground hover:bg-secondary"
>
<Trophy className="h-4 w-4" />
Leaderboards
</Link>
<Link
href="/profile"
className="flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-all duration-300 text-muted-foreground hover:text-foreground hover:bg-secondary"
>
<User className="h-4 w-4" />
Profile
</Link>
</div> </div>
{/* CTA Button */} {/* CTA Button */}