{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "apple-hello-effect", "title": "Apple Hello Effect", "author": "shakil-ahmed-billal ", "description": "SVG writing animation inspired by Apple's Hello screen.", "dependencies": [ "motion" ], "files": [ { "path": "src/registry/components/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\nimport type { ComponentProps } from \"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\nexport type AppleHelloEffectProps = Omit<\r\n ComponentProps,\r\n \"speed\" | \"onAnimationComplete\"\r\n> & {\r\n /**\r\n * Animation speed multiplier (higher = faster).\r\n * @defaultValue 1\r\n * */\r\n speed?: number\r\n /** Called when the full handwriting animation completes. */\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}: AppleHelloEffectProps) {\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}: AppleHelloEffectProps) {\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://xhakil.vercel.app/components/apple-hello-effect", "type": "registry:component" }