{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "heat-trace",
  "title": "Heat Trace",
  "description": "The remocn wordmark is traced in a warm-to-cool gradient heat line, with a tagline beneath.",
  "dependencies": ["remotion", "@remotion/google-fonts"],
  "files": [
    {
      "path": "registry/remocn/heat-trace/index.tsx",
      "content": "\"use client\";\n\nimport { loadFont as loadGeist } from \"@remotion/google-fonts/Geist\";\nimport { loadFont as loadManrope } from \"@remotion/google-fonts/Manrope\";\nimport type React from \"react\";\nimport { Fragment, useId } from \"react\";\nimport {\n  AbsoluteFill,\n  Easing,\n  interpolate,\n  useCurrentFrame,\n  useVideoConfig,\n} from \"remotion\";\n\nconst manrope = loadManrope(\"normal\", {\n  weights: [\"500\", \"600\"],\n  subsets: [\"latin\"],\n});\nconst geist = loadGeist(\"normal\", {\n  weights: [\"400\", \"500\"],\n  subsets: [\"latin\"],\n});\n\nexport interface HeatTraceProps {\n  name?: string;\n  logo?: React.ReactNode;\n  tagline?: string;\n  eyebrow?: string;\n  accent?: string;\n  background?: string;\n  speed?: number;\n  theme?: \"dark\" | \"light\";\n}\n\nconst THEMES = {\n  dark: {\n    bg: \"#0A0A0B\",\n    muted: \"#8E8D94\",\n    eyebrow: \"#B4B3B9\",\n    ramp: (accent: string) => [\n      \"#16171D\",\n      \"#1a1f63\",\n      accent,\n      \"#e2457a\",\n      \"#ffb36b\",\n      \"#fff4ec\",\n    ],\n    bloom: 0.13,\n    grain: 0.05,\n  },\n  light: {\n    bg: \"#F5F4F0\",\n    muted: \"#6E6C67\",\n    eyebrow: \"#4A4945\",\n    ramp: (accent: string) => [\n      \"#E5E2DA\",\n      \"#A8B4F2\",\n      accent,\n      \"#d93d73\",\n      \"#f06a24\",\n      \"#b8400f\",\n    ],\n    bloom: 0,\n    grain: 0.035,\n  },\n} as const;\n\nconst EASE_OUT = Easing.bezier(0.22, 1, 0.36, 1);\nconst EASE_PASS = Easing.bezier(0.42, 0, 0.3, 1);\nconst CLAMP = {\n  extrapolateLeft: \"clamp\",\n  extrapolateRight: \"clamp\",\n} as const;\n\nconst REMOCN_R_PATH =\n  \"M 0.01 0.81 C 0.01 1.73, 0.36 2.79, 1.09 4.13 C 4.91 11.04, 13.45 17.16, 21.7 18.9 C 22.94 19.16, 23.18 19.16, 51.39 19.27 C 76.07 19.36, 80.02 19.4, 81.32 19.57 C 89.89 20.69, 96.2 24.68, 99.38 31.01 C 103.19 38.56, 102.53 50.1, 97.91 57.07 C 94.66 61.96, 89.68 64.99, 83.26 66 C 82.81 66.07, 70.18 66.83, 55.2 67.69 C 24.82 69.43, 27.03 69.23, 24.18 70.4 C 19.9 72.15, 14.84 75.7, 10.65 79.89 C 4.86 85.68, 1.3 91.91, 0.25 98.13 C 0.12 98.85, 0.08 103.13, 0.04 116.66 L 0 134.26 9.5 134.26 L 19 134.26 19.05 119.41 C 19.1 103.27, 19.08 103.82, 19.82 101.04 C 21.79 93.65, 27.86 88.75, 36.45 87.63 C 37.23 87.53, 39.41 87.5, 43.57 87.53 C 50.12 87.59, 50.75 87.65, 53.22 88.45 C 56.61 89.56, 59.67 91.86, 62.02 95.07 C 62.52 95.76, 69.35 103.85, 77.2 113.07 C 85.04 122.28, 91.63 130.04, 91.85 130.32 C 92.07 130.59, 92.5 131.34, 92.82 131.97 C 93.52 133.35, 94.11 133.93, 95.06 134.13 C 95.5 134.23, 98.97 134.26, 106.36 134.23 L 117.01 134.19 100.82 113.07 C 91.91 101.45, 84.52 91.78, 84.39 91.57 C 83.36 89.89, 83.66 87.53, 85.09 86 C 85.79 85.25, 86.36 84.94, 88.07 84.38 C 96.18 81.72, 104.15 76.62, 109.97 70.36 C 120.59 58.93, 124.06 44.32, 119.44 30.43 C 114.59 15.81, 101.93 4.02, 87.64 0.83 C 83.93 0.01, 88.09 0.08, 41.85 0.04 L 0.01 0 0.01 0.81 Z\";\n\nconst R_RATIO = 124.06 / 134.26;\nconst R_H = 0.76;\nconst R_W = R_H * R_RATIO;\nconst R_GAP = 0.04;\n\nconst MANROPE_500 = [\n  200, 329, 417, 924, 602, 901, 657, 229, 435, 435, 446, 575, 278, 420, 270,\n  402, 626, 406, 578, 562, 596, 580, 621, 512, 591, 621, 314, 318, 622, 750,\n  622, 534, 907, 646, 619, 723, 681, 575, 510, 714, 697, 249, 476, 612, 518,\n  846, 696, 732, 616, 732, 640, 630, 600, 708, 616, 949, 622, 574, 630, 412,\n  402, 412, 673, 660, 506, 562, 600, 561, 600, 590, 362, 600, 604, 249, 263,\n  510, 249, 865, 604, 600, 600, 600, 374, 530, 412, 604, 523, 779, 536, 538,\n  531, 430, 269, 430, 680,\n];\nconst MANROPE_600_EMOCN = (596 + 882 + 610 + 568 + 615) / 1000;\nconst GEIST_500 = [\n  243, 230, 349, 513, 632, 853, 668, 174, 329, 329, 420, 563, 186, 432, 186,\n  457, 677, 374, 614, 600, 629, 629, 610, 507, 629, 613, 227, 227, 547, 544,\n  547, 517, 901, 678, 681, 704, 701, 610, 596, 692, 705, 281, 592, 652, 584,\n  883, 738, 739, 653, 739, 673, 642, 558, 696, 688, 956, 633, 586, 557, 342,\n  439, 342, 438, 532, 257, 556, 591, 549, 591, 566, 413, 591, 581, 256, 274,\n  565, 283, 852, 581, 562, 592, 591, 394, 535, 414, 587, 548, 806, 559, 540,\n  499, 405, 274, 406, 522,\n];\n\nfunction textEm(text: string, table: number[]) {\n  let w = 0;\n  for (const ch of text) {\n    const c = ch.charCodeAt(0);\n    w += c >= 32 && c <= 126 ? table[c - 32] : 600;\n  }\n  return w / 1000;\n}\n\nfunction hexToRgb(hex: string) {\n  const h = hex.replace(\"#\", \"\");\n  const full =\n    h.length === 3\n      ? h\n          .split(\"\")\n          .map((c) => c + c)\n          .join(\"\")\n      : h.slice(0, 6);\n  const n = Number.parseInt(full, 16);\n  return [(n >> 16) & 255, (n >> 8) & 255, n & 255].map((v) => v / 255);\n}\n\nfunction rampTables(ramp: readonly string[]) {\n  const rgb = ramp.map(hexToRgb);\n  return [0, 1, 2].map((ch) => rgb.map((c) => c[ch].toFixed(4)).join(\" \")) as [\n    string,\n    string,\n    string,\n  ];\n}\n\nfunction Grain({ opacity }: { opacity: number }) {\n  const id = `g${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n  return (\n    <svg\n      width=\"100%\"\n      height=\"100%\"\n      style={{ position: \"absolute\", inset: 0, opacity, pointerEvents: \"none\" }}\n      aria-hidden\n    >\n      <filter id={id}>\n        <feTurbulence\n          type=\"fractalNoise\"\n          baseFrequency=\"0.9\"\n          numOctaves={2}\n          seed={11}\n          stitchTiles=\"stitch\"\n        />\n        <feColorMatrix values=\"0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0.9 0\" />\n      </filter>\n      <rect width=\"100%\" height=\"100%\" filter={`url(#${id})`} />\n    </svg>\n  );\n}\n\nexport function HeatTrace({\n  name = \"remocn\",\n  logo,\n  tagline = \"Launch-video scenes for Remotion. Copy, paste, render.\",\n  eyebrow = \"\",\n  accent = \"#3B5BFD\",\n  background,\n  speed = 1,\n  theme = \"dark\",\n}: HeatTraceProps) {\n  const frame = useCurrentFrame() * speed;\n  const { width, height } = useVideoConfig();\n  const t = THEMES[theme];\n  const uid = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n  const ids = {\n    mask: `hm${uid}`,\n    heat: `hf${uid}`,\n    bloom: `hb${uid}`,\n    blob: `hg${uid}`,\n    field: `hl${uid}`,\n  };\n\n  const portrait = height > width * 1.1;\n  const s = portrait\n    ? (width / 1280) * 1.5\n    : Math.min(width / 1280, height / 720);\n\n  const wordmark = logo === undefined && name.trim().toLowerCase() === \"remocn\";\n\n  const LS = -0.035;\n  const chars = wordmark ? 5 : [...name].length;\n  const markEm = wordmark ? R_W + R_GAP : logo ? 0.84 + 0.18 : 0;\n  const textBase = wordmark ? MANROPE_600_EMOCN : textEm(name, MANROPE_500);\n  const nameEm = markEm + textBase + chars * LS;\n  const maxW = width * (portrait ? 0.86 : 0.8);\n  const fs = Math.min((portrait ? 168 : 210) * s, maxW / nameEm);\n  const nameW = nameEm * fs;\n\n  const eyeFs = 22 * s;\n  const tagFs = (portrait ? 34 : 30) * s;\n  const tagMax = Math.min(width * 0.8, 980 * s);\n  const tagLines = tagline\n    ? Math.max(1, Math.ceil((textEm(tagline, GEIST_500) * tagFs) / tagMax))\n    : 0;\n  const tagH = tagLines * tagFs * 1.3;\n  const inkH = fs * 0.78;\n  const eyeGap = eyebrow ? eyeFs + fs * 0.24 : 0;\n  const tagGap = tagline ? fs * 0.3 + tagH : 0;\n  const groupH = eyeGap + inkH + tagGap;\n  const top = height / 2 - groupH / 2 - (tagline ? 0 : fs * 0.04);\n  const inkTop = top + eyeGap;\n  const baseline = inkTop + inkH - fs * 0.02;\n  const x0 = width / 2 - nameW / 2;\n  const x1 = x0 + nameW;\n  const tagTop = inkTop + inkH + fs * 0.3;\n\n  const PASS_END = 56;\n  const headAt = (f: number) => {\n    const u = interpolate(f, [0, PASS_END], [0, 1], {\n      ...CLAMP,\n      easing: EASE_PASS,\n    });\n    const x = interpolate(u, [0, 1], [x0 + fs * 0.12, x1 + fs * 0.35]);\n    const y =\n      baseline - fs * 0.38 + fs * 0.2 * Math.sin(u * Math.PI * 2.4 + 0.5);\n    return { x, y };\n  };\n  const trailPts: string[] = [];\n  const trailEnd = Math.min(frame, PASS_END);\n  for (let f = 0; f <= trailEnd + 0.001; f += 1) {\n    const p = headAt(Math.min(f, trailEnd));\n    trailPts.push(`${p.x.toFixed(1)},${p.y.toFixed(1)}`);\n  }\n  if (trailPts.length === 1) trailPts.push(trailPts[0]);\n\n  const blobs = Array.from({ length: 9 }, (_, k) => {\n    const age = k * 2.2;\n    const f = frame - age;\n    if (f < -1) return null;\n    const p = headAt(Math.max(0, f));\n    const leaving = interpolate(frame, [PASS_END - 6, PASS_END + 14], [1, 0], {\n      ...CLAMP,\n      easing: EASE_OUT,\n    });\n    return {\n      key: `b${k}`,\n      cx: p.x,\n      cy: p.y,\n      r: fs * (0.46 + age * 0.018),\n      o: Math.exp(-age / 7) * 0.95 * leaving,\n    };\n  }).filter((b): b is NonNullable<typeof b> => b !== null);\n\n  const settle = interpolate(frame, [46, 90], [0, 1], {\n    ...CLAMP,\n    easing: EASE_OUT,\n  });\n  const trailO = interpolate(\n    frame,\n    [0, 6, PASS_END, 92],\n    [0.4, 0.48, 0.5, 0.12],\n    CLAMP,\n  );\n  const cores = [\n    { fx: 0.08, dy: 0.62, r: 0.78, a: 0.86 },\n    { fx: 0.54, dy: 0.56, r: 0.66, a: 0.66 },\n    { fx: 0.92, dy: 0.22, r: 0.62, a: 0.58 },\n  ].map((c, i) => ({\n    key: `c${i}`,\n    cx: x0 + nameW * c.fx + Math.sin(frame * 0.035 + i * 2.1) * fs * 0.1,\n    cy: baseline - fs * c.dy + Math.cos(frame * 0.03 + i * 1.3) * fs * 0.05,\n    r: fs * c.r * interpolate(settle, [0, 1], [0.7, 1]),\n    o: c.a * settle,\n  }));\n\n  const [tr, tg, tb] = rampTables(t.ramp(accent));\n  const pad = fs * 0.7;\n  const region = {\n    x: x0 - pad,\n    y: baseline - fs * 1.2,\n    w: nameW + pad * 2,\n    h: fs * 1.6,\n  };\n  const blur = fs * 0.11;\n\n  const transparent = background === \"transparent\";\n  const showStage = !transparent && background === undefined;\n\n  const bloomO = interpolate(frame, [0, 10, 60, 96], [0.6, 1, 1, 0.35], CLAMP);\n\n  const heatContent = (withGround: boolean) => (\n    <>\n      {withGround ? (\n        <rect\n          x={region.x}\n          y={region.y}\n          width={region.w}\n          height={region.h}\n          fill=\"#000\"\n        />\n      ) : null}\n      {withGround ? (\n        <rect\n          x={region.x}\n          y={region.y}\n          width={region.w}\n          height={region.h}\n          fill={`url(#${ids.field})`}\n          opacity={settle}\n        />\n      ) : null}\n      <polyline\n        points={trailPts.join(\" \")}\n        fill=\"none\"\n        stroke=\"#fff\"\n        strokeOpacity={trailO}\n        strokeWidth={fs * 0.95}\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n      />\n      {[...blobs, ...cores].map((b) => (\n        <circle\n          key={b.key}\n          cx={b.cx}\n          cy={b.cy}\n          r={b.r}\n          fill={`url(#${ids.blob})`}\n          opacity={b.o}\n        />\n      ))}\n    </>\n  );\n\n  const words = tagline.split(/\\s+/).filter(Boolean);\n  const markX = x0;\n  const textX = x0 + markEm * fs;\n  const logoLit = interpolate(\n    headAt(frame).x,\n    [markX, markX + fs * 0.9],\n    [0.18, 1],\n    CLAMP,\n  );\n\n  return (\n    <AbsoluteFill\n      style={{\n        background: transparent ? \"transparent\" : (background ?? t.bg),\n        overflow: \"hidden\",\n      }}\n    >\n      <svg\n        width={width}\n        height={height}\n        viewBox={`0 0 ${width} ${height}`}\n        style={{ position: \"absolute\", inset: 0 }}\n        aria-hidden\n      >\n        <defs>\n          <radialGradient id={ids.blob}>\n            <stop offset=\"0\" stopColor=\"#fff\" stopOpacity={1} />\n            <stop offset=\"0.3\" stopColor=\"#fff\" stopOpacity={0.8} />\n            <stop offset=\"1\" stopColor=\"#fff\" stopOpacity={0} />\n          </radialGradient>\n          <linearGradient\n            id={ids.field}\n            gradientUnits=\"userSpaceOnUse\"\n            x1=\"0\"\n            x2=\"0\"\n            y1={baseline - fs * 0.8}\n            y2={baseline}\n          >\n            <stop offset=\"0\" stopColor=\"#fff\" stopOpacity={0.44} />\n            <stop offset=\"1\" stopColor=\"#fff\" stopOpacity={0.3} />\n          </linearGradient>\n          <filter\n            id={ids.heat}\n            filterUnits=\"userSpaceOnUse\"\n            x={region.x}\n            y={region.y}\n            width={region.w}\n            height={region.h}\n            colorInterpolationFilters=\"sRGB\"\n          >\n            <feGaussianBlur stdDeviation={blur} />\n            <feComponentTransfer>\n              <feFuncR type=\"table\" tableValues={tr} />\n              <feFuncG type=\"table\" tableValues={tg} />\n              <feFuncB type=\"table\" tableValues={tb} />\n            </feComponentTransfer>\n          </filter>\n          <filter\n            id={ids.bloom}\n            filterUnits=\"userSpaceOnUse\"\n            x={0}\n            y={0}\n            width={width}\n            height={height}\n            colorInterpolationFilters=\"sRGB\"\n          >\n            <feGaussianBlur stdDeviation={fs * 0.42} />\n            <feComponentTransfer>\n              <feFuncR type=\"table\" tableValues={tr} />\n              <feFuncG type=\"table\" tableValues={tg} />\n              <feFuncB type=\"table\" tableValues={tb} />\n            </feComponentTransfer>\n          </filter>\n          <mask id={ids.mask} maskUnits=\"userSpaceOnUse\">\n            {wordmark ? (\n              <path\n                d={REMOCN_R_PATH}\n                fill=\"#fff\"\n                transform={`translate(${markX} ${baseline - R_H * fs}) scale(${(R_H * fs) / 134.26})`}\n              />\n            ) : null}\n            <text\n              x={textX}\n              y={baseline}\n              fill=\"#fff\"\n              fontFamily={manrope.fontFamily}\n              fontWeight={wordmark ? 600 : 500}\n              fontSize={fs}\n              letterSpacing={LS * fs}\n            >\n              {wordmark ? \"emocn\" : name}\n            </text>\n          </mask>\n        </defs>\n\n        {showStage ? (\n          <g filter={`url(#${ids.bloom})`} opacity={t.bloom * bloomO}>\n            {heatContent(false)}\n          </g>\n        ) : null}\n\n        <g mask={`url(#${ids.mask})`}>\n          <g filter={`url(#${ids.heat})`}>{heatContent(true)}</g>\n        </g>\n      </svg>\n\n      {logo && !wordmark ? (\n        <div\n          style={{\n            position: \"absolute\",\n            left: markX,\n            top: baseline - fs * 0.8,\n            width: fs * 0.84,\n            height: fs * 0.84,\n            display: \"flex\",\n            alignItems: \"center\",\n            justifyContent: \"center\",\n            opacity: logoLit,\n            filter: `blur(${(1 - logoLit) * 6 * s}px)`,\n          }}\n        >\n          {logo}\n        </div>\n      ) : null}\n\n      {eyebrow ? (\n        <div\n          style={{\n            position: \"absolute\",\n            left: 0,\n            right: 0,\n            top,\n            textAlign: \"center\",\n            fontFamily: geist.fontFamily,\n            fontWeight: 500,\n            fontSize: eyeFs,\n            lineHeight: 1,\n            letterSpacing: \"0.02em\",\n            color: t.eyebrow,\n            opacity: interpolate(frame, [4, 20], [0, 1], CLAMP),\n          }}\n        >\n          {eyebrow}\n        </div>\n      ) : null}\n\n      {tagline ? (\n        <div\n          style={{\n            position: \"absolute\",\n            left: (width - tagMax) / 2,\n            width: tagMax,\n            top: tagTop,\n            textAlign: \"center\",\n            textWrap: \"balance\",\n            fontFamily: geist.fontFamily,\n            fontWeight: 400,\n            fontSize: tagFs,\n            lineHeight: 1.3,\n            letterSpacing: \"-0.012em\",\n            color: t.muted,\n          }}\n        >\n          {words.map((w, i) => {\n            const k = interpolate(frame, [58 + i * 2, 76 + i * 2], [0, 1], {\n              ...CLAMP,\n              easing: EASE_OUT,\n            });\n            return (\n              <Fragment key={i}>\n                {i > 0 ? \" \" : null}\n                <span\n                  style={{\n                    display: \"inline-block\",\n                    opacity: k,\n                    transform: `translateY(${(1 - k) * 0.45}em)`,\n                    filter: `blur(${(1 - k) * 6 * s}px)`,\n                  }}\n                >\n                  {w}\n                </span>\n              </Fragment>\n            );\n          })}\n        </div>\n      ) : null}\n\n      {showStage ? <Grain opacity={t.grain} /> : null}\n    </AbsoluteFill>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/remocn/heat-trace.tsx"
    }
  ],
  "type": "registry:component"
}
