Skip to content

Commit 0efd512

Browse files
committed
update github badge
1 parent 859d546 commit 0efd512

File tree

4 files changed

+109
-11
lines changed

4 files changed

+109
-11
lines changed

apps/web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"cmdk": "^1.1.1",
3737
"convex": "^1.29.0",
3838
"date-fns": "^4.1.0",
39+
"framer-motion": "^12.23.24",
3940
"lucide-react": "^0.553.0",
4041
"next": "16.0.1",
4142
"next-themes": "^0.4.6",

apps/web/src/app/(landing)/page.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { auth } from "@clerk/nextjs/server";
2-
import { ArrowRight } from "lucide-react";
2+
import { ArrowRight, ChevronRight, Sparkles } from "lucide-react";
33
import Image from "next/image";
44
import Link from "next/link";
55
import { redirect } from "next/navigation";
@@ -10,6 +10,7 @@ import {
1010
CardHeader,
1111
CardTitle,
1212
} from "@/components/ui/card";
13+
import HeroBadge from "@/components/ui/hero-badge";
1314

1415
export default async function Home() {
1516
const { userId } = await auth();
@@ -21,13 +22,16 @@ export default async function Home() {
2122
return (
2223
<div className="min-h-screen bg-background">
2324
{/* Hero Section */}
24-
<section className="max-w-6xl mx-auto px-4 py-32 sm:py-32 w-full bg-background">
25+
<section className="max-w-6xl mx-auto px-4 py-28 w-full bg-background">
2526
<div className="text-center space-y-8">
26-
{/* <Badge variant="outline" className="mx-auto">
27-
Albert Plus
28-
</Badge> */}
27+
<HeroBadge
28+
href="https://github.com/TechAtNYU/AlbertPlus"
29+
text="Open source on GitHub"
30+
icon={<Sparkles className="h-4 w-4" />}
31+
endIcon={<ChevronRight className="h-4 w-4" />}
32+
/>
2933

30-
<h1 className="text-4xl sm:text-5xl md:text-6xl font-bold tracking-tight text-foreground mt-10">
34+
<h1 className="text-4xl sm:text-5xl md:text-6xl font-bold tracking-tight text-foreground mt-6">
3135
Plan better. Track easier. <br />
3236
Graduate smarter.
3337
</h1>
@@ -47,10 +51,6 @@ export default async function Home() {
4751
<ArrowRight className="w-4 h-4" />
4852
</Link>
4953
</Button>
50-
51-
<Button asChild variant="outline" size="lg">
52-
<Link href="https://github.com/TechAtNYU/AlbertPlus">View on GitHub</Link>
53-
</Button>
5454
</div>
5555
</div>
5656
</section>
@@ -282,7 +282,7 @@ export default async function Home() {
282282
asChild
283283
size="lg"
284284
variant="outline"
285-
// className="gap-2 text-black dark:text-white bg-[#F8F8F8] dark:bg-gray-700 hover:bg-[#DFDFDF] dark:hover:bg-gray-600"
285+
// className="gap-2 text-black dark:text-white bg-[#F8F8F8] dark:bg-gray-700 hover:bg-[#DFDFDF] dark:hover:bg-gray-600"
286286
>
287287
<Link href="/sign-in">
288288
Get Extension
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
"use client";
2+
3+
import { motion, useAnimation, type Variants } from "framer-motion";
4+
import Link from "next/link";
5+
import { cn } from "@/lib/utils";
6+
7+
const ease = [0.16, 1, 0.3, 1];
8+
9+
interface HeroBadgeProps {
10+
href?: string;
11+
text: string;
12+
icon?: React.ReactNode;
13+
endIcon?: React.ReactNode;
14+
variant?: "default" | "outline" | "ghost";
15+
size?: "sm" | "md" | "lg";
16+
className?: string;
17+
onClick?: () => void;
18+
}
19+
20+
const badgeVariants: Record<string, string> = {
21+
default: "bg-background hover:bg-muted",
22+
outline: "border-2 hover:bg-muted",
23+
ghost: "hover:bg-muted/50",
24+
};
25+
26+
const sizeVariants: Record<string, string> = {
27+
sm: "px-3 py-1 text-xs gap-1.5",
28+
md: "px-4 py-1.5 text-sm gap-2",
29+
lg: "px-5 py-2 text-base gap-2.5",
30+
};
31+
32+
const iconAnimationVariants: Variants = {
33+
initial: { rotate: 0 },
34+
hover: { rotate: -10 },
35+
};
36+
37+
export default function HeroBadge({
38+
href,
39+
text,
40+
icon,
41+
endIcon,
42+
variant = "default",
43+
size = "md",
44+
className,
45+
onClick,
46+
}: HeroBadgeProps) {
47+
const controls = useAnimation();
48+
49+
const BadgeWrapper = href ? Link : motion.button;
50+
const wrapperProps = href ? { href } : { onClick };
51+
52+
const baseClassName = cn(
53+
"inline-flex items-center rounded-full border transition-colors",
54+
badgeVariants[variant],
55+
sizeVariants[size],
56+
className
57+
);
58+
59+
return (
60+
<BadgeWrapper
61+
{...wrapperProps}
62+
className={cn("group", href && "cursor-pointer")}
63+
>
64+
<motion.div
65+
className={baseClassName}
66+
initial={{ opacity: 0, y: -20 }}
67+
animate={{ opacity: 1, y: 0 }}
68+
transition={{ duration: 0.8, ease }}
69+
onHoverStart={() => controls.start("hover")}
70+
onHoverEnd={() => controls.start("initial")}
71+
>
72+
{icon && (
73+
<motion.div
74+
className="text-foreground/60 transition-colors group-hover:text-primary"
75+
variants={iconAnimationVariants}
76+
initial="initial"
77+
animate={controls}
78+
transition={{ type: "spring", stiffness: 300, damping: 10 }}
79+
>
80+
{icon}
81+
</motion.div>
82+
)}
83+
<span>{text}</span>
84+
{endIcon && (
85+
<motion.div className="text-foreground/60">{endIcon}</motion.div>
86+
)}
87+
</motion.div>
88+
</BadgeWrapper>
89+
);
90+
}

bun.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
"cmdk": "^1.1.1",
8989
"convex": "^1.29.0",
9090
"date-fns": "^4.1.0",
91+
"framer-motion": "^12.23.24",
9192
"lucide-react": "^0.553.0",
9293
"next": "16.0.1",
9394
"next-themes": "^0.4.6",
@@ -1523,6 +1524,8 @@
15231524

15241525
"formdata-polyfill": ["[email protected]", "", { "dependencies": { "fetch-blob": "^3.1.2" } }, "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g=="],
15251526

1527+
"framer-motion": ["[email protected]", "", { "dependencies": { "motion-dom": "^12.23.23", "motion-utils": "^12.23.6", "tslib": "^2.4.0" }, "peerDependencies": { "@emotion/is-prop-valid": "*", "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" }, "optionalPeers": ["@emotion/is-prop-valid", "react", "react-dom"] }, "sha512-HMi5HRoRCTou+3fb3h9oTLyJGBxHfW+HnNE25tAXOvVx/IvwMHK0cx7IR4a2ZU6sh3IX1Z+4ts32PcYBOqka8w=="],
1528+
15261529
"fs-extra": ["[email protected]", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ=="],
15271530

15281531
"fsevents": ["[email protected]", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],
@@ -1927,6 +1930,10 @@
19271930

19281931
"mnemonic-id": ["[email protected]", "", {}, "sha512-kysx9gAGbvrzuFYxKkcRjnsg/NK61ovJOV4F1cHTRl9T5leg+bo6WI0pWIvOFh1Z/yDL0cjA5R3EEGPPLDv/XA=="],
19291932

1933+
"motion-dom": ["[email protected]", "", { "dependencies": { "motion-utils": "^12.23.6" } }, "sha512-n5yolOs0TQQBRUFImrRfs/+6X4p3Q4n1dUEqt/H58Vx7OW6RF+foWEgmTVDhIWJIMXOuNNL0apKH2S16en9eiA=="],
1934+
1935+
"motion-utils": ["[email protected]", "", {}, "sha512-eAWoPgr4eFEOFfg2WjIsMoqJTW6Z8MTUCgn/GZ3VRpClWBdnbjryiA3ZSNLyxCTmCQx4RmYX6jX1iWHbenUPNQ=="],
1936+
19301937
"mrmime": ["[email protected]", "", {}, "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ=="],
19311938

19321939
"ms": ["[email protected]", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],

0 commit comments

Comments
 (0)