From 09faa758261eebdd6c4b6a0577f834f0b1d9879f Mon Sep 17 00:00:00 2001 From: Leo dev Date: Tue, 3 Feb 2026 17:00:21 +0100 Subject: [PATCH] Login and register --- src/app/login/page.tsx | 5 ++ src/app/register/page.tsx | 5 ++ src/components/app/Navbar.tsx | 30 ++------ src/components/auth/LoginPage.tsx | 95 +++++++++++++++++++++++ src/components/auth/RegisterPage.tsx | 69 +++++++++++++++++ src/components/ui/avatar.tsx | 109 +++++++++++++++++++++++++++ src/components/ui/button.tsx | 4 +- src/components/ui/label.tsx | 24 ++++++ 8 files changed, 317 insertions(+), 24 deletions(-) create mode 100644 src/app/login/page.tsx create mode 100644 src/app/register/page.tsx create mode 100644 src/components/auth/LoginPage.tsx create mode 100644 src/components/auth/RegisterPage.tsx create mode 100644 src/components/ui/avatar.tsx create mode 100644 src/components/ui/label.tsx diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx new file mode 100644 index 0000000..b489077 --- /dev/null +++ b/src/app/login/page.tsx @@ -0,0 +1,5 @@ +import { LoginPage } from "@/components/auth/LoginPage"; + +export default function Page() { + return ; +} diff --git a/src/app/register/page.tsx b/src/app/register/page.tsx new file mode 100644 index 0000000..1c5913b --- /dev/null +++ b/src/app/register/page.tsx @@ -0,0 +1,5 @@ +import { RegisterPage } from "@/components/auth/RegisterPage"; + +export default function Page() { + return ; +} diff --git a/src/components/app/Navbar.tsx b/src/components/app/Navbar.tsx index f157412..92b2d45 100644 --- a/src/components/app/Navbar.tsx +++ b/src/components/app/Navbar.tsx @@ -1,9 +1,10 @@ "use client"; import Link from "next/link"; -import { Radio, Trophy, Zap } from "lucide-react"; +import { Radio, Trophy, User, Zap } from "lucide-react"; import { usePathname } from "next/navigation"; import { cn } from "@/lib/utils"; +import { Avatar, AvatarFallback } from "../ui/avatar"; const navs = [ { @@ -46,7 +47,7 @@ const Navbar = () => { {/* Navigation Links */} -
+
{navs.map(({ link, icon: Icon, name }) => ( { {/* CTA Button */}
- - - {/* Mobile menu button */} - + {}}> + + + +
diff --git a/src/components/auth/LoginPage.tsx b/src/components/auth/LoginPage.tsx new file mode 100644 index 0000000..8e6720a --- /dev/null +++ b/src/components/auth/LoginPage.tsx @@ -0,0 +1,95 @@ +"use client"; + +import Link from "next/link"; +import { + ArrowRight, + Github, + KeyRound, + LogIn, + Mail, + UserRound, + Zap, +} from "lucide-react"; +import { Button } from "@/components/ui/button"; +import { + Card, + CardContent, + CardHeader, + CardTitle, + CardDescription, +} from "@/components/ui/card"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; + +export function LoginPage() { + return ( +
+ {/* Background glow */} +
+ + + +
+ +
+ Welcome back + + Log in to continue chasing your personal best. + +
+ + +
+
+ + +
+
+ + +
+
+ + + +
+
+ +
+
+ + Or continue with + +
+
+ +
+ + +
+ +

+ Don't have an account?{" "} + + Create one + +

+
+
+
+ ); +} diff --git a/src/components/auth/RegisterPage.tsx b/src/components/auth/RegisterPage.tsx new file mode 100644 index 0000000..7593a7e --- /dev/null +++ b/src/components/auth/RegisterPage.tsx @@ -0,0 +1,69 @@ +"use client"; + +import Link from "next/link"; +import { ArrowRight, Github, Mail, UserPlus, Zap } from "lucide-react"; +import { Button } from "@/components/ui/button"; +import { + Card, + CardContent, + CardHeader, + CardTitle, + CardDescription, +} from "@/components/ui/card"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; + +export function RegisterPage() { + return ( +
+ {/* Background glow */} +
+ + + +
+ +
+ Create your account + + Join the grind. Track runs, set records, compete globally. + +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + +

+ Already have an account?{" "} + + Log in + +

+
+
+
+ ); +} diff --git a/src/components/ui/avatar.tsx b/src/components/ui/avatar.tsx new file mode 100644 index 0000000..1ac1570 --- /dev/null +++ b/src/components/ui/avatar.tsx @@ -0,0 +1,109 @@ +"use client" + +import * as React from "react" +import { Avatar as AvatarPrimitive } from "radix-ui" + +import { cn } from "@/lib/utils" + +function Avatar({ + className, + size = "default", + ...props +}: React.ComponentProps & { + size?: "default" | "sm" | "lg" +}) { + return ( + + ) +} + +function AvatarImage({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AvatarFallback({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AvatarBadge({ className, ...props }: React.ComponentProps<"span">) { + return ( + svg]:hidden", + "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2", + "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", + className + )} + {...props} + /> + ) +} + +function AvatarGroup({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function AvatarGroupCount({ + className, + ...props +}: React.ComponentProps<"div">) { + return ( +
svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3", + className + )} + {...props} + /> + ) +} + +export { + Avatar, + AvatarImage, + AvatarFallback, + AvatarBadge, + AvatarGroup, + AvatarGroupCount, +} diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx index 8f9ce3d..78749fb 100644 --- a/src/components/ui/button.tsx +++ b/src/components/ui/button.tsx @@ -13,9 +13,9 @@ const buttonVariants = cva( destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60", outline: - "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50", + "border bg-background shadow-xs hover:bg-accent hover:text-primary dark:bg-input/30 dark:border-input dark:hover:bg-input/50", secondary: - "bg-secondary text-secondary-foreground hover:bg-secondary/80", + "bg-secondary text-secondary-foreground hover:bg-secondary/80 hover:text-primary", ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50", link: "text-primary underline-offset-4 hover:underline", diff --git a/src/components/ui/label.tsx b/src/components/ui/label.tsx new file mode 100644 index 0000000..1ac80f7 --- /dev/null +++ b/src/components/ui/label.tsx @@ -0,0 +1,24 @@ +"use client" + +import * as React from "react" +import { Label as LabelPrimitive } from "radix-ui" + +import { cn } from "@/lib/utils" + +function Label({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +export { Label }