{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "parallax-tilt-card",
  "type": "registry:ui",
  "title": "Parallax Tilt Card",
  "author": "Rishabh Bose <https://theb0se.vercel.app/>",
  "description": "Multi-depth 3D spatial card featuring three independent Z-planes that shift at graduated parallax ratios under pointer movement.",
  "dependencies": [
    "framer-motion",
    "lucide-react",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "components/ui/parallax-tilt-card.tsx",
      "content": "\"use client\";\n\nimport React, { useRef } from \"react\";\nimport {\n  motion,\n  useMotionValue,\n  useSpring,\n  useTransform,\n  useReducedMotion,\n} from \"framer-motion\";\nimport { Cpu, Layers, Sparkles } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface ParallaxTiltCardProps {\n  /** Card title heading. Default: \"Spatial Depth Plane\" */\n  title?: string;\n  /** Supporting card description. */\n  subtitle?: string;\n  /** Peak 3D rotation angle in degrees. Default: 14 */\n  maxTilt?: number;\n  /** Hooke's Law spring stiffness coefficient. Default: 240 */\n  stiffness?: number;\n  /** Spring damping coefficient. Default: 22 */\n  damping?: number;\n  className?: string;\n}\n\nexport function ParallaxTiltCard({\n  title = \"Spatial Depth Plane\",\n  subtitle = \"Three independent Z-planes translate at graduated ratios under pointer movement.\",\n  maxTilt = 14,\n  stiffness = 240,\n  damping = 22,\n  className,\n}: ParallaxTiltCardProps) {\n  const cardRef = useRef<HTMLDivElement | null>(null);\n  const shouldReduceMotion = useReducedMotion() ?? false;\n\n  const pctX = useMotionValue(0);\n  const pctY = useMotionValue(0);\n\n  const smoothX = useSpring(pctX, { stiffness, damping, mass: 0.4 });\n  const smoothY = useSpring(pctY, { stiffness, damping, mass: 0.4 });\n\n  const rotateX = useTransform(smoothY, [-1, 1], [maxTilt, -maxTilt]);\n  const rotateY = useTransform(smoothX, [-1, 1], [-maxTilt, maxTilt]);\n\n  // Graduated multi-plane parallax offsets\n  const layer1X = useTransform(smoothX, [-1, 1], [-6, 6]);\n  const layer1Y = useTransform(smoothY, [-1, 1], [-6, 6]);\n\n  const layer2X = useTransform(smoothX, [-1, 1], [-16, 16]);\n  const layer2Y = useTransform(smoothY, [-1, 1], [-16, 16]);\n\n  const layer3X = useTransform(smoothX, [-1, 1], [-26, 26]);\n  const layer3Y = useTransform(smoothY, [-1, 1], [-26, 26]);\n\n  const handleMouseMove = (e: React.MouseEvent<HTMLDivElement>) => {\n    if (shouldReduceMotion) return;\n    const el = cardRef.current;\n    if (!el) return;\n    const rect = el.getBoundingClientRect();\n    const nx = ((e.clientX - rect.left) / rect.width - 0.5) * 2;\n    const ny = ((e.clientY - rect.top) / rect.height - 0.5) * 2;\n    pctX.set(nx);\n    pctY.set(ny);\n  };\n\n  const handleMouseLeave = () => {\n    pctX.set(0);\n    pctY.set(0);\n  };\n\n  return (\n    <div\n      style={{ perspective: \"1100px\" }}\n      className={cn(\"w-full max-w-sm select-none\", className)}\n    >\n      <motion.div\n        ref={cardRef}\n        onMouseMove={handleMouseMove}\n        onMouseLeave={handleMouseLeave}\n        style={{\n          rotateX: shouldReduceMotion ? 0 : rotateX,\n          rotateY: shouldReduceMotion ? 0 : rotateY,\n          transformStyle: \"preserve-3d\",\n        }}\n        className=\"group relative overflow-hidden rounded-3xl border border-neutral-200 bg-white p-6 shadow-sm transition-colors hover:border-neutral-400 dark:border-[#222222] dark:bg-[#0A0A0A] dark:hover:border-[#383838]\"\n      >\n        {/* Depth Plane 1: Background Blueprint Grid */}\n        <motion.div\n          aria-hidden=\"true\"\n          style={{\n            x: shouldReduceMotion ? 0 : layer1X,\n            y: shouldReduceMotion ? 0 : layer1Y,\n          }}\n          className=\"pointer-events-none absolute -inset-6 bg-[radial-gradient(#d4d4d4_1px,transparent_1px)] [background-size:16px_16px] opacity-60 dark:bg-[radial-gradient(#262626_1px,transparent_1px)]\"\n        />\n\n        {/* Depth Plane 2: Floating Mid-Ground Telemetry Module */}\n        <motion.div\n          style={{\n            x: shouldReduceMotion ? 0 : layer2X,\n            y: shouldReduceMotion ? 0 : layer2Y,\n          }}\n          className=\"relative z-10 mb-5 flex items-center justify-between rounded-2xl border border-neutral-200/90 bg-neutral-50/90 p-3.5 backdrop-blur-md dark:border-[#262626] dark:bg-[#141414]/90\"\n        >\n          <div className=\"flex items-center gap-2.5\">\n            <div className=\"flex h-9 w-9 items-center justify-center rounded-xl bg-black text-white dark:bg-white dark:text-black\">\n              <Cpu className=\"h-4 w-4\" />\n            </div>\n            <div>\n              <div className=\"font-mono text-[10px] font-semibold uppercase text-neutral-400\">\n                PLANE_02 // PARALLAX\n              </div>\n              <div className=\"text-xs font-semibold text-black dark:text-white\">\n                ±{maxTilt}° Coupled Tilt\n              </div>\n            </div>\n          </div>\n\n          <Layers className=\"h-4 w-4 text-neutral-400\" />\n        </motion.div>\n\n        {/* Depth Plane 3: High-Elevation Foreground Badge & Copy */}\n        <motion.div\n          style={{\n            x: shouldReduceMotion ? 0 : layer3X,\n            y: shouldReduceMotion ? 0 : layer3Y,\n          }}\n          className=\"relative z-20\"\n        >\n          <span className=\"inline-flex items-center gap-1 rounded-full bg-black px-2.5 py-0.5 font-mono text-[10px] font-semibold text-white dark:bg-white dark:text-black\">\n            <Sparkles className=\"h-3 w-3\" />\n            Z-INDEX +26PX\n          </span>\n          <h3 className=\"mt-2.5 text-base font-semibold text-black dark:text-white\">\n            {title}\n          </h3>\n          <p className=\"mt-1 text-xs leading-relaxed text-neutral-500 dark:text-neutral-400\">\n            {subtitle}\n          </p>\n        </motion.div>\n      </motion.div>\n    </div>\n  );\n}\n\nexport default ParallaxTiltCard;\n",
      "type": "registry:ui",
      "target": "components/ui/parallax-tilt-card.tsx"
    },
    {
      "path": "lib/utils.ts",
      "content": "import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport async function copyToClipboard(text: string): Promise<boolean> {\n  if (typeof window === \"undefined\") return false;\n\n  try {\n    if (navigator.clipboard && window.isSecureContext) {\n      await navigator.clipboard.writeText(text);\n      return true;\n    }\n\n    const textArea = document.createElement(\"textarea\");\n    textArea.value = text;\n    textArea.style.position = \"fixed\";\n    textArea.style.left = \"-999999px\";\n    textArea.style.top = \"-999999px\";\n    document.body.appendChild(textArea);\n    textArea.focus();\n    textArea.select();\n    const succeeded = document.execCommand(\"copy\");\n    textArea.remove();\n    return succeeded;\n  } catch {\n    return false;\n  }\n}\n",
      "type": "registry:lib",
      "target": "lib/utils.ts"
    }
  ]
}
