UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.
fix: format
Dillion Verma9eccfc42e3fc
diff --git a/public/r/pointer-demo-1.json b/public/r/pointer-demo-1.jsonindex 30d5c096..547fc27f 100644--- a/public/r/pointer-demo-1.json+++ b/public/r/pointer-demo-1.json@@ -10,7 +10,7 @@"files": [{"path": "registry/example/pointer-demo-1.tsx",- "content": "\"use client\";\n\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\";\nimport { Pointer } from \"@/registry/magicui/pointer\";\nimport { motion } from \"motion/react\";\n\nexport default function PointerDemo1() {\n return (\n <div className=\"grid grid-cols-1 gap-6 md:grid-cols-2 md:grid-rows-2\">\n <Card className=\"col-span-1 row-span-1 overflow-hidden border-none bg-gradient-to-br from-slate-50 to-slate-100 shadow-lg transition-all hover:shadow-xl dark:from-slate-900 dark:to-slate-800\">\n <CardHeader className=\"relative pb-2\">\n <CardTitle className=\"text-xl font-bold\">Animated Pointer</CardTitle>\n <CardDescription className=\"text-sm text-slate-600 dark:text-slate-400\">\n Animated pointer\n </CardDescription>\n </CardHeader>\n <CardContent className=\"relative flex h-40 items-center justify-center p-6\">\n <span className=\"pointer-events-none text-center text-xl font-medium text-slate-800 dark:text-slate-200\">\n Move your cursor here\n </span>\n </CardContent>\n <Pointer>\n <motion.div\n animate={{\n scale: [0.8, 1, 0.8],\n rotate: [0, 5, -5, 0],\n }}\n transition={{\n duration: 1.5,\n repeat: Infinity,\n ease: \"easeInOut\",\n }}\n >\n <svg\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"text-pink-600\"\n >\n <motion.path\n d=\"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z\"\n fill=\"currentColor\"\n animate={{ scale: [1, 1.2, 1] }}\n transition={{\n duration: 0.8,\n repeat: Infinity,\n ease: \"easeInOut\",\n }}\n />\n </svg>\n </motion.div>\n </Pointer>\n </Card>\n\n <Card className=\"col-span-1 row-span-1 overflow-hidden border-none bg-gradient-to-br from-blue-50 to-blue-100 shadow-lg transition-all hover:shadow-xl dark:from-blue-900 dark:to-blue-800\">\n <CardHeader className=\"relative pb-2\">\n <CardTitle className=\"text-xl font-bold\">Colored Pointer</CardTitle>\n <CardDescription className=\"text-sm text-blue-700 dark:text-blue-300\">\n A custom pointer with different color\n </CardDescription>\n </CardHeader>\n <CardContent className=\"relative flex h-40 items-center justify-center p-6\">\n <span className=\"pointer-events-none text-center text-xl font-medium text-blue-800 dark:text-blue-200\">\n Try me out\n </span>\n </CardContent>\n <Pointer className=\"fill-blue-500\" />\n </Card>\n\n <Card className=\"col-span-1 row-span-1 overflow-hidden border-none bg-gradient-to-br from-purple-50 to-purple-100 shadow-lg transition-all hover:shadow-xl dark:from-purple-900 dark:to-purple-800\">\n <CardHeader className=\"relative pb-2\">\n <CardTitle className=\"text-xl font-bold\">Custom Shape</CardTitle>\n <CardDescription className=\"text-sm text-purple-700 dark:text-purple-300\">\n A pointer with a custom SVG shape\n </CardDescription>\n </CardHeader>\n <CardContent className=\"relative flex h-40 items-center justify-center p-6\">\n <span className=\"pointer-events-none text-center text-xl font-medium text-purple-800 dark:text-purple-200\">\n Hover here\n </span>\n </CardContent>\n <Pointer>\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" className=\"fill-purple-500\" />\n <circle cx=\"12\" cy=\"12\" r=\"5\" className=\"fill-white\" />\n </svg>\n </Pointer>\n </Card>\n\n <Card className=\"col-span-1 row-span-1 overflow-hidden border-none bg-gradient-to-br from-green-50 to-green-100 shadow-lg transition-all hover:shadow-xl dark:from-green-900 dark:to-green-800\">\n <CardHeader className=\"relative pb-2\">\n <CardTitle className=\"text-xl font-bold\">Emoji Pointer</CardTitle>\n <CardDescription className=\"text-sm text-green-700 dark:text-green-300\">\n Using an emoji as a custom pointer\n </CardDescription>\n </CardHeader>\n <CardContent className=\"relative flex h-40 items-center justify-center p-6\">\n <span className=\"pointer-events-none text-center text-xl font-medium text-green-800 dark:text-green-200\">\n Check this out\n </span>\n </CardContent>\n <Pointer>\n <div className=\"text-2xl\">π</div>\n </Pointer>\n </Card>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\";\nimport { Pointer } from \"@/registry/magicui/pointer\";\nimport { motion } from \"motion/react\";\n\nexport default function PointerDemo1() {\n return (\n <div className=\"grid grid-cols-1 gap-6 md:grid-cols-2 md:grid-rows-2\">\n <Card className=\"col-span-1 row-span-1 overflow-hidden border bg-gradient-to-br from-slate-50 to-slate-100 transition-all dark:from-slate-900 dark:to-slate-800 shadow-none\">\n <CardHeader className=\"relative pb-2\">\n <CardTitle className=\"text-xl font-bold\">Animated Pointer</CardTitle>\n <CardDescription className=\"text-sm text-slate-600 dark:text-slate-400\">\n Animated pointer\n </CardDescription>\n </CardHeader>\n <CardContent className=\"relative flex h-40 items-center justify-center p-6\">\n <span className=\"pointer-events-none text-center text-xl font-medium text-slate-800 dark:text-slate-200\">\n Move your cursor here\n </span>\n </CardContent>\n <Pointer>\n <motion.div\n animate={{\n scale: [0.8, 1, 0.8],\n rotate: [0, 5, -5, 0],\n }}\n transition={{\n duration: 1.5,\n repeat: Infinity,\n ease: \"easeInOut\",\n }}\n >\n <svg\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"text-pink-600\"\n >\n <motion.path\n d=\"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z\"\n fill=\"currentColor\"\n animate={{ scale: [1, 1.2, 1] }}\n transition={{\n duration: 0.8,\n repeat: Infinity,\n ease: \"easeInOut\",\n }}\n />\n </svg>\n </motion.div>\n </Pointer>\n </Card>\n\n <Card className=\"col-span-1 row-span-1 overflow-hidden border bg-gradient-to-br from-blue-50 to-blue-100 transition-all dark:from-blue-900 dark:to-blue-800 shadow-none\">\n <CardHeader className=\"relative pb-2\">\n <CardTitle className=\"text-xl font-bold\">Colored Pointer</CardTitle>\n <CardDescription className=\"text-sm text-blue-700 dark:text-blue-300\">\n A custom pointer with different color\n </CardDescription>\n </CardHeader>\n <CardContent className=\"relative flex h-40 items-center justify-center p-6\">\n <span className=\"pointer-events-none text-center text-xl font-medium text-blue-800 dark:text-blue-200\">\n Try me out\n </span>\n </CardContent>\n <Pointer className=\"fill-blue-500\" />\n </Card>\n\n <Card className=\"col-span-1 row-span-1 overflow-hidden border bg-gradient-to-br from-purple-50 to-purple-100 transition-all dark:from-purple-900 dark:to-purple-800 shadow-none\">\n <CardHeader className=\"relative pb-2\">\n <CardTitle className=\"text-xl font-bold\">Custom Shape</CardTitle>\n <CardDescription className=\"text-sm text-purple-700 dark:text-purple-300\">\n A pointer with a custom SVG shape\n </CardDescription>\n </CardHeader>\n <CardContent className=\"relative flex h-40 items-center justify-center p-6\">\n <span className=\"pointer-events-none text-center text-xl font-medium text-purple-800 dark:text-purple-200\">\n Hover here\n </span>\n </CardContent>\n <Pointer>\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" className=\"fill-purple-500\" />\n <circle cx=\"12\" cy=\"12\" r=\"5\" className=\"fill-white\" />\n </svg>\n </Pointer>\n </Card>\n\n <Card className=\"col-span-1 row-span-1 overflow-hidden border bg-gradient-to-br from-green-50 to-green-100 transition-all dark:from-green-900 dark:to-green-800 shadow-none\">\n <CardHeader className=\"relative pb-2\">\n <CardTitle className=\"text-xl font-bold\">Emoji Pointer</CardTitle>\n <CardDescription className=\"text-sm text-green-700 dark:text-green-300\">\n Using an emoji as a custom pointer\n </CardDescription>\n </CardHeader>\n <CardContent className=\"relative flex h-40 items-center justify-center p-6\">\n <span className=\"pointer-events-none text-center text-xl font-medium text-green-800 dark:text-green-200\">\n Check this out\n </span>\n </CardContent>\n <Pointer>\n <div className=\"text-2xl\">π</div>\n </Pointer>\n </Card>\n </div>\n );\n}\n","type": "registry:example","target": "components/pointer-demo-1.tsx"}diff --git a/public/r/sparkles-text.json b/public/r/sparkles-text.jsonindex f0a4ee6e..b7ae232d 100644--- a/public/r/sparkles-text.json+++ b/public/r/sparkles-text.json@@ -10,7 +10,7 @@"files": [{"path": "registry/magicui/sparkles-text.tsx",- "content": "\"use client\";\n\nimport { motion } from \"motion/react\";\nimport { CSSProperties, ReactElement, useEffect, useState } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface Sparkle {\n id: string;\n x: string;\n y: string;\n color: string;\n delay: number;\n scale: number;\n lifespan: number;\n}\n\nconst Sparkle: React.FC<Sparkle> = ({ id, x, y, color, delay, scale }) => {\n return (\n <motion.svg\n key={id}\n className=\"pointer-events-none absolute z-20\"\n initial={{ opacity: 0, left: x, top: y }}\n animate={{\n opacity: [0, 1, 0],\n scale: [0, scale, 0],\n rotate: [75, 120, 150],\n }}\n transition={{ duration: 0.8, repeat: Infinity, delay }}\n width=\"21\"\n height=\"21\"\n viewBox=\"0 0 21 21\"\n >\n <path\n d=\"M9.82531 0.843845C10.0553 0.215178 10.9446 0.215178 11.1746 0.843845L11.8618 2.72026C12.4006 4.19229 12.3916 6.39157 13.5 7.5C14.6084 8.60843 16.8077 8.59935 18.2797 9.13822L20.1561 9.82534C20.7858 10.0553 20.7858 10.9447 20.1561 11.1747L18.2797 11.8618C16.8077 12.4007 14.6084 12.3916 13.5 13.5C12.3916 14.6084 12.4006 16.8077 11.8618 18.2798L11.1746 20.1562C10.9446 20.7858 10.0553 20.7858 9.82531 20.1562L9.13819 18.2798C8.59932 16.8077 8.60843 14.6084 7.5 13.5C6.39157 12.3916 4.19225 12.4007 2.72023 11.8618L0.843814 11.1747C0.215148 10.9447 0.215148 10.0553 0.843814 9.82534L2.72023 9.13822C4.19225 8.59935 6.39157 8.60843 7.5 7.5C8.60843 6.39157 8.59932 4.19229 9.13819 2.72026L9.82531 0.843845Z\"\n fill={color}\n />\n </motion.svg>\n );\n};\n\ninterface SparklesTextProps {\n /**\n * @default <div />\n * @type ReactElement\n * @description\n * The component to be rendered as the text\n * */\n as?: ReactElement;\n\n /**\n * @default \"\"\n * @type string\n * @description\n * The className of the text\n */\n className?: string;\n\n /**\n * @required\n * @type ReactNode\n * @description\n * The content to be displayed\n * */\n children: React.ReactNode;\n\n /**\n * @default 10\n * @type number\n * @description\n * The count of sparkles\n * */\n sparklesCount?: number;\n\n /**\n * @default \"{first: '#9E7AFF', second: '#FE8BBB'}\"\n * @type string\n * @description\n * The colors of the sparkles\n * */\n colors?: {\n first: string;\n second: string;\n };\n}\n\nexport const SparklesText: React.FC<SparklesTextProps> = ({\n children,\n colors = { first: \"#9E7AFF\", second: \"#FE8BBB\" },\n className,\n sparklesCount = 10,\n ...props\n}) => {\n const [sparkles, setSparkles] = useState<Sparkle[]>([]);\n\n useEffect(() => {\n const generateStar = (): Sparkle => {\n const starX = `${Math.random() * 100}%`;\n const starY = `${Math.random() * 100}%`;\n const color = Math.random() > 0.5 ? colors.first : colors.second;\n const delay = Math.random() * 2;\n const scale = Math.random() * 1 + 0.3;\n const lifespan = Math.random() * 10 + 5;\n const id = `${starX}-${starY}-${Date.now()}`;\n return { id, x: starX, y: starY, color, delay, scale, lifespan };\n };\n\n const initializeStars = () => {\n const newSparkles = Array.from({ length: sparklesCount }, generateStar);\n setSparkles(newSparkles);\n };\n\n const updateStars = () => {\n setSparkles((currentSparkles) =>\n currentSparkles.map((star) => {\n if (star.lifespan <= 0) {\n return generateStar();\n } else {\n return { ...star, lifespan: star.lifespan - 0.1 };\n }\n })\n );\n };\n\n initializeStars();\n const interval = setInterval(updateStars, 100);\n\n return () => clearInterval(interval);\n }, [colors.first, colors.second, sparklesCount]);\n\n return (\n <div\n className={cn(\"text-6xl font-bold\", className)}\n {...props}\n style={\n {\n \"--sparkles-first-color\": `${colors.first}`,\n \"--sparkles-second-color\": `${colors.second}`,\n } as CSSProperties\n }\n >\n <span className=\"relative inline-block\">\n {sparkles.map((sparkle) => (\n <Sparkle key={sparkle.id} {...sparkle} />\n ))}\n <strong>{children}</strong>\n </span>\n </div>\n );\n};\n",+ "content": "\"use client\";\n\nimport { motion } from \"motion/react\";\nimport { CSSProperties, ReactElement, useEffect, useState } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface Sparkle {\n id: string;\n x: string;\n y: string;\n color: string;\n delay: number;\n scale: number;\n lifespan: number;\n}\n\nconst Sparkle: React.FC<Sparkle> = ({ id, x, y, color, delay, scale }) => {\n return (\n <motion.svg\n key={id}\n className=\"pointer-events-none absolute z-20\"\n initial={{ opacity: 0, left: x, top: y }}\n animate={{\n opacity: [0, 1, 0],\n scale: [0, scale, 0],\n rotate: [75, 120, 150],\n }}\n transition={{ duration: 0.8, repeat: Infinity, delay }}\n width=\"21\"\n height=\"21\"\n viewBox=\"0 0 21 21\"\n >\n <path\n d=\"M9.82531 0.843845C10.0553 0.215178 10.9446 0.215178 11.1746 0.843845L11.8618 2.72026C12.4006 4.19229 12.3916 6.39157 13.5 7.5C14.6084 8.60843 16.8077 8.59935 18.2797 9.13822L20.1561 9.82534C20.7858 10.0553 20.7858 10.9447 20.1561 11.1747L18.2797 11.8618C16.8077 12.4007 14.6084 12.3916 13.5 13.5C12.3916 14.6084 12.4006 16.8077 11.8618 18.2798L11.1746 20.1562C10.9446 20.7858 10.0553 20.7858 9.82531 20.1562L9.13819 18.2798C8.59932 16.8077 8.60843 14.6084 7.5 13.5C6.39157 12.3916 4.19225 12.4007 2.72023 11.8618L0.843814 11.1747C0.215148 10.9447 0.215148 10.0553 0.843814 9.82534L2.72023 9.13822C4.19225 8.59935 6.39157 8.60843 7.5 7.5C8.60843 6.39157 8.59932 4.19229 9.13819 2.72026L9.82531 0.843845Z\"\n fill={color}\n />\n </motion.svg>\n );\n};\n\ninterface SparklesTextProps {\n /**\n * @default <div />\n * @type ReactElement\n * @description\n * The component to be rendered as the text\n * */\n as?: ReactElement;\n\n /**\n * @default \"\"\n * @type string\n * @description\n * The className of the text\n */\n className?: string;\n\n /**\n * @required\n * @type ReactNode\n * @description\n * The content to be displayed\n * */\n children: React.ReactNode;\n\n /**\n * @default 10\n * @type number\n * @description\n * The count of sparkles\n * */\n sparklesCount?: number;\n\n /**\n * @default \"{first: '#9E7AFF', second: '#FE8BBB'}\"\n * @type string\n * @description\n * The colors of the sparkles\n * */\n colors?: {\n first: string;\n second: string;\n };\n}\n\nexport const SparklesText: React.FC<SparklesTextProps> = ({\n children,\n colors = { first: \"#9E7AFF\", second: \"#FE8BBB\" },\n className,\n sparklesCount = 10,\n ...props\n}) => {\n const [sparkles, setSparkles] = useState<Sparkle[]>([]);\n\n useEffect(() => {\n const generateStar = (): Sparkle => {\n const starX = `${Math.random() * 100}%`;\n const starY = `${Math.random() * 100}%`;\n const color = Math.random() > 0.5 ? colors.first : colors.second;\n const delay = Math.random() * 2;\n const scale = Math.random() * 1 + 0.3;\n const lifespan = Math.random() * 10 + 5;\n const id = `${starX}-${starY}-${Date.now()}`;\n return { id, x: starX, y: starY, color, delay, scale, lifespan };\n };\n\n const initializeStars = () => {\n const newSparkles = Array.from({ length: sparklesCount }, generateStar);\n setSparkles(newSparkles);\n };\n\n const updateStars = () => {\n setSparkles((currentSparkles) =>\n currentSparkles.map((star) => {\n if (star.lifespan <= 0) {\n return generateStar();\n } else {\n return { ...star, lifespan: star.lifespan - 0.1 };\n }\n }),\n );\n };\n\n initializeStars();\n const interval = setInterval(updateStars, 100);\n\n return () => clearInterval(interval);\n }, [colors.first, colors.second, sparklesCount]);\n\n return (\n <div\n className={cn(\"text-6xl font-bold\", className)}\n {...props}\n style={\n {\n \"--sparkles-first-color\": `${colors.first}`,\n \"--sparkles-second-color\": `${colors.second}`,\n } as CSSProperties\n }\n >\n <span className=\"relative inline-block\">\n {sparkles.map((sparkle) => (\n <Sparkle key={sparkle.id} {...sparkle} />\n ))}\n <strong>{children}</strong>\n </span>\n </div>\n );\n};\n","type": "registry:ui","target": "components/magicui/sparkles-text.tsx"}