{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "mesh-gradient-bg", "title": "Mesh Gradient Background", "description": "Living gradient with amorphous color blobs slowly drifting across the frame.", "dependencies": [ "remotion" ], "files": [ { "path": "registry/remocn/mesh-gradient-bg/index.tsx", "content": "\"use client\";\n\nimport { useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface MeshGradientBgProps {\n colors?: string[];\n speed?: number;\n background?: string;\n blur?: number;\n className?: string;\n}\n\nexport function MeshGradientBg({\n colors = [\"#ff0080\", \"#7928ca\", \"#00d4ff\", \"#ffb800\"],\n speed = 1,\n background = \"#0a0a0a\",\n blur = 80,\n className,\n}: MeshGradientBgProps) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n\n const isDark = isColorDark(background);\n const blendMode: \"screen\" | \"multiply\" = isDark ? \"screen\" : \"multiply\";\n\n // One full cycle every (2 / speed) seconds — fps-independent.\n const t = (frame / fps) * speed;\n\n const blobs = colors.map((color, i) => {\n const phase = i * 1.7;\n const sx = Math.sin(t * Math.PI + phase);\n const cy = Math.cos(t * Math.PI * 1.3 + phase);\n const sx2 = Math.sin(t * Math.PI * 0.7 * (2 / 3) + phase * 0.5);\n\n const left = 50 + sx * 25;\n const top = 50 + cy * 25;\n const scale = 1 + sx2 * 0.2;\n\n return { color, left, top, scale, key: `blob-${i}` };\n });\n\n return (\n