{ "name": "progressive-blur", "type": "registry:ui", "registryDependencies": [], "dependencies": [ "motion" ], "devDependencies": [], "tailwind": {}, "cssVars": { "light": {}, "dark": {} }, "files": [ { "path": "progressive-blur.tsx", "content": "'use client';\nimport { cn } from '@/lib/utils';\nimport { HTMLMotionProps, motion } from 'motion/react';\n\nexport const GRADIENT_ANGLES = {\n top: 0,\n right: 90,\n bottom: 180,\n left: 270,\n};\n\nexport type ProgressiveBlurProps = {\n direction?: keyof typeof GRADIENT_ANGLES;\n blurLayers?: number;\n className?: string;\n blurIntensity?: number;\n} & HTMLMotionProps<'div'>;\n\nexport function ProgressiveBlur({\n direction = 'bottom',\n blurLayers = 8,\n className,\n blurIntensity = 0.25,\n ...props\n}: ProgressiveBlurProps) {\n const layers = Math.max(blurLayers, 2);\n const segmentSize = 1 / (blurLayers + 1);\n\n return (\n
\n {Array.from({ length: layers }).map((_, index) => {\n const angle = GRADIENT_ANGLES[direction];\n const gradientStops = [\n index * segmentSize,\n (index + 1) * segmentSize,\n (index + 2) * segmentSize,\n (index + 3) * segmentSize,\n ].map(\n (pos, posIndex) =>\n `rgba(255, 255, 255, ${posIndex === 1 || posIndex === 2 ? 1 : 0}) ${pos * 100}%`\n );\n\n const gradient = `linear-gradient(${angle}deg, ${gradientStops.join(\n ', '\n )})`;\n\n return (\n \n );\n })}\n
\n );\n}\n", "type": "registry:ui" } ] }