{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "distorted-glass-demo", "registryDependencies": [ "distorted-glass" ], "files": [ { "path": "registry/default/example/distorted-glass-demo.tsx", "content": "\"use client\"\n\nimport { useRef } from \"react\"\nimport { motion, useScroll, useTransform } from \"motion/react\"\n\nimport { DistortedGlass } from \"@/registry/default/ui/distorted-glass\"\n\nexport default function DistortedGlassDemo() {\n const containerRef = useRef(null)\n const { scrollYProgress } = useScroll({\n target: containerRef,\n offset: [\"start start\", \"end end\"],\n })\n\n // Transform values for parallax effects\n const parallaxY = useTransform(scrollYProgress, [0, 1], [0, -200])\n const parallaxYSlow = useTransform(scrollYProgress, [0, 1], [0, -100])\n const parallaxYFast = useTransform(scrollYProgress, [0, 1], [0, -300])\n\n return (\n
\n {/* Fixed Distorted Glass Header */}\n\n {/* Scrollable Content Area - Content scrolls behind the glass */}\n
\n
\n \n
\n {/* Section 1: Large Moving Text - Easy to see distortion */}\n
\n
\n \n DISTORTED\n \n \n GLASS\n \n
\n
\n\n {/* Section 2: Grid of Moving Squares */}\n
\n
\n
\n {Array.from({ length: 64 }).map((_, i) => {\n const row = Math.floor(i / 8)\n const col = i % 8\n const squareId = `square-${row}-${col}`\n return (\n \n )\n })}\n
\n
\n
\n\n {/* Section 3: Radial Circles */}\n
\n
\n {Array.from({ length: 5 }).map((_, i) => {\n const size = 200 + i * 80\n const circleId = `circle-${size}`\n return (\n \n )\n })}\n
\n
\n\n {/* Section 4: Lines Pattern */}\n
\n
\n {Array.from({ length: 20 }).map((_, i) => {\n const lineTop = i * 10\n const lineId = `line-${lineTop}`\n return (\n \n )\n })}\n
\n
\n\n {/* Final Info Section */}\n
\n
\n

\n About Distorted Glass\n

\n

\n The DistortedGlass component uses SVG filters with fractal noise\n to create a unique glass morphism effect.\n

\n
\n
\n
\n
\n )\n}\n", "type": "registry:component" } ], "type": "registry:component" }