UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.
✨ feat: add buy page + bug fixes
Dillion Verma0f2b03965f97
diff --git a/app/(docs)/components/page.tsx b/app/(docs)/components/page.tsxindex d71c2d5e..f5f52044 100644--- a/app/(docs)/components/page.tsx+++ b/app/(docs)/components/page.tsx@@ -1,5 +1,5 @@import { constructMetadata } from "@/lib/utils";-import { FadeIn } from "@/registry/components/magicui/fade-in";+import FadeIn from "@/registry/components/magicui/fade-in";import { allComponents } from "contentlayer/generated";import { compareDesc } from "date-fns";import Link from "next/link";diff --git a/app/(docs)/templates/page.tsx b/app/(docs)/templates/page.tsxindex dadb7627..a3264e53 100644--- a/app/(docs)/templates/page.tsx+++ b/app/(docs)/templates/page.tsx@@ -1,6 +1,6 @@import { Component } from "@/.contentlayer/generated";import { constructMetadata } from "@/lib/utils";-import { FadeIn } from "@/registry/components/magicui/fade-in";+import FadeIn from "@/registry/components/magicui/fade-in";import Link from "next/link";export const metadata = constructMetadata({diff --git a/app/(marketing)/buy/page.tsx b/app/(marketing)/buy/page.tsxnew file mode 100644index 00000000..052d2aa8--- /dev/null+++ b/app/(marketing)/buy/page.tsx@@ -0,0 +1,163 @@+import { buttonVariants } from "@/components/ui/button";+import { absoluteUrl, cn, constructMetadata } from "@/lib/utils";+import DotPattern from "@/registry/components/magicui/dot-pattern";+import FadeIn from "@/registry/components/magicui/fade-in";+import GridPattern from "@/registry/components/magicui/grid-pattern";+import LinearGradient from "@/registry/components/magicui/linear-gradient";+import {+ MagicCard,+ MagicContainer,+} from "@/registry/components/magicui/magic-card";+import Meteors from "@/registry/components/magicui/meteors";+import { ExternalLinkIcon } from "lucide-react";+import Link from "next/link";++export const metadata = constructMetadata({+ title:+ // 30 - 65 chars+ "Lifetime Access to Beautifully Crafted Tailwind CSS Components",+ // "Lifetime Access to Beautifully Crafted React + Tailwind CSS + Framer Motion Components and Templates",+ description:+ "Get lifetime access to beautifully crafted React + Tailwind CSS + Framer Motion components and templates for your next web project. Get lifetime access to all components and templates",+ image: absoluteUrl(`/api/og`),+});++export default function Buy() {+ const plans = [+ {+ name: "Magic UI",+ desc: "Beautifully crafted React + Tailwind CSS + Framer Motion components and templates for your next web project.",+ discountPrice: 49,+ price: 79,+ isMostPop: false,+ features: [+ "100+ components (coming soon)",+ "50+ building blocks (coming soon)",+ "5+ full templates (coming soon)",+ "Lifetime Access",+ "Lifetime Updates",+ ],+ },+ ];++ return (+ <section className="py-14">+ <div className="max-w-screen-xl mx-auto px-4 md:px-8">+ <div className="mx-auto max-w-2xl text-center">+ <FadeIn>+ <h4 className="text-xl font-bold tracking-tight text-foreground">+ Magic UI+ </h4>+ </FadeIn>+ <FadeIn delay={0.1}>+ <h2 className="text-5xl font-bold tracking-tight text-foreground sm:text-7xl">+ Lifetime Access+ </h2>+ </FadeIn>+ <FadeIn delay={0.2}>+ <p className="mt-6 text-xl leading-8 text-foreground/60">+ Get <strong>lifetime access</strong> to all components and+ templates available today , plus any new ones we add in the future+ for a simple one-time price.+ </p>+ </FadeIn>+ </div>+ <MagicContainer className="mt-16 justify-center gap-6 flex items-center">+ {plans.map((item, idx) => (+ <FadeIn key={idx} delay={0.3}>+ <MagicCard+ spotlight={false}+ className="flex flex-col gap-8 overflow-hidden p-8 cursor-pointer w-[400px] max-w-max"+ >+ <div className="flex flex-col space-y-4">+ <span className="text-foreground font-medium">+ {item.name}+ </span>+ <div className="flex flex-row gap-2">+ <span className="text-7xl text-foreground font-semibold">+ ${item.discountPrice}+ </span>+ <span className="line-through text-4xl text-gray-700 font-normal">+ ${item.price}+ </span>+ </div>+ {/* <span className="text-xl text-foreground/20 font-semibold">+ one-time payment+ </span> */}+ <p className="text-foreground">{item.desc}</p>+ <Link+ href="https://buy.stripe.com/00g7vD4Vu8zQb8k5kl?prefilled_promo_code=EARLYBIRD"+ className={cn(+ buttonVariants({ variant: "default", size: "lg" }),+ "w-full"+ )}+ >+ Get Lifetime Access+ <ExternalLinkIcon className="ml-2 h-4 w-4" />+ </Link>+ </div>+ <ul className="space-y-3">+ <li className="pb-2 text-foreground font-medium">+ <p>Features</p>+ </li>+ {item.features.map((featureItem, idx) => (+ <li+ key={idx}+ className="flex items-center gap-5 text-foreground"+ >+ <svg+ xmlns="http://www.w3.org/2000/svg"+ className="h-5 w-5 text-foreground"+ viewBox="0 0 20 20"+ fill="currentColor"+ >+ <path+ fillRule="evenodd"+ d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"+ clipRule="evenodd"+ ></path>+ </svg>+ {featureItem}+ </li>+ ))}+ </ul>++ <Meteors />+ <DotPattern+ width={20}+ height={20}+ x={-10}+ y={-10}+ cx={1}+ cy={1}+ cr={1}+ className={cn(+ "absolute w-full h-full inset-0 fill-white/20",+ "[mask-image:linear-gradient(to_top_left,white,transparent,transparent)]"+ )}+ />+ </MagicCard>+ </FadeIn>+ ))}+ </MagicContainer>+ </div>+ <GridPattern+ width={80}+ height={80}+ x={-1}+ y={-1}+ className={cn(+ "absolute w-screen h-screen inset-0 stroke-white/10 fill-white/10",+ "[mask-image:linear-gradient(to_bottom_right,white,transparent,transparent)] -z-50",+ "skew-y-12 inset-x-0 h-[70%] -z-50"+ )}+ />+ <LinearGradient+ className="w-screen h-screen"+ from="rgba(120,119,198,0.3)"+ to="rgba(0,0,0,0.0)"+ direction="bottom right"+ />+ </section>+ );+}diff --git a/app/(marketing)/page.tsx b/app/(marketing)/page.tsxindex 47f8bfbf..a5eab0b8 100644--- a/app/(marketing)/page.tsx+++ b/app/(marketing)/page.tsx@@ -1,7 +1,7 @@import { buttonVariants } from "@/components/ui/button";import { Separator } from "@/components/ui/separator";import { cn } from "@/lib/utils";-import { FadeIn } from "@/registry/components/magicui/fade-in";+import FadeIn from "@/registry/components/magicui/fade-in";import Marquee from "@/registry/components/magicui/marquee";import { ServerTweetCard } from "@/registry/components/magicui/tweet-card";import { ChevronRight } from "lucide-react";@@ -113,19 +113,16 @@ export default async function Home() {delay={0.2}><div className="flex flex-col md:flex-row gap-4">- <Link- href="/components"- className={cn(buttonVariants({ size: "lg" }))}- >- Get Started+ <Link href="/buy" className={cn(buttonVariants({ size: "lg" }))}>+ Buy Now</Link><Link- href="https://twitter.com/dillionverma"+ href="/components"className={cn(buttonVariants({ variant: "outline", size: "lg" }))}>- Follow along on Twitter+ Get Started</Link></div></FadeIn>diff --git a/config/docs.ts b/config/docs.tsindex 300e865d..4f39b285 100644--- a/config/docs.ts+++ b/config/docs.ts@@ -13,10 +13,10 @@ export const docsConfig: DocsConfig = {title: "Components",href: "/components",},- // {- // title: "Templates",- // href: "/templates",- // },+ {+ title: "Buy",+ href: "/buy",+ },],sidebarNav: [{diff --git a/registry/components/example/magic-card-demo.tsx b/registry/components/example/magic-card-demo.tsxindex cd60dc0e..9e7cc212 100644--- a/registry/components/example/magic-card-demo.tsx+++ b/registry/components/example/magic-card-demo.tsx@@ -10,13 +10,13 @@ export default function MagicCardWithGradient() {"flex flex-col gap-4 h-[500px] lg:h-[250px] w-full lg:flex-row"}>- <MagicCard className="cursor-pointer shadow-2xl flex flex-col justify-center items-center overflow-hidden dark:bg-background bg-white p-6">+ <MagicCard className="cursor-pointer shadow-2xl flex flex-col justify-center items-center overflow-hidden p-20 w-full"><p className="text-4xl font-medium whitespace-nowrap text-gray-800 dark:text-gray-200 z-10">Magic</p><div className="pointer-events-none h-full absolute inset-0 bg-[radial-gradient(circle_at_50%_120%,rgba(120,119,198,0.3),rgba(255,255,255,0))]" /></MagicCard>- <MagicCard className="cursor-pointer shadow-2xl flex justify-center items-center overflow-hidden dark:bg-background bg-white">+ <MagicCard className="cursor-pointer shadow-2xl flex flex-col justify-center items-center overflow-hidden p-20 w-full"><p className="text-4xl font-medium whitespace-nowrap text-gray-800 dark:text-gray-200 z-10">Card</p>diff --git a/registry/components/magicui/fade-in.tsx b/registry/components/magicui/fade-in.tsxindex 66531a2e..78e9c24a 100644--- a/registry/components/magicui/fade-in.tsx+++ b/registry/components/magicui/fade-in.tsx@@ -3,7 +3,7 @@import { motion, useInView } from "framer-motion";import { useRef } from "react";-export function FadeIn({+export default function FadeIn({children,className,noVertical,diff --git a/registry/components/magicui/magic-card.tsx b/registry/components/magicui/magic-card.tsxindex acb317bd..a7132ecd 100644--- a/registry/components/magicui/magic-card.tsx+++ b/registry/components/magicui/magic-card.tsx@@ -1,7 +1,7 @@"use client";import clsx, { ClassValue } from "clsx";-import React, {+import {CSSProperties,ReactElement,ReactNode,@@ -202,58 +202,48 @@ interface MagicCardProps {* The background of the card* */background?: string;++ [key: string]: any;}const MagicCard = ({- as: Element = <div />, // Default to 'div' if no component is passedclassName,children,size = 600,- borderColor = "rgba(120,119,198)",borderWidth = 1,- borderRadius = 16,spotlight = true,- spotlightColor = "rgba(120,119,198,0.08)",+ spotlightColor = "rgba(120,119,198,0.1)",isolated = true,- background = `rgba(120,119,198, 0.2)`,+ ...props}: MagicCardProps) => {- const spotlightStyles =- "before:pointer-events-none before:absolute before:w-full before:h-full before:rounded-[var(--border-radius)] before:top-0 before:left-0 before:duration-500 before:transition-opacity before:bg-[radial-gradient(var(--mask-size)_circle_at_var(--mouse-x)_var(--mouse-y),var(--spotlight-color),transparent_40%)] before:z-[3] before:blur-xs";-- const borderStyles =- "after:pointer-events-none after:absolute after:w-full after:h-full after:rounded-[var(--border-radius)] after:top-0 after:left-0 after:duration-500 after:transition-opacity after:bg-[radial-gradient(var(--mask-size)_circle_at_var(--mouse-x)_var(--mouse-y),var(--border-color),transparent_40%)] after:z-[1]";-- return React.cloneElement(- Element,- {- style: {- "--border-radius": `${borderRadius}px`,- "--border-width": `${borderWidth}px`,- "--border-color": `${borderColor}`,- "--mask-size": `${size}px`,- "--spotlight-color": `${spotlightColor}`,- background,- } as CSSProperties,- className: cn(- "relative w-full h-full rounded-[var(--border-radius)] overflow-hidden",- isolated && [borderStyles, "after:opacity-0 after:hover:opacity-100"],- isolated &&- spotlight && [- spotlightStyles,- "before:opacity-0 before:hover:opacity-100",- ],- !isolated && [borderStyles, "after:opacity-[var(--opacity)]"],- !isolated &&- spotlight && [spotlightStyles, "before:opacity-[var(--opacity)]"]- ),- },+ return (<div- className={cn(- "absolute inset-[var(--border-width)] rounded-[var(--border-radius)] z-[2]",- className- )}+ {...props}+ className={cn("relative w-full h-full rounded-lg", className)}+ style={+ {+ "--border-width": `${borderWidth}px`,+ "--mask-size": `${size}px`,+ "--spotlight-color": `${spotlightColor}`,+ } as CSSProperties+ }>+ {/* Border */}+ <div className="pointer-events-none absolute w-full h-full rounded-lg top-0 left-0 duration-500 transition-opacity bg-[radial-gradient(var(--mask-size)_circle_at_var(--mouse-x)_var(--mouse-y),#ffaa40_0,#9c40ff_50%,transparent_100%)] -z-30 bg-gray-800" />+{children}++ {/* Background */}+ <div className={"absolute inset-[1px] rounded-lg -z-20 bg-background"} />++ {/* Spotlight */}+ {spotlight && (+ <div+ className={+ "pointer-events-none absolute w-full h-full rounded-lg top-0 left-0 duration-500 transition-opacity bg-[radial-gradient(var(--mask-size)_circle_at_var(--mouse-x)_var(--mouse-y),var(--spotlight-color),transparent_40%)] -z-10 blur-xs"+ }+ />+ )}</div>);};