{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "apple-hello-effect", "type": "registry:component", "title": "Apple Hello Effect", "author": "Rajdeep Singh ", "description": "Create a Xin chào and Hello writing effect inspired by Apple using Motion for React.", "dependencies": [ "motion" ], "registryDependencies": [ "@rajdeep/utils" ], "files": [ { "path": "src/registry/apple-hello-effect/apple-hello-effect.tsx", "content": "\"use client\";\n\nimport type { TargetAndTransition } from \"motion/react\";\nimport { motion } from \"motion/react\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst initialProps: TargetAndTransition = {\n pathLength: 0,\n opacity: 0,\n};\n\nconst animateProps: TargetAndTransition = {\n pathLength: 1,\n opacity: 1,\n};\n\ntype Props = React.ComponentProps & {\n speed?: number;\n onAnimationComplete?: () => void;\n};\n\nfunction AppleHelloVietnameseEffect({\n className,\n speed = 1,\n onAnimationComplete,\n ...props\n}: Props) {\n const calc = (x: number) => x * speed;\n\n return (\n \n xin chào\n\n {/* x1 */}\n \n\n {/* x2 */}\n \n\n {/* i */}\n \n\n {/* n1 */}\n \n\n {/* n2 */}\n \n\n {/* c, h1 */}\n \n\n {/* h2 */}\n \n\n {/* a1 */}\n \n\n {/* a2, o */}\n \n\n {/* sign */}\n \n \n );\n}\n\nfunction AppleHelloEnglishEffect({\n className,\n speed = 1,\n onAnimationComplete,\n ...props\n}: Props) {\n const calc = (x: number) => x * speed;\n\n return (\n \n hello\n\n {/* h1 */}\n \n\n {/* h2, ello */}\n \n \n );\n}\n\nexport { AppleHelloEnglishEffect, AppleHelloVietnameseEffect };\n", "type": "registry:component" } ], "docs": "https://rajdeep-singh.vercel.app/components/writing-effect-inspired-by-apple" }