{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "following-eyes",
  "type": "registry:block",
  "title": "Following eyes",
  "description": "Following eyes",
  "files": [
    {
      "path": "components/usages/followingeyesusage.tsx",
      "content": "\"use client\";\r\n\r\nimport React from \"react\";\r\n\r\nimport { MouseFollowingEyes } from \"@/registry/open-source/following-eyes\";\r\n\r\nexport default function Usage() {\r\n\treturn (\r\n\t\t<div className=\"h-screen w-full flex items-center justify-center relative overflow-hidden bg-background\">\r\n\t\t\t<MouseFollowingEyes />\r\n\t\t</div>\r\n\t);\r\n}\r\n",
      "type": "registry:block",
      "target": "~/example.tsx"
    },
    {
      "path": "components/usages/followingeyesusage.tsx",
      "content": "\"use client\";\r\n\r\nimport React from \"react\";\r\n\r\nimport { MouseFollowingEyes } from \"@/registry/open-source/following-eyes\";\r\n\r\nexport default function Usage() {\r\n\treturn (\r\n\t\t<div className=\"h-screen w-full flex items-center justify-center relative overflow-hidden bg-background\">\r\n\t\t\t<MouseFollowingEyes />\r\n\t\t</div>\r\n\t);\r\n}\r\n",
      "type": "registry:ui"
    },
    {
      "path": "registry/open-source/following-eyes.tsx",
      "content": "\"use client\";\n\nimport React, { useEffect, useRef } from \"react\";\n\nimport Link from \"next/link\";\n\nimport ThemeToggle from \"@/components/ui/navbar-components/theme-toggle\";\nimport SVG from \"react-inlinesvg\";\n\nimport { ThemeToggleButton } from \"./theme_changer/ThemeToggleButton\";\n\n// Credit:\n// https://nurui.vercel.app/docs/following-eye\n\nconst MouseFollowingEyes: React.FC = () => {\n\tconst eye1Ref = useRef<HTMLDivElement>(null);\n\tconst eye2Ref = useRef<HTMLDivElement>(null);\n\tconst mousePos = useRef({ x: 0, y: 0 });\n\n\tuseEffect(() => {\n\t\tconst handleMouseMove = (e: MouseEvent) => {\n\t\t\tmousePos.current = { x: e.clientX, y: e.clientY };\n\t\t};\n\n\t\twindow.addEventListener(\"mousemove\", handleMouseMove);\n\n\t\treturn () => window.removeEventListener(\"mousemove\", handleMouseMove);\n\t}, []);\n\n\treturn (\n\t\t<div className=\"flex justify-center items-center\">\n\t\t\t<div className=\"flex space-x-2\">\n\t\t\t\t<div className=\"group\">\n\t\t\t\t\t<div className=\"group-hover:block hidden\">\n\t\t\t\t\t\t<ThemeToggleButton\n\t\t\t\t\t\t\tshowLabel\n\t\t\t\t\t\t\tvariant=\"gif\"\n\t\t\t\t\t\t\turl=\"https://media.giphy.com/media/KBbr4hHl9DSahKvInO/giphy.gif?cid=790b76112m5eeeydoe7et0cr3j3ekb1erunxozyshuhxx2vl&ep=v1_stickers_search&rid=giphy.gif&ct=s\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"group-hover:hidden block\">\n\t\t\t\t\t\t<Eye\n\t\t\t\t\t\t\tselfRef={eye1Ref}\n\t\t\t\t\t\t\totherRef={eye2Ref}\n\t\t\t\t\t\t\tmousePos={mousePos}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"group\">\n\t\t\t\t\t<Link href=\"/drive25\">\n\t\t\t\t\t\t<SVG\n\t\t\t\t\t\t\tsrc={\"/dbsbottom.svg\"}\n\t\t\t\t\t\t\ttitle={\"half of our logo\"}\n\t\t\t\t\t\t\theight={80}\n\t\t\t\t\t\t\twidth={233}\n\t\t\t\t\t\t\tclassName=\"stroke-white group-hover:block hidden\"\n\t\t\t\t\t\t\trole=\"img\"\n\t\t\t\t\t\t\taria-label={\"half of our logo\"}\n\t\t\t\t\t\t\tloader={<span>Loading...</span>}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Link>\n\t\t\t\t\t<div className=\"group-hover:hidden block\">\n\t\t\t\t\t\t<Eye\n\t\t\t\t\t\t\tselfRef={eye2Ref}\n\t\t\t\t\t\t\totherRef={eye1Ref}\n\t\t\t\t\t\t\tmousePos={mousePos}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\ninterface EyeProps {\n\tselfRef: React.RefObject<HTMLDivElement>;\n\totherRef: React.RefObject<HTMLDivElement>;\n\tmousePos: React.MutableRefObject<{ x: number; y: number }>;\n}\n\nconst Eye: React.FC<EyeProps> = ({\n\tselfRef,\n\totherRef,\n\tmousePos,\n\tshowWhat,\n\tsetShowWhat,\n}) => {\n\tconst pupilRef = useRef<HTMLDivElement>(null);\n\tconst center = useRef({ x: 0, y: 0 });\n\n\tconst updateCenter = () => {\n\t\tif (!selfRef.current) return;\n\t\tconst rect = selfRef.current.getBoundingClientRect();\n\t\tcenter.current = {\n\t\t\tx: rect.left + rect.width / 2,\n\t\t\ty: rect.top + rect.height / 2,\n\t\t};\n\t};\n\n\tuseEffect(() => {\n\t\tupdateCenter();\n\t\twindow.addEventListener(\"resize\", updateCenter);\n\n\t\tlet frameId: number;\n\n\t\tconst animate = () => {\n\t\t\tconst { x, y } = mousePos.current;\n\n\t\t\tconst isInside = (ref: React.RefObject<HTMLDivElement>) => {\n\t\t\t\tconst rect = ref.current?.getBoundingClientRect();\n\t\t\t\tif (!rect) return false;\n\t\t\t\treturn (\n\t\t\t\t\tx >= rect.left &&\n\t\t\t\t\tx <= rect.right &&\n\t\t\t\t\ty >= rect.top &&\n\t\t\t\t\ty <= rect.bottom\n\t\t\t\t);\n\t\t\t};\n\n\t\t\tif (!(isInside(selfRef) || isInside(otherRef))) {\n\t\t\t\tconst dx = x - center.current.x;\n\t\t\t\tconst dy = y - center.current.y;\n\t\t\t\tconst angle = Math.atan2(dy, dx);\n\n\t\t\t\tconst maxMove = 10;\n\t\t\t\tconst pupilX = Math.cos(angle) * maxMove;\n\t\t\t\tconst pupilY = Math.sin(angle) * maxMove;\n\n\t\t\t\tif (pupilRef.current) {\n\t\t\t\t\tpupilRef.current.style.transform = `translate(${pupilX}px, ${pupilY}px)`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tframeId = requestAnimationFrame(animate);\n\t\t};\n\n\t\tframeId = requestAnimationFrame(animate);\n\n\t\treturn () => {\n\t\t\tcancelAnimationFrame(frameId);\n\t\t\twindow.removeEventListener(\"resize\", updateCenter);\n\t\t};\n\t}, [selfRef, otherRef, mousePos]);\n\n\treturn (\n\t\t<div\n\t\t\tref={selfRef}\n\t\t\tclassName=\"relative bg-white border-4 border-black rounded-full h-12 w-12 flex items-center justify-center\"\n\t\t>\n\t\t\t<div ref={pupilRef} className=\"absolute bg-black rounded-full h-4 w-4\">\n\t\t\t\t<div className=\"w-1 h-1 bg-white rounded-full absolute bottom-1 right-1\"></div>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport { MouseFollowingEyes };\n",
      "type": "registry:ui"
    },
    {
      "path": "components/ui/navbar-components/theme-toggle.tsx",
      "content": "\"use client\";\n\nimport { Toggle } from \"@/components/ui/toggle\";\nimport { MoonIcon, SunIcon } from \"lucide-react\";\nimport { useTheme } from \"next-themes\";\n\nexport default function ThemeToggle() {\n\tconst { theme, setTheme } = useTheme();\n\n\treturn (\n\t\t<div>\n\t\t\t<Toggle\n\t\t\t\tvariant=\"outline\"\n\t\t\t\tclassName=\"group data-[state=on]:hover:bg-muted text-muted-foreground data-[state=on]:text-muted-foreground data-[state=on]:hover:text-foreground size-8 rounded-full border-none shadow-none data-[state=on]:bg-transparent\"\n\t\t\t\tpressed={theme === \"dark\"}\n\t\t\t\tonPressedChange={() =>\n\t\t\t\t\tsetTheme((prev) => (prev === \"dark\" ? \"light\" : \"dark\"))\n\t\t\t\t}\n\t\t\t\taria-label={`Switch to ${theme === \"dark\" ? \"light\" : \"dark\"} mode`}\n\t\t\t>\n\t\t\t\t{/* Note: After dark mode implementation, rely on dark: prefix rather than group-data-[state=on]: */}\n\t\t\t\t<MoonIcon\n\t\t\t\t\tsize={16}\n\t\t\t\t\tclassName=\"shrink-0 scale-0 opacity-0 transition-all group-data-[state=on]:scale-100 group-data-[state=on]:opacity-100\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t/>\n\t\t\t\t<SunIcon\n\t\t\t\t\tsize={16}\n\t\t\t\t\tclassName=\"absolute shrink-0 scale-100 opacity-100 transition-all group-data-[state=on]:scale-0 group-data-[state=on]:opacity-0\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t/>\n\t\t\t</Toggle>\n\t\t</div>\n\t);\n}\n",
      "type": "registry:ui"
    },
    {
      "path": "components/ui/toggle.tsx",
      "content": "\"use client\";\n\nimport React from \"react\";\n\nimport { cn } from \"@/registry/utilities/cn\";\nimport * as TogglePrimitive from \"@radix-ui/react-toggle\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nconst toggleVariants = cva(\n\t\"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground\",\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: \"bg-transparent\",\n\t\t\t\toutline:\n\t\t\t\t\t\"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground\",\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\tdefault: \"h-10 px-3\",\n\t\t\t\tsm: \"h-9 px-2.5\",\n\t\t\t\tlg: \"h-11 px-5\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: \"default\",\n\t\t\tsize: \"default\",\n\t\t},\n\t}\n);\n\nconst Toggle = React.forwardRef<\n\tReact.ElementRef<typeof TogglePrimitive.Root>,\n\tReact.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &\n\t\tVariantProps<typeof toggleVariants>\n>(({ className, variant, size, ...props }, ref) => (\n\t<TogglePrimitive.Root\n\t\tref={ref}\n\t\tclassName={cn(toggleVariants({ variant, size, className }))}\n\t\t{...props}\n\t/>\n));\n\nToggle.displayName = TogglePrimitive.Root.displayName;\n\nexport { Toggle, toggleVariants };\n",
      "type": "registry:ui"
    },
    {
      "path": "registry/utilities/cn.ts",
      "content": "import { ClassValue, clsx } from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n\treturn twMerge(clsx(inputs));\r\n}\r\n",
      "type": "registry:ui"
    },
    {
      "path": "registry/open-source/theme_changer/ThemeToggleButton.tsx",
      "content": "\"use client\";\n\nimport React from \"react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { MoonIcon, SunIcon } from \"lucide-react\";\nimport { useTheme } from \"next-themes\";\n\nimport {\n\tAnimationStart,\n\tAnimationVariant,\n\tcreateAnimation,\n} from \"../theme-animations\";\n\n// Credit:\n// https://skiper-ui.com/docs/components/theme-toggle-animations\n\n// CSS to Add to global\n\n/*\n.page-transition {\n  opacity: 0;\n  transition: opacity 0.7s ease;\n}\n\n.page-transition.active {\n  opacity: 1;\n}\n\n@supports (view-transition-name: none) {\n  .page-transition {\n    transition: none;\n  }\n\n  ::view-transition-group(root) {\n    animation-duration: 0.7s;\n    animation-timing-function: linear(\n      0 0%, 0.2342 12.49%, 0.4374 24.99%,\n      0.6093 37.49%, 0.6835 43.74%,\n      0.7499 49.99%, 0.8086 56.25%,\n      0.8593 62.5%, 0.9023 68.75%, 0.9375 75%,\n      0.9648 81.25%, 0.9844 87.5%,\n      0.9961 93.75%, 1 100%\n    );\n  }\n\n  ::view-transition-new(root) {\n    mask: url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 40 40\"><defs><filter id=\"blur\"><feGaussianBlur stdDeviation=\"2\"/></filter></defs><circle cx=\"0\" cy=\"0\" r=\"18\" fill=\"white\" filter=\"url(%23blur)\"/></svg>') top left / 0 no-repeat;\n    mask-origin: content-box;\n    animation: scale 1s;\n    transform-origin: top left;\n  }\n\n  ::view-transition-old(root),\n  .dark::view-transition-old(root) {\n    animation: scale 1s;\n    transform-origin: top left;\n    z-index: -1;\n  }\n\n  @keyframes scale {\n    to {\n      mask-size: 350vmax;\n    }\n  }\n}\n*/\n\ninterface ThemeToggleAnimationProps {\n\tvariant?: AnimationVariant;\n\tstart?: AnimationStart;\n\tshowLabel?: boolean;\n\turl?: string;\n}\n\nexport function ThemeToggleButton({\n\tvariant = \"circle-blur\",\n\tstart = \"top-left\",\n\tshowLabel = false,\n\turl = \"\",\n}: ThemeToggleAnimationProps) {\n\tconst { theme, setTheme } = useTheme();\n\n\tconst styleId = \"theme-transition-styles\";\n\n\tconst updateStyles = React.useCallback((css: string, name: string) => {\n\t\tif (typeof window === \"undefined\") return;\n\n\t\tlet styleElement = document.getElementById(styleId) as HTMLStyleElement;\n\n\t\tif (!styleElement) {\n\t\t\tstyleElement = document.createElement(\"style\");\n\t\t\tstyleElement.id = styleId;\n\t\t\tdocument.head.appendChild(styleElement);\n\t\t}\n\n\t\tstyleElement.textContent = css;\n\t}, []);\n\n\tconst toggleTheme = React.useCallback(() => {\n\t\tconst animation = createAnimation(variant, start, url);\n\n\t\tupdateStyles(animation.css, animation.name);\n\n\t\tif (typeof window === \"undefined\") return;\n\n\t\tconst switchTheme = () => {\n\t\t\tsetTheme(theme === \"light\" ? \"dark\" : \"light\");\n\t\t};\n\n\t\tif (!document.startViewTransition) {\n\t\t\tswitchTheme();\n\t\t\treturn;\n\t\t}\n\n\t\tdocument.startViewTransition(switchTheme);\n\t}, [theme, setTheme]);\n\n\treturn (\n\t\t<Button\n\t\t\tonClick={toggleTheme}\n\t\t\tvariant=\"ghost\"\n\t\t\tsize=\"icon\"\n\t\t\tclassName=\"w-9 p-0 h-9 relative group\"\n\t\t\tname=\"Theme Toggle Button\"\n\t\t>\n\t\t\t<SunIcon className=\"size-[1.2rem] rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0\" />\n\t\t\t<MoonIcon className=\"absolute size-[1.2rem] rotate-90 scale-0 transition-transform dark:rotate-0 dark:scale-100\" />\n\t\t\t<span className=\"sr-only\">Theme Toggle </span>\n\t\t\t{showLabel && (\n\t\t\t\t<>\n\t\t\t\t\t<span className=\"hidden group-hover:block border rounded-full px-2 absolute -top-10\">\n\t\t\t\t\t\tvariant = {variant}\n\t\t\t\t\t</span>\n\t\t\t\t\t<span className=\"hidden group-hover:block border rounded-full px-2 absolute -bottom-10\">\n\t\t\t\t\t\tstart = {start}\n\t\t\t\t\t</span>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</Button>\n\t);\n}\n",
      "type": "registry:ui"
    },
    {
      "path": "components/ui/button.tsx",
      "content": "import * as React from \"react\";\r\n\r\nimport { cn } from \"@/registry/utilities/cn\";\r\nimport { Slot } from \"@radix-ui/react-slot\";\r\nimport { cva, type VariantProps } from \"class-variance-authority\";\r\n\r\nconst buttonVariants = cva(\r\n\t\"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm text-white hover:text-gray-400 font-medium ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\r\n\t{\r\n\t\tvariants: {\r\n\t\t\tvariant: {\r\n\t\t\t\tsimple:\r\n\t\t\t\t\t\"bg-secondary relative z-10 bg-transparent hover:border-secondary hover:bg-secondary/50  border border-transparent dark:text-white text-sm md:text-sm transition font-medium duration-200  rounded-md px-4 py-2  flex items-center justify-center\",\r\n\t\t\t\tdefault: \"bg-primary text-primary-foreground hover:bg-primary/90\",\r\n\t\t\t\tdestructive:\r\n\t\t\t\t\t\"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\r\n\t\t\t\toutline:\r\n\t\t\t\t\t\"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\r\n\t\t\t\tsecondary:\r\n\t\t\t\t\t\"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\r\n\t\t\t\tghost: \"hover:bg-accent hover:text-black hover:stroke-black dark:text-white text-black\",\r\n\t\t\t\tlink: \"text-primary underline-offset-4 hover:underline\",\r\n\t\t\t},\r\n\t\t\tsize: {\r\n\t\t\t\tdefault: \"h-10 px-4 py-2\",\r\n\t\t\t\tsm: \"h-9 rounded-md px-3\",\r\n\t\t\t\tlg: \"h-11 rounded-md px-8\",\r\n\t\t\t\ticon: \"h-10 w-10\",\r\n\t\t\t},\r\n\t\t},\r\n\t\tdefaultVariants: {\r\n\t\t\tvariant: \"default\",\r\n\t\t\tsize: \"default\",\r\n\t\t},\r\n\t}\r\n);\r\n\r\nexport interface ButtonProps\r\n\textends React.ButtonHTMLAttributes<HTMLButtonElement>,\r\n\t\tVariantProps<typeof buttonVariants> {\r\n\tasChild?: boolean;\r\n}\r\n\r\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\r\n\t({ className, variant, size, asChild = false, ...props }, ref) => {\r\n\t\tconst Comp = asChild ? Slot : \"button\";\r\n\t\treturn (\r\n\t\t\t<Comp\r\n\t\t\t\tclassName={cn(buttonVariants({ variant, size, className }))}\r\n\t\t\t\tref={ref}\r\n\t\t\t\t{...props}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\nButton.displayName = \"Button\";\r\n\r\nexport { Button, buttonVariants };\r\n",
      "type": "registry:ui"
    }
  ]
}