{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "apple-hello-effect", "title": "Apple Hello Effect", "author": "siby369 ", "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\"\n\nimport type { TargetAndTransition } from \"motion/react\"\nimport { motion } from \"motion/react\"\nimport type { ComponentProps } from \"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\nexport type AppleHelloEffectProps = Omit<\n ComponentProps,\n \"speed\" | \"onAnimationComplete\"\n> & {\n /**\n * Animation speed multiplier (higher = faster).\n * @defaultValue 1\n * */\n speed?: number\n /** Called when the full handwriting animation completes. */\n onAnimationComplete?: () => void\n}\n\nfunction AppleHelloVietnameseEffect({\n className,\n speed = 1,\n onAnimationComplete,\n ...props\n}: AppleHelloEffectProps) {\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}: AppleHelloEffectProps) {\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://siby369.github.io/components/apple-hello-effect", "type": "registry:component" }