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