Skip to content

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

Magic UI Redesign stages (#89)

Arghya Das949da4de73ad
diff --git a/components/landing/hero-client.tsx b/components/landing/hero-client.tsx
index 08587f9a..a3f1301e 100644
--- a/components/landing/hero-client.tsx
+++ b/components/landing/hero-client.tsx
@@ -15,118 +15,69 @@ import AnimatedGradientText from "@/registry/components/magicui/animated-gradien
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 { motion, useInView } from "framer-motion";
+import { motion } from "framer-motion";
import { ChevronRight } from "lucide-react";
import Link from "next/link";
-import { useRef } from "react";
export default function HeroClient({ post }: { post: Doc }) {
- const fadeInRef = useRef(null);
- const fadeInInView = useInView(fadeInRef, {
- once: true,
- });
-
- const fadeUpVariants = {
- initial: {
- opacity: 0,
- y: 24,
- },
- animate: {
- opacity: 1,
- y: 0,
- },
- };
-
return (
<section id="hero">
- <div className="relative h-full overflow-hidden py-14">
- <div className="container z-10 flex flex-col">
- <div className="mt-20 grid grid-cols-1">
- <div className="flex flex-col items-center gap-6 pb-8 text-center">
- <motion.div
- ref={fadeInRef}
- animate={fadeInInView ? "animate" : "initial"}
- variants={fadeUpVariants}
- initial={false}
- transition={{
- duration: 0.6,
- delay: 0.1,
- ease: [0.21, 0.47, 0.32, 0.98],
- type: "spring",
- }}
- >
- <Link href={post.slug}>
- <AnimatedGradientText>
- <div
- className={cn(
- `absolute inset-0 block h-full w-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-[1px] ![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 h-4 w-4 text-gray-500" />
- </AnimatedGradientText>
- </Link>
- </motion.div>
-
- <motion.h1
- animate={fadeInInView ? "animate" : "initial"}
- variants={fadeUpVariants}
- initial={false}
- transition={{
- duration: 0.6,
- delay: 0.1,
- ease: [0.21, 0.47, 0.32, 0.98],
- type: "spring",
- }}
- className="text-balance bg-gradient-to-br from-black from-30% to-black/60 bg-clip-text py-6 text-5xl font-semibold leading-none tracking-tighter text-transparent dark:from-white dark:to-white/40 sm:text-6xl md:text-7xl lg:text-7xl"
- >
- UI library for Design Engineers
- {/* React components to build
- <br className="hidden md:block" /> beautiful landing pages. */}
- </motion.h1>
+ <div className="relative h-full overflow-hidden py-5 md:py-14">
+ <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 h-full w-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-[1px] ![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 h-4 w-4 text-gray-500" />
+ </AnimatedGradientText>
+ </Link>
+ <div className="relative flex flex-col gap-4 md:items-center lg:flex-row">
+ <h1 className="relative mx-0 max-w-[43.5rem] text-balance py-2 text-left text-5xl font-extrabold tracking-tight text-black dark:text-white sm:text-7xl md:mx-auto md:px-4 md:text-center md:text-7xl lg:text-7xl">
+ UI library for Design Engineers
+ </h1>
+ <span className="text-neutral-90 absolute left-0 top-12 z-10 -rotate-12 whitespace-nowrap rounded-full bg-neutral-800 px-2.5 py-1 text-[11px] font-semibold uppercase leading-5 tracking-wide text-white">
+ 100% open-source
+ </span>
+ </div>
- <motion.p
- className="max-w-[64rem] text-balance text-lg tracking-tight text-gray-500 md:text-xl"
- animate={fadeInInView ? "animate" : "initial"}
- variants={fadeUpVariants}
- initial={false}
- transition={{
- duration: 0.6,
- delay: 0.2,
- ease: [0.21, 0.47, 0.32, 0.98],
- type: "spring",
- }}
- >
+ <p className="max-w-xl text-balance text-left text-base tracking-tight text-black dark:font-medium dark:text-white md:text-center md:text-lg ">
20+ free and open-source animated components built with{" "}
- <strong>React</strong>, <strong>Typescript</strong>,{" "}
- <strong>Tailwind CSS</strong>, and{" "}
- <strong>Framer Motion</strong>.
+ <span className="font-bold text-black dark:text-white">
+ React
+ </span>
+ ,{" "}
+ <span className="font-bold text-black dark:text-white">
+ Typescript
+ </span>
+ ,{" "}
+ <span className="font-bold text-black dark:text-white">
+ Tailwind CSS
+ </span>
+ , and{" "}
+ <span className="font-bold text-black dark:text-white">
+ Framer Motion
+ </span>
+ .
<br />
- 100% open-source, and customizable.
- </motion.p>
+ </p>
- <motion.div
- animate={fadeInInView ? "animate" : "initial"}
- variants={fadeUpVariants}
- className="flex flex-col gap-4 lg:flex-row"
- initial={false}
- transition={{
- duration: 0.6,
- delay: 0.3,
- ease: [0.21, 0.47, 0.32, 0.98],
- type: "spring",
- }}
- >
- <div className="flex flex-col gap-4 md:flex-row">
+ <div className="mx-0 flex w-full max-w-full flex-col gap-4 py-1 sm:max-w-lg sm:flex-row md:mx-auto">
+ <div className="flex w-full flex-col gap-2 sm:flex-row sm:gap-4">
<Link
href="/components"
className={cn(
@@ -135,7 +86,7 @@ export default function HeroClient({ post }: { post: Doc }) {
size: "lg",
}),
"gap-2 whitespace-pre md:flex",
- "group relative w-full gap-1 rounded-full text-sm font-semibold tracking-tighter",
+ "group relative w-full gap-1 rounded-full text-sm font-semibold tracking-tighter ring-offset-inherit transition-all duration-150 ease-in-out hover:ring-2 hover:ring-black hover:ring-offset-2 hover:ring-offset-current dark:hover:ring-neutral-50",
)}
>
Browse Components
@@ -146,91 +97,23 @@ export default function HeroClient({ post }: { post: Doc }) {
className={cn(
buttonVariants({
size: "lg",
- variant: "ghost",
+ variant: "outline",
}),
"gap-2 whitespace-pre md:flex",
- "group relative w-full gap-1 overflow-hidden rounded-full text-sm font-semibold tracking-tighter",
+ "group relative w-full gap-1 overflow-hidden rounded-full text-sm font-semibold tracking-tighter transition-all duration-150 ease-in-out hover:ring-2 hover:ring-neutral-300 hover:ring-offset-2 hover:ring-offset-inherit dark:hover:ring-black dark:hover:ring-offset-black ",
)}
>
Get Started
<ChevronRight className="ml-1 size-4 flex-shrink-0 transition-all duration-300 ease-out group-hover:translate-x-1" />
</Link>
</div>
- </motion.div>
-
- {/* <motion.div
- animate={fadeInInView ? "animate" : "initial"}
- variants={fadeUpVariants}
- initial={false}
- transition={{
- duration: 0.6,
- delay: 0.3,
- ease: [0.21, 0.47, 0.32, 0.98],
- type: "spring",
- }}
- >
- <div className="container flex flex-col items-center justify-center gap-2 sm:flex-row">
- <div className="flex flex-row items-center justify-center -space-x-4">
- <img
- src="https://randomuser.me/api/portraits/women/72.jpg"
- className="h-10 w-10 rounded-full border-2 border-white"
- />
- <img
- src="https://randomuser.me/api/portraits/men/94.jpg"
- className="h-10 w-10 rounded-full border-2 border-white"
- />
- <img
- src="https://randomuser.me/api/portraits/women/34.jpg"
- className="h-10 w-10 rounded-full border-2 border-white"
- />
- <img
- src="https://randomuser.me/api/portraits/men/86.jpg"
- className="h-10 w-10 rounded-full border-2 border-white"
- />
- <img
- src="https://randomuser.me/api/portraits/women/41.jpg"
- className="h-10 w-10 rounded-full border-2 border-white"
- />
- </div>
-
- <div className="flex flex-col gap-x-2">
- <div className="mx-auto flex flex-row items-center justify-start">
- <StarFilledIcon className="h-4 w-4 text-orange-300" />
- <StarFilledIcon className="h-4 w-4 text-orange-300" />
- <StarFilledIcon className="h-4 w-4 text-orange-300" />
- <StarFilledIcon className="h-4 w-4 text-orange-300" />
- <StarFilledIcon className="h-4 w-4 text-orange-300" />
- <span className="ml-2 text-base font-bold">5.0</span>
- </div>
-
- <span className="inline-block text-center text-xs font-medium leading-snug tracking-tighter">
- <NumberTicker
- value={500}
- className="font-extrabold"
- delay={0.2}
- />
- + developers making beautiful landing pages
- </span>
- </div>
- </div>
- </motion.div> */}
+ </div>
</div>
</div>
- <motion.div
- className="relative mx-auto flex w-full max-w-[1000px] items-center justify-center"
- animate={fadeInInView ? "animate" : "initial"}
- variants={fadeUpVariants}
- initial={false}
- transition={{
- duration: 0.6,
- delay: 0.2,
- ease: [0.21, 0.47, 0.32, 0.98],
- type: "spring",
- }}
- >
+ <div className="relative mx-auto flex w-full max-w-[16rem] items-center justify-center">
<TechStack
- className="mx-auto text-foreground"
+ className="mx-auto flex w-full items-center justify-between"
technologies={[
// "nextjs",
"react",
@@ -240,7 +123,7 @@ export default function HeroClient({ post }: { post: Doc }) {
// "shadcn",
]}
/>
- </motion.div>
+ </div>
<div className="container relative mx-auto mt-32 w-full max-w-[1000px]">
<motion.span
@@ -266,7 +149,7 @@ export default function HeroClient({ post }: { post: Doc }) {
className="absolute -top-16 left-0 right-auto cursor-pointer lg:-top-20"
>
<span className="flex items-center">
- <span className="mt-3 inline-block whitespace-nowrap rounded-full bg-neutral-800 px-2.5 py-1 text-[11px] font-semibold uppercase leading-5 tracking-wide text-white">
+ <span className="mt-3 inline-block whitespace-nowrap rounded-full bg-neutral-800 px-4 py-1.5 text-[12px] font-semibold uppercase leading-5 tracking-wide text-white">
Real component demos!
</span>
<svg
diff --git a/components/landing/testimonials.tsx b/components/landing/testimonials.tsx
index 9897a69a..53950c70 100644
--- a/components/landing/testimonials.tsx
+++ b/components/landing/testimonials.tsx
@@ -35,10 +35,10 @@ export default async function Testimonials() {
return (
<section id="testimonials" className="container py-14">
<FadeIn delay={0.3}>
- <h2 className="mb-4 text-center text-5xl font-bold tracking-tight text-foreground">
+ <h2 className="mb-4 text-center text-5xl font-bold leading-[1.2] tracking-tighter text-foreground">
What People Are Saying
</h2>
- <h3 className="text-foreground/80text-lg mb-8 text-center font-medium tracking-tight">
+ <h3 className="mx-auto mb-8 max-w-lg text-balance text-center text-lg font-medium tracking-tight text-foreground/80">
Don't just take our word for it. Here's what{" "}
<strong>real people</strong> are saying about Magic UI on Twitter.
</h3>
@@ -62,8 +62,8 @@ export default async function Testimonials() {
</FadeIn>
))}
</Marquee>
- <div className="pointer-events-none absolute inset-y-0 left-0 h-full w-1/3 bg-gradient-to-r from-white dark:from-background"></div>
- <div className="pointer-events-none absolute inset-y-0 right-0 h-full w-1/3 bg-gradient-to-l from-white dark:from-background"></div>
+ <div className="pointer-events-none absolute inset-y-0 left-0 h-full w-1/3 bg-gradient-to-r from-background"></div>
+ <div className="pointer-events-none absolute inset-y-0 right-0 h-full w-1/3 bg-gradient-to-l from-background"></div>
</div>
</section>
);
diff --git a/components/main-nav.tsx b/components/main-nav.tsx
index 932b8649..eca6e616 100644
--- a/components/main-nav.tsx
+++ b/components/main-nav.tsx
@@ -1,20 +1,20 @@
"use client";
import { Icons } from "@/components/icons";
+import { Badge } from "@/components/ui/badge";
import { docsConfig } from "@/config/docs";
import { siteConfig } from "@/config/site";
import { cn } from "@/lib/utils";
import { ExternalLinkIcon } from "@radix-ui/react-icons";
import Link from "next/link";
import { usePathname } from "next/navigation";
-import { Badge } from "./ui/badge";
export function MainNav() {
const pathname = usePathname();
return (
<div className="mr-4 hidden md:flex">
- <Link href="/" className="mr-6 flex items-center space-x-2">
+ <Link href="/" className="relative mr-6 flex items-center space-x-2">
<Icons.logo className="h-6 w-6" />
<span className="hidden font-bold md:inline-block">
{siteConfig.name}
diff --git a/components/mode-toggle.tsx b/components/mode-toggle.tsx
index d3eaa06a..ab10ab76 100644
--- a/components/mode-toggle.tsx
+++ b/components/mode-toggle.tsx
@@ -1,39 +1,24 @@
"use client";
+import { Button } from "@/components/ui/button";
import { MoonIcon, SunIcon } from "@radix-ui/react-icons";
import { useTheme } from "next-themes";
-import { Button } from "@/components/ui/button";
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuTrigger,
-} from "@/components/ui/dropdown-menu";
-
export function ModeToggle() {
- const { setTheme } = useTheme();
+ const { theme, setTheme } = useTheme();
return (
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button variant="ghost" size="icon" className="min-w-[2.25rem]">
- <SunIcon className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
- <MoonIcon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
- <span className="sr-only">Toggle theme</span>
- </Button>
- </DropdownMenuTrigger>
- <DropdownMenuContent align="end">
- <DropdownMenuItem onClick={() => setTheme("light")}>
- Light
- </DropdownMenuItem>
- <DropdownMenuItem onClick={() => setTheme("dark")}>
- Dark
- </DropdownMenuItem>
- <DropdownMenuItem onClick={() => setTheme("system")}>
- System
- </DropdownMenuItem>
- </DropdownMenuContent>
- </DropdownMenu>
+ <Button
+ variant="outline"
+ size="icon"
+ onClick={() => setTheme(theme === "light" ? "dark" : "light")}
+ >
+ {theme === "light" ? (
+ <SunIcon className="h-[1.2rem] w-[1.2rem] rotate-90 scale-100 text-neutral-800 transition-all dark:rotate-0 dark:scale-0 dark:text-neutral-200" />
+ ) : (
+ <MoonIcon className="h-[1.2rem] w-[1.2rem] rotate-90 scale-0 text-neutral-800 transition-all dark:rotate-0 dark:scale-100 dark:text-neutral-200" />
+ )}
+ <span className="sr-only">Toggle theme</span>
+ </Button>
);
}
diff --git a/components/site-banner.tsx b/components/site-banner.tsx
index 7f72c7b8..8b51ba45 100644
--- a/components/site-banner.tsx
+++ b/components/site-banner.tsx
@@ -6,21 +6,21 @@ import posthog from "posthog-js";
export function SiteBanner() {
return (
- <div className="relative top-0 bg-indigo-600 py-3 text-white md:py-0">
+ <div className="relative top-0 bg-indigo-600 py-3 text-white hover:bg-indigo-600/90 md:py-0">
<div className="container flex flex-col items-center justify-center gap-4 md:h-12 md:flex-row">
<Link
href="https://pro.magicui.design"
onClick={() => posthog.capture("banner_cta_clicked")}
target="_blank"
- className="group inline-flex items-center justify-center text-center text-sm leading-loose"
+ className="group inline-flex text-xs leading-normal md:text-sm"
>
- ✨
- <span className="font-bold">
+ ✨{" "}
+ <span className="ml-1 font-[580] dark:font-[550]">
{" "}
Introducing Magic UI Pro - 50+ blocks and templates to build
beautiful landing pages in minutes.
</span>{" "}
- <ChevronRight className="ml-1 size-4 transition-all duration-300 ease-out group-hover:translate-x-1" />
+ <ChevronRight className="ml-1 mt-[3px] hidden size-4 transition-all duration-300 ease-out group-hover:translate-x-1 lg:inline-block" />
</Link>
</div>
<hr className="absolute bottom-0 m-0 h-px w-full bg-neutral-200/30" />
diff --git a/components/ui/badge.tsx b/components/ui/badge.tsx
index f7959805..d7ac14df 100644
--- a/components/ui/badge.tsx
+++ b/components/ui/badge.tsx
@@ -1,5 +1,5 @@
-import * as React from "react";
import { cva, type VariantProps } from "class-variance-authority";
+import * as React from "react";
import { cn } from "@/lib/utils";
diff --git a/registry/components/example/dock-demo.tsx b/registry/components/example/dock-demo.tsx
index d75345ad..09bf0b9c 100644
--- a/registry/components/example/dock-demo.tsx
+++ b/registry/components/example/dock-demo.tsx
@@ -26,7 +26,6 @@ export default function DockDemo() {
<Icons.whatsapp className="h-6 w-6" />
</DockIcon>
</Dock>
- <div className="pointer-events-none absolute inset-0 h-full bg-[radial-gradient(circle_at_50%_200%,rgba(0,0,0,0.2),rgba(255,255,255,0))]" />
</div>
);
}
diff --git a/styles/globals.css b/styles/globals.css
index b177fa00..ae75b415 100644
--- a/styles/globals.css
+++ b/styles/globals.css
@@ -65,9 +65,7 @@
}
body {
@apply bg-background text-foreground;
- font-feature-settings:
- "rlig" 1,
- "calt" 1;
+ font-feature-settings: "rlig" 1, "calt" 1;
}
}
@@ -91,9 +89,31 @@
.lab-bg {
--mask-offset: 100px;
- -webkit-mask: linear-gradient(to bottom,transparent,#fff var(--mask-offset) calc(100% - var(--mask-offset)),transparent),linear-gradient(to right,transparent,#fff var(--mask-offset) calc(100% - var(--mask-offset)),transparent);
- mask: linear-gradient(to bottom,transparent,#fff var(--mask-offset) calc(100% - var(--mask-offset)),transparent),linear-gradient(to right,transparent,#fff var(--mask-offset) calc(100% - var(--mask-offset)),transparent);
+ -webkit-mask: linear-gradient(
+ to bottom,
+ transparent,
+ #fff var(--mask-offset) calc(100% - var(--mask-offset)),
+ transparent
+ ),
+ linear-gradient(
+ to right,
+ transparent,
+ #fff var(--mask-offset) calc(100% - var(--mask-offset)),
+ transparent
+ );
+ mask: linear-gradient(
+ to bottom,
+ transparent,
+ #fff var(--mask-offset) calc(100% - var(--mask-offset)),
+ transparent
+ ),
+ linear-gradient(
+ to right,
+ transparent,
+ #fff var(--mask-offset) calc(100% - var(--mask-offset)),
+ transparent
+ );
/* -webkit-mask: radial-gradient(circle at 50% 50%,transparent 0,#fff calc(100% - var(--mask-offset)),transparent 100%); */
- -webkit-mask-composite: source-in,xor;
- mask-composite: intersect
+ -webkit-mask-composite: source-in, xor;
+ mask-composite: intersect;
}