{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "fade-through",
  "title": "Fade Through",
  "description": "A Material-style content transition: old fades out, new fades in with a soft delay.",
  "dependencies": ["remotion"],
  "files": [
    {
      "path": "registry/remocn/fade-through/index.tsx",
      "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface FadeThroughProps {\n  fromText: string;\n  toText: string;\n  fontSize?: number;\n  color?: string;\n  fontWeight?: number;\n  speed?: number;\n  className?: string;\n}\n\nexport function FadeThrough({\n  fromText,\n  toText,\n  fontSize = 72,\n  color = \"#171717\",\n  fontWeight = 600,\n  speed = 1,\n  className,\n}: FadeThroughProps) {\n  const frame = useCurrentFrame() * speed;\n\n  const exitDur = 8;\n  const enterDur = 13;\n  const overlapF = 1;\n  const microDelayF = 2;\n\n  const exitTotal = exitDur;\n  const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n  const exitEasing = Easing.bezier(0.4, 0, 1, 1);\n  const enterEasing = Easing.bezier(0.2, 0, 0, 1);\n\n  const fromOpacity = interpolate(frame, [0, exitDur], [1, 0], {\n    extrapolateLeft: \"clamp\",\n    extrapolateRight: \"clamp\",\n    easing: exitEasing,\n  });\n  const fromY = interpolate(frame, [0, exitDur], [0, -4], {\n    extrapolateLeft: \"clamp\",\n    extrapolateRight: \"clamp\",\n    easing: exitEasing,\n  });\n\n  const local = frame - newStart;\n  const toOpacity = interpolate(local, [0, enterDur], [0, 1], {\n    extrapolateLeft: \"clamp\",\n    extrapolateRight: \"clamp\",\n    easing: enterEasing,\n  });\n  const toY = interpolate(local, [0, enterDur], [6, 0], {\n    extrapolateLeft: \"clamp\",\n    extrapolateRight: \"clamp\",\n    easing: enterEasing,\n  });\n  const toScale = interpolate(local, [0, enterDur], [0.99, 1], {\n    extrapolateLeft: \"clamp\",\n    extrapolateRight: \"clamp\",\n    easing: enterEasing,\n  });\n  const blurVal = interpolate(local, [0, enterDur], [2, 0], {\n    extrapolateLeft: \"clamp\",\n    extrapolateRight: \"clamp\",\n    easing: enterEasing,\n  });\n\n  const fontStack =\n    \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n  return (\n    <div\n      className={className}\n      style={{\n        position: \"absolute\",\n        inset: 0,\n        background: \"transparent\",\n      }}\n    >\n      <div\n        style={{\n          position: \"absolute\",\n          inset: 0,\n          display: \"flex\",\n          alignItems: \"center\",\n          justifyContent: \"center\",\n        }}\n      >\n        <span\n          style={{\n            fontSize,\n            fontWeight,\n            color,\n            letterSpacing: \"-0.03em\",\n            fontFamily: fontStack,\n            display: \"inline-block\",\n            transformOrigin: \"50% 50%\",\n            opacity: fromOpacity,\n            transform: `translateY(${fromY}px)`,\n          }}\n        >\n          {fromText}\n        </span>\n      </div>\n\n      <div\n        style={{\n          position: \"absolute\",\n          inset: 0,\n          display: \"flex\",\n          alignItems: \"center\",\n          justifyContent: \"center\",\n        }}\n      >\n        <span\n          style={{\n            fontSize,\n            fontWeight,\n            color,\n            letterSpacing: \"-0.03em\",\n            fontFamily: fontStack,\n            display: \"inline-block\",\n            transformOrigin: \"50% 50%\",\n            opacity: toOpacity,\n            transform: `translateY(${toY}px) scale(${toScale})`,\n            filter: `blur(${blurVal}px)`,\n          }}\n        >\n          {toText}\n        </span>\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/remocn/fade-through.tsx"
    }
  ],
  "type": "registry:component"
}
