Skip to content

Commit 82dbb7b

Browse files
committed
Ui enhancemet pricing section
1 parent f00e7f4 commit 82dbb7b

File tree

7 files changed

+463
-217
lines changed

7 files changed

+463
-217
lines changed

app/page.tsx

Lines changed: 343 additions & 201 deletions
Large diffs are not rendered by default.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from "react";
2+
3+
export default function LandingEmerlandButton({
4+
children,
5+
}: {
6+
children: React.ReactNode;
7+
}) {
8+
return (
9+
<button className="border-emerald-600 hover:bg-emerald-600 transition-colors duration-300 border px-4 py-2 font-semibold rounded-xl text-sm">
10+
{children}
11+
</button>
12+
);
13+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
'use client'
2+
3+
import React from "react";
4+
import { motion } from "framer-motion";
5+
import { Card, CardContent, CardFooter, CardHeader } from "../ui/card";
6+
import LandingEmerlandButton from "./LandingEmerlandButton";
7+
8+
export interface PricingCardProps {
9+
title: string;
10+
description: string;
11+
price: string;
12+
features: string[];
13+
classname?: string;
14+
}
15+
16+
export default function PricingCard({
17+
title,
18+
description,
19+
price,
20+
features,
21+
classname
22+
}: PricingCardProps) {
23+
return (
24+
<motion.div
25+
whileHover={{ scale: 1.05 }}
26+
>
27+
<Card className={`${classname} rounded-2xl h-full flex flex-col justify-between`}>
28+
<CardHeader>
29+
<motion.h1
30+
initial={{ opacity: 0, y: -20 }}
31+
animate={{ opacity: 1, y: 0 }}
32+
transition={{ duration: 0.5 }}
33+
className="text-emerald-600 text-xl font-semibold"
34+
>
35+
{title}
36+
</motion.h1>
37+
</CardHeader>
38+
39+
<CardContent>
40+
<motion.div
41+
initial={{ opacity: 0, y: -20 }}
42+
animate={{ opacity: 1, y: 0 }}
43+
transition={{ duration: 0.5, delay: 0.2 }}
44+
className="mb-10 flex flex-col items-start justify-center"
45+
>
46+
<div>
47+
{price !== "Free" && (
48+
<p className="text-sm text-neutral-200">
49+
pause or cancel anytime
50+
</p>
51+
)}
52+
<h1 className="text-4xl font-bold pb-4">{price}</h1>
53+
</div>
54+
<p className="description text-xs text-neutral-200">{description}</p>
55+
</motion.div>
56+
<motion.ul className="space-y-1">
57+
{features.map((feature, index) => (
58+
<motion.li
59+
key={feature}
60+
initial={{ opacity: 0, x: -20 }}
61+
animate={{ opacity: 1, x: 0 }}
62+
transition={{ duration: 0.3, delay: index * 0.1 }}
63+
className="flex gap-2 text-sm"
64+
>
65+
<img src="/pricingtick.svg" alt="" /> <span>{feature}</span>
66+
</motion.li>
67+
))}
68+
</motion.ul>
69+
</CardContent>
70+
<CardFooter>
71+
<motion.div
72+
initial={{ opacity: 0, y: 20 }}
73+
animate={{ opacity: 1, y: 0 }}
74+
transition={{ duration: 0.5, delay: 0.5 }}
75+
>
76+
{price !== "Free" ? (
77+
<LandingEmerlandButton>Buy Now</LandingEmerlandButton>
78+
) : (
79+
<LandingEmerlandButton>Start Free Trial</LandingEmerlandButton>
80+
)}
81+
</motion.div>
82+
</CardFooter>
83+
</Card>
84+
</motion.div>
85+
);
86+
}
87+

components/ui/button.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const buttonVariants = cva(
1818
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
1919
ghost: "hover:bg-accent hover:text-accent-foreground",
2020
link: "text-primary underline-offset-4 hover:underline",
21+
2122
},
2223
size: {
2324
default: "h-10 px-4 py-2",

package-lock.json

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"class-variance-authority": "^0.7.1",
1818
"clsx": "^2.1.1",
1919
"embla-carousel-react": "^8.5.1",
20-
"framer-motion": "^11.15.0",
20+
"framer-motion": "^11.16.0",
2121
"lucide-react": "^0.469.0",
2222
"next": "15.1.2",
2323
"react": "^19.0.0",

public/pricingtick.svg

Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)