Skip to content

Commit 05e1f75

Browse files
committed
feat: improve pricing sections with spotlight
1 parent 27735fb commit 05e1f75

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/components/sections/PricingSection.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ export function PricingSection({ content, locale, packages, paymentPeriod }: Pri
104104
duration={0.42}
105105
className="relative flex h-full min-w-0 flex-col overflow-hidden rounded-3xl border border-white/5 bg-[linear-gradient(160deg,rgba(255,255,255,0.08),rgba(255,255,255,0.02)_28%,rgba(8,10,20,0.6)_100%)] p-6 md:p-8"
106106
>
107+
{highlighted && <div aria-hidden="true" className="pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_top,oklch(1_0_0/0.1),transparent_36%)]" />}
107108
<div className="pointer-events-none absolute inset-x-0 top-0 h-px bg-linear-to-r from-transparent via-white/30 to-transparent" />
108109
{discount > 0 && (
109110
<StableBadge

src/components/sections/SmallPricingSection.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,25 @@ export function SmallPricingSection({ content, locale, packages }: SmallPricingS
7272
animation={{ preset: "none" }}
7373
>
7474
<Card size="lg" variant="light" radialGradient={content.gradient} gradientDirection={content.gradientDirection} className="mx-auto w-full max-w-5xl p-2!">
75+
<div
76+
aria-hidden="true"
77+
className="pointer-events-none absolute inset-y-0 left-1/3 hidden w-1/3 bg-[radial-gradient(ellipse_at_top,oklch(1_0_0/0.1),transparent_68%)] md:block"
78+
/>
7579
<StaggerContainer className="relative z-10 grid grid-cols-1 md:grid-cols-3" delayChildren={0.04} staggerChildren={0.08}>
7680
{pricingPackages.map((pricingPackage) => {
7781
const features = pricingPackage.content?.features?.filter((feature) => Boolean(feature.text)) ?? []
7882
const missingFeatures = pricingPackage.content?.missingFeatures?.filter((feature) => Boolean(feature.text)) ?? []
7983
const buttonLabel = pricingPackage.content?.button?.label?.trim()
8084
const buttonUrl = pricingPackage.content?.button?.url?.trim()
85+
const highlighted = pricingPackage.key === "max"
8186
const discount =
8287
selectedPeriod !== "monthly" && pricingPackage.price !== null && pricingPackage.monthlyPrice !== null && pricingPackage.monthlyPrice > 0
8388
? Math.max(0, Math.round((1 - pricingPackage.price / (pricingPackage.monthlyPrice * periodMonths)) * 100))
8489
: 0
8590

8691
return (
87-
<StaggerItem key={pricingPackage.key} y={10} duration={0.36} className="flex min-w-0 flex-col p-5 sm:p-6">
92+
<StaggerItem key={pricingPackage.key} y={10} duration={0.36} className="relative flex min-w-0 flex-col overflow-hidden p-5 sm:p-6">
93+
{highlighted && <div aria-hidden="true" className="pointer-events-none absolute inset-0 bg-[radial-gradient(ellipse_at_top,oklch(1_0_0/0.1),transparent_68%)] md:hidden" />}
8894
<div className="flex items-start justify-between gap-2">
8995
<h3 className="text-xl font-semibold text-white">{pricingPackage.title}</h3>
9096
{discount > 0 && (

0 commit comments

Comments
 (0)