{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "hover-links", "title": "Hover Links", "description": "A collection of links with hover effects", "dependencies": [ "framer-motion" ], "files": [ { "path": "registry/pioneerui/hover-links.tsx", "content": "\"use client\"\n\nimport type React from \"react\"\nimport { useRef } from \"react\"\nimport { motion, useMotionValue, useSpring, useTransform } from \"framer-motion\"\nimport { FiArrowRight } from \"react-icons/fi\"\n\ninterface LinkProps {\n heading: string\n subheading: string\n imgSrc: string\n href: string\n}\n\ninterface UniqueHoverImageLinksProps {\n links: LinkProps[]\n className?: string\n}\n\nexport const HoverImageLinks: React.FC = ({ links, className = \"\" }) => {\n return (\n
\n
\n
\n {links.map((link, index) => (\n \n ))}\n
\n
\n
\n )\n}\n\nconst Link: React.FC = ({ heading, imgSrc, subheading, href }) => {\n const ref = useRef(null)\n\n const x = useMotionValue(0)\n const y = useMotionValue(0)\n\n const mouseXSpring = useSpring(x)\n const mouseYSpring = useSpring(y)\n\n const rotateX = useTransform(mouseYSpring, [-0.5, 0.5], [\"17.5deg\", \"-17.5deg\"])\n const rotateY = useTransform(mouseXSpring, [-0.5, 0.5], [\"-17.5deg\", \"17.5deg\"])\n\n const handleMouseMove = (e: React.MouseEvent) => {\n if (!ref.current) return\n\n const rect = ref.current.getBoundingClientRect()\n\n const width = rect.width\n const height = rect.height\n\n const mouseX = e.clientX - rect.left\n const mouseY = e.clientY - rect.top\n\n const xPct = mouseX / width - 0.5\n const yPct = mouseY / height - 0.5\n\n x.set(xPct)\n y.set(yPct)\n }\n\n return (\n \n
\n \n
\n
\n \n \n {heading}\n \n \n {subheading}\n \n
\n \n Learn More\n \n \n \n \n )\n}\n\n", "type": "registry:ui", "target": "components/pioneerui/hover-links.tsx" } ], "type": "registry:ui" }