Skip to content

UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.

feat: add brand new landing page

Dillion Verma4a410e7e975b
diff --git a/app/(docs)/docs/layout.tsx b/app/(docs)/docs/layout.tsx
index 5014654e..fbce5e05 100644
--- a/app/(docs)/docs/layout.tsx
+++ b/app/(docs)/docs/layout.tsx
@@ -1,6 +1,5 @@
import { docsConfig } from "@/config/docs";
import { ScrollArea } from "@/components/ui/scroll-area";
-import GradientBlur from "@/components/gradient-blur";
import { DocsSidebarNav } from "@/components/sidebar-nav";
interface DocsLayoutProps {
@@ -9,17 +8,13 @@ interface DocsLayoutProps {
export default function DocsLayout({ children }: DocsLayoutProps) {
return (
- <div className="border-b">
- <div className="container flex-1 items-start md:grid md:grid-cols-[240px_minmax(0,1fr)] md:gap-6 lg:grid-cols-[250px_minmax(0,1fr)] lg:gap-10">
- <aside className="fixed top-14 z-30 -ml-2 hidden h-[calc(100vh-3.5rem)] w-full shrink-0 md:sticky md:block">
- <ScrollArea className="h-full pr-6">
- {/* <GradientBlur className="absolute top-0 rotate-180 h-[100px]" /> */}
- <DocsSidebarNav items={docsConfig.sidebarNav} />
- <GradientBlur className="absolute bottom-0 h-[100px]" />
- </ScrollArea>
- </aside>
- {children}
- </div>
+ <div className="container flex-1 items-start md:grid md:grid-cols-[240px_minmax(0,1fr)] md:gap-6 lg:grid-cols-[250px_minmax(0,1fr)] lg:gap-10">
+ <aside className="fixed top-14 z-30 -ml-2 hidden h-[calc(100vh-3.5rem)] w-full shrink-0 md:sticky md:block">
+ <ScrollArea className="h-full pr-6">
+ <DocsSidebarNav items={docsConfig.sidebarNav} />
+ </ScrollArea>
+ </aside>
+ {children}
</div>
);
}
diff --git a/app/(marketing)/page.tsx b/app/(marketing)/page.tsx
index 3128eec7..57f13cf5 100644
--- a/app/(marketing)/page.tsx
+++ b/app/(marketing)/page.tsx
@@ -1,13 +1,30 @@
-import CTASection from "@/components/landing/cta-section";
-import Hero from "@/components/landing/hero";
-import Testimonials from "@/components/landing/testimonials";
+import Hero from "@/components/hero";
+import { Mdx } from "@/components/mdx-components";
+
+import "@/styles/mdx.css";
+
+import { notFound } from "next/navigation";
+import { allPages } from "contentlayer/generated";
+
+import Testimonials from "@/components/testimonials";
+
+const PAGE = "home";
export default async function Home() {
+ const page = allPages.find((page) => page.slugAsParams === PAGE);
+
+ if (!page) {
+ notFound();
+ }
+
return (
<>
<Hero />
+ <section id="component-demos" className="container max-w-5xl">
+ <Mdx code={page.body.code} />
+ </section>
<Testimonials />
- <CTASection />
+ {/* <CTASection /> */}
</>
);
}
diff --git a/components/component-preview.tsx b/components/component-preview.tsx
index ddf43a1c..5fb7abf6 100644
--- a/components/component-preview.tsx
+++ b/components/component-preview.tsx
@@ -4,16 +4,16 @@ import * as React from "react";
import { RotateCcw } from "lucide-react";
import { cn } from "@/lib/utils";
+import { Button } from "@/components/ui/button";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import ComponentWrapper from "@/components/component-wrapper";
import { Icons } from "@/components/icons";
import { ComponentName, registry } from "@/registry/index";
-import { Button } from "./ui/button";
-
interface ComponentPreviewProps extends React.HTMLAttributes<HTMLDivElement> {
name: ComponentName;
align?: "center" | "start" | "end";
+ preview?: boolean;
}
export function ComponentPreview({
@@ -21,6 +21,7 @@ export function ComponentPreview({
children,
className,
align = "center",
+ preview = false,
...props
}: ComponentPreviewProps) {
const [key, setKey] = React.useState(0); // State to trigger re-render of preview
@@ -55,22 +56,24 @@ export function ComponentPreview({
{...props}
>
<Tabs defaultValue="preview" className="relative mr-auto w-full">
- <div className="flex items-center justify-between pb-3">
- <TabsList className="w-full justify-start rounded-none border-b bg-transparent p-0">
- <TabsTrigger
- value="preview"
- className="relative h-9 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 font-semibold text-muted-foreground shadow-none transition-none data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none"
- >
- Preview
- </TabsTrigger>
- <TabsTrigger
- value="code"
- className="relative h-9 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 font-semibold text-muted-foreground shadow-none transition-none data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none"
- >
- Code
- </TabsTrigger>
- </TabsList>
- </div>
+ {!preview && (
+ <div className="flex items-center justify-between pb-3">
+ <TabsList className="w-full justify-start rounded-none border-b bg-transparent p-0">
+ <TabsTrigger
+ value="preview"
+ className="relative h-9 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 font-semibold text-muted-foreground shadow-none transition-none data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none"
+ >
+ Preview
+ </TabsTrigger>
+ <TabsTrigger
+ value="code"
+ className="relative h-9 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 font-semibold text-muted-foreground shadow-none transition-none data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none"
+ >
+ Code
+ </TabsTrigger>
+ </TabsList>
+ </div>
+ )}
<TabsContent value="preview" className="relative rounded-md" key={key}>
<ComponentWrapper>
<Button
diff --git a/components/landing/cta-section.tsx b/components/cta-section.tsx
similarity index 100%
rename from components/landing/cta-section.tsx
rename to components/cta-section.tsx
diff --git a/components/landing/hero-client.tsx b/components/hero-client.tsx
similarity index 79%
rename from components/landing/hero-client.tsx
rename to components/hero-client.tsx
index b7062be2..0d287e8a 100644
--- a/components/landing/hero-client.tsx
+++ b/components/hero-client.tsx
@@ -2,23 +2,37 @@
import Link from "next/link";
import { Doc } from "@/.contentlayer/generated";
-import { motion } from "framer-motion";
-import { ChevronRight } from "lucide-react";
+import { ArrowRightIcon, ChevronRight } from "lucide-react";
import { cn } from "@/lib/utils";
import { buttonVariants } from "@/components/ui/button";
import { Separator } from "@/components/ui/separator";
import TechStack from "@/components/tech-stack";
-import AnimatedBeamMultipleInputDemo from "@/registry/components/example/animated-beam-multiple-inputs";
-import AnimatedListDemo from "@/registry/components/example/animated-list-demo";
-import BentoDemo from "@/registry/components/example/bento-demo";
-import DockDemo from "@/registry/components/example/dock-demo";
-import OrbitingCirclesDemo from "@/registry/components/example/orbiting-circles-demo";
-import RetroGridDemo from "@/registry/components/example/retro-grid-demo";
-import AnimatedGradientText from "@/registry/components/magicui/animated-gradient-text";
-import { VelocityScroll } from "@/registry/components/magicui/scroll-based-velocity";
-import TypingAnimation from "@/registry/components/magicui/typing-animation";
-import WordRotate from "@/registry/components/magicui/word-rotate";
+import AnimatedShinyText from "@/registry/components/magicui/animated-shiny-text";
+
+function HeroPill({ href, title }: { href: string; title: string }) {
+ return (
+ <Link href={href}>
+ <div
+ className={cn(
+ "group rounded-full border border-black/5 bg-neutral-100 text-base text-white transition-all ease-in hover:cursor-pointer hover:bg-neutral-200 dark:border-white/5 dark:bg-neutral-900 dark:hover:bg-neutral-800",
+ )}
+ >
+ <AnimatedShinyText
+ className="inline-flex items-center
+ justify-center px-4 py-1"
+ >
+ πŸŽ‰ <Separator className="mx-2 h-4" orientation="vertical" />
+ <span>{title}</span>
+ <ArrowRightIcon
+ className="ml-1 size-3 transition-transform
+ duration-300 ease-in-out group-hover:translate-x-0.5"
+ />
+ </AnimatedShinyText>
+ </div>
+ </Link>
+ );
+}
export default function HeroClient({ post }: { post: Doc }) {
return (
@@ -27,26 +41,7 @@ export default function HeroClient({ post }: { post: Doc }) {
<div className="z-10 flex flex-col">
<div className="mt-10 grid grid-cols-1 md:mt-20">
<div className="flex flex-col items-start gap-6 px-7 pb-8 text-center md:items-center md:px-10">
- <Link href={post.slug}>
- <AnimatedGradientText>
- <div
- className={cn(
- `absolute inset-0 block size-full animate-gradient bg-gradient-to-r from-[#ffaa40]/50 via-[#9c40ff]/50 to-[#ffaa40]/50 bg-[length:var(--bg-size)_100%] [border-radius:inherit] [mask:linear-gradient(#fff_0_0)_content-box,linear-gradient(#fff_0_0)]`,
- `p-px ![mask-composite:subtract]`,
- )}
- />
- πŸŽ‰ <Separator className="mx-2 h-4" orientation="vertical" />
- <span
- className={cn(
- `animate-gradient bg-gradient-to-r from-[#ffaa40] via-[#9c40ff] to-[#ffaa40] bg-[length:var(--bg-size)_100%] bg-clip-text text-transparent`,
- `inline`,
- )}
- >
- Introducing {post.title}
- </span>
- <ChevronRight className="ml-1 size-4 text-gray-500" />
- </AnimatedGradientText>
- </Link>
+ <HeroPill href={post.slug} title={`Introducing ${post.title}`} />
<div className="relative flex flex-col gap-4 md:items-center lg:flex-row">
<h1
className={cn(
@@ -117,6 +112,7 @@ export default function HeroClient({ post }: { post: Doc }) {
/>
</div>
+ {/*
<div className="container relative mx-auto mt-32 w-full max-w-[1000px]">
<motion.span
animate={["initial"]}
@@ -160,10 +156,10 @@ export default function HeroClient({ post }: { post: Doc }) {
</svg>
</span>
</motion.span>
-
+
<BentoDemo />
- <div className="mt-4 grid w-full grid-cols-1 place-items-center justify-center gap-4 lg:grid-cols-2">
+ <div className="mt-4 grid w-full grid-cols-1 place-items-center justify-center gap-4 lg:grid-cols-2">
<AnimatedBeamMultipleInputDemo />
<AnimatedListDemo />
<RetroGridDemo />
@@ -202,7 +198,7 @@ export default function HeroClient({ post }: { post: Doc }) {
<OrbitingCirclesDemo />
<DockDemo />
</div>
- </div>
+ </div> */}
</div>
</div>
</section>
diff --git a/components/landing/hero.tsx b/components/hero.tsx
similarity index 92%
rename from components/landing/hero.tsx
rename to components/hero.tsx
index 4624e092..a08c0111 100644
--- a/components/landing/hero.tsx
+++ b/components/hero.tsx
@@ -1,7 +1,7 @@
import { allDocs } from "@/.contentlayer/generated";
import { compareDesc } from "date-fns";
-import HeroClient from "@/components/landing/hero-client";
+import HeroClient from "@/components/hero-client";
export default async function Hero() {
const post = allDocs
diff --git a/components/mdx-components.tsx b/components/mdx-components.tsx
index 56fe5471..3ede65d2 100644
--- a/components/mdx-components.tsx
+++ b/components/mdx-components.tsx
@@ -276,13 +276,14 @@ const components = {
interface MDXProps {
code: string;
+ className?: string;
}
-export function Mdx({ code }: MDXProps) {
+export function Mdx({ code, className }: MDXProps) {
const Component = useMDXComponent(code);
return (
- <article className={cn("max-w-[120ch]")}>
+ <article className={cn("max-w-[120ch] mx-auto", className)}>
<Component components={components} />
</article>
);
diff --git a/components/sidebar-nav.tsx b/components/sidebar-nav.tsx
index ec938623..54ad8f08 100644
--- a/components/sidebar-nav.tsx
+++ b/components/sidebar-nav.tsx
@@ -7,6 +7,7 @@ import { ExternalLinkIcon } from "@radix-ui/react-icons";
import posthog from "posthog-js";
import { cn } from "@/lib/utils";
+import GradientBlur from "@/components/gradient-blur";
export interface DocsSidebarNavProps {
items: SidebarNavItem[];
@@ -16,7 +17,7 @@ export function DocsSidebarNav({ items }: DocsSidebarNavProps) {
const pathname = usePathname();
return items.length ? (
- <div className="w-full">
+ <div className="w-full pb-20">
{items.map((item, index) => (
<div key={index} className={cn("pb-4")}>
<h4 className="mb-1 rounded-md px-2 py-1 text-sm font-semibold">
@@ -27,6 +28,7 @@ export function DocsSidebarNav({ items }: DocsSidebarNavProps) {
)}
</div>
))}
+ <GradientBlur className="z-0 absolute bottom-0 h-[100px]" />
</div>
) : null;
}
diff --git a/components/landing/testimonials.tsx b/components/testimonials.tsx
similarity index 100%
rename from components/landing/testimonials.tsx
rename to components/testimonials.tsx
diff --git a/content/pages/home.mdx b/content/pages/home.mdx
new file mode 100644
index 00000000..c564de5e
--- /dev/null
+++ b/content/pages/home.mdx
@@ -0,0 +1,23 @@
+---
+title: Components
+date: 2024-01-01
+description: A collection of components that are used to build the landing page of a website.
+author: dillionverma
+published: true
+---
+
+<ComponentPreview name="bento-demo" preview />
+<ComponentPreview name="marquee-demo" preview />
+<ComponentPreview name="marquee-demo-vertical" preview />
+<ComponentPreview name="retro-grid-demo" preview />
+<ComponentPreview name="border-beam-demo" preview />
+<ComponentPreview name="animated-list-demo" preview />
+<ComponentPreview name="animated-beam-demo" preview />
+<ComponentPreview name="animated-beam-multiple-inputs" preview />
+<ComponentPreview name="animated-beam-multiple-outputs" preview />
+<ComponentPreview name="orbiting-circles-demo" preview />
+<ComponentPreview name="ripple-demo" preview />
+<ComponentPreview name="dock-demo" preview />
+<ComponentPreview name="particles-demo" preview />
+<ComponentPreview name="shine-border-demo" preview />
+<ComponentPreview name="confetti-demo" preview />
diff --git a/lib/utils.ts b/lib/utils.ts
index b57e572a..42905d4a 100644
--- a/lib/utils.ts
+++ b/lib/utils.ts
@@ -7,6 +7,16 @@ export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
+export function humanize(name: string): string {
+ return name
+ .replace(/-/g, " ")
+ .replace(/([A-Z])/g, " $1")
+ .trim()
+ .split(/\s+/)
+ .map((word) => word[0].toUpperCase() + word.substring(1).toLowerCase())
+ .join(" ");
+}
+
export const truncate = (str: string | null, length: number) => {
if (!str || str.length <= length) return str;
return `${str.slice(0, length - 3)}...`;
diff --git a/registry/components/magicui/animated-shiny-text.tsx b/registry/components/magicui/animated-shiny-text.tsx
index 7071ceb7..2332e62f 100644
--- a/registry/components/magicui/animated-shiny-text.tsx
+++ b/registry/components/magicui/animated-shiny-text.tsx
@@ -21,7 +21,7 @@ const AnimatedShinyText: FC<AnimatedShinyTextProps> = ({
} as CSSProperties
}
className={cn(
- "mx-auto max-w-md text-neutral-600/50 dark:text-neutral-400/50 ",
+ "mx-auto max-w-md text-neutral-600/70 dark:text-neutral-400/70",
// Shimmer effect
"animate-shimmer bg-clip-text bg-no-repeat [background-position:0_0] [background-size:var(--shimmer-width)_100%] [transition:background-position_1s_cubic-bezier(.6,.6,0,1)_infinite]",