{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "not-yet",
  "title": "Not Yet",
  "description": "A stack of \"It can't ... Yet.\" lines, the last one brightest, each ending in an orange \"Yet.\".",
  "dependencies": ["remotion", "@remotion/google-fonts"],
  "files": [
    {
      "path": "registry/remocn/not-yet/index.tsx",
      "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/GolosText\";\nimport type React from \"react\";\nimport { useEffect, useLayoutEffect, useRef, useState } from \"react\";\nimport {\n  AbsoluteFill,\n  continueRender,\n  delayRender,\n  Easing,\n  interpolate,\n  useCurrentFrame,\n  useVideoConfig,\n} from \"remotion\";\n\nconst golos = loadFont(\"normal\", {\n  weights: [\"400\", \"500\"],\n  subsets: [\"latin\"],\n});\n\nexport interface NotYetProps {\n  lines?: string[];\n  word?: string;\n  accent?: string;\n  background?: string;\n  speed?: number;\n  theme?: \"dark\" | \"light\";\n}\n\nconst THEMES = {\n  dark: { bg: \"#1D2B53\", ink: \"#FFFFFF\", accent: \"#FFB38A\", rule: 0.22 },\n  light: { bg: \"#FFF4EC\", ink: \"#1D2B53\", accent: \"#D9623B\", rule: 0.2 },\n} as const;\n\nconst DEFAULT_LINES = [\n  \"It can’t write your script.\",\n  \"It can’t pick your music.\",\n  \"It can’t voice your launch.\",\n];\n\nconst WORD_GAP = 3;\nconst WORD_RISE = 12;\nconst YET_PAUSE = 9;\nconst YET_HOLD = 20;\nconst STEP_DUR = 16;\nconst OLD_SCALE = 0.58;\nconst OLD_INK = 0.4;\n\nconst EASE_OUT = Easing.bezier(0.22, 1, 0.36, 1);\nconst EASE_STEP = Easing.bezier(0.65, 0, 0.35, 1);\nconst CLAMP = {\n  extrapolateLeft: \"clamp\",\n  extrapolateRight: \"clamp\",\n} as const;\n\nfunction splitWords(s: string) {\n  return s.split(/\\s+/).filter(Boolean);\n}\n\nfunction schedule(lines: string[][]) {\n  const starts: number[] = [];\n  const yets: number[] = [];\n  let at = 0;\n  for (const words of lines) {\n    starts.push(at);\n    const set =\n      (at === 0 ? 0 : STEP_DUR - 6) +\n      2 +\n      (words.length - 1) * WORD_GAP +\n      WORD_RISE;\n    const yet = at + set + YET_PAUSE;\n    yets.push(yet);\n    at = yet + YET_HOLD;\n  }\n  const end = (yets[yets.length - 1] ?? 0) + 10;\n  return { starts, yets, end };\n}\n\nexport function NotYet({\n  lines = DEFAULT_LINES,\n  word = \"Yet.\",\n  accent,\n  background,\n  speed = 1,\n  theme = \"dark\",\n}: NotYetProps) {\n  const frame = useCurrentFrame();\n  const { width: W, height: H, durationInFrames } = useVideoConfig();\n  const c = THEMES[theme];\n  const hi = accent ?? c.accent;\n  const stage =\n    background === \"transparent\" ? \"transparent\" : (background ?? c.bg);\n\n  const wordLines = lines.map(splitWords);\n  const plan = schedule(wordLines);\n  const pace = Math.max(1, (plan.end + 30) / Math.max(1, durationInFrames));\n  const t = frame * speed * pace;\n\n  const portrait = H > W * 1.1;\n  const margin = W * (portrait ? 0.08 : 0.07);\n  const size = Math.min(H * 0.105, W * (portrait ? 0.125 : 0.063));\n  const baseline = H * (portrait ? 0.7 : 0.765);\n  const blockW = W - margin * 2;\n  const gap = size * 0.34;\n\n  const refs = useRef<(HTMLDivElement | null)[]>([]);\n  const [handle] = useState(() => delayRender(\"not-yet: measuring\"));\n  const released = useRef(false);\n  const [fontsOk, setFontsOk] = useState(false);\n  const [heights, setHeights] = useState<number[] | null>(null);\n\n  useEffect(() => {\n    let live = true;\n    Promise.all([\n      golos.waitUntilDone(),\n      document.fonts.load(`500 100px \"${golos.fontFamily}\"`),\n    ])\n      .catch(() => undefined)\n      .then(() => {\n        if (live) setFontsOk(true);\n      });\n    return () => {\n      live = false;\n    };\n  }, []);\n\n  useLayoutEffect(() => {\n    if (!fontsOk) return;\n    const next = wordLines.map((_, i) => refs.current[i]?.offsetHeight ?? 0);\n    setHeights((prev) =>\n      prev && prev.length === next.length && prev.every((v, i) => v === next[i])\n        ? prev\n        : next,\n    );\n  });\n\n  useEffect(() => {\n    if (heights && !released.current) {\n      released.current = true;\n      continueRender(handle);\n    }\n  }, [heights, handle]);\n\n  const stepIn = wordLines.map((_, i) =>\n    i === 0\n      ? 1\n      : interpolate(t, [plan.starts[i], plan.starts[i] + STEP_DUR], [0, 1], {\n          ...CLAMP,\n          easing: EASE_STEP,\n        }),\n  );\n  const ages = wordLines.map((_, i) => {\n    let a = 0;\n    for (let j = i + 1; j < wordLines.length; j++) a += stepIn[j];\n    return a;\n  });\n  const scaleOf = (a: number) => interpolate(a, [0, 1], [1, OLD_SCALE], CLAMP);\n\n  const ruleIn = interpolate(t, [0, 22], [0, 1], {\n    ...CLAMP,\n    easing: EASE_OUT,\n  });\n\n  const rise = (start: number, dur = WORD_RISE) =>\n    interpolate(t, [start, start + dur], [0, 1], {\n      ...CLAMP,\n      easing: EASE_OUT,\n    });\n\n  const text: React.CSSProperties = {\n    fontFamily: golos.fontFamily,\n    fontWeight: 500,\n    fontSize: size,\n    lineHeight: 1.08,\n    letterSpacing: \"-0.03em\",\n  };\n\n  return (\n    <AbsoluteFill style={{ background: stage, overflow: \"hidden\" }}>\n      <div\n        style={{\n          position: \"absolute\",\n          left: margin,\n          top: baseline + size * 0.2,\n          width: blockW,\n          height: Math.max(1, Math.round(H * 0.0018)),\n          background: c.ink,\n          opacity: c.rule,\n          transformOrigin: \"0 50%\",\n          transform: `scaleX(${ruleIn.toFixed(4)})`,\n        }}\n      />\n      {wordLines.map((words, i) => {\n        const a = ages[i];\n        const sc = scaleOf(a);\n        let lift = 0;\n        if (heights) {\n          for (let j = i + 1; j < wordLines.length; j++) {\n            lift += (heights[j] * scaleOf(ages[j]) + gap) * stepIn[j];\n          }\n        }\n        const inkAlpha = interpolate(a, [0, 1], [1, OLD_INK], CLAMP);\n        const gone = interpolate(a, [2.2, 3], [1, 0], CLAMP);\n        const s0 = plan.starts[i] + (i === 0 ? 0 : STEP_DUR - 6);\n        const yetT = interpolate(t, [plan.yets[i], plan.yets[i] + 8], [0, 1], {\n          ...CLAMP,\n          easing: EASE_OUT,\n        });\n        return (\n          <div\n            key={`${i}-${words.join(\" \")}`}\n            ref={(el) => {\n              refs.current[i] = el;\n            }}\n            style={{\n              ...text,\n              position: \"absolute\",\n              left: margin,\n              bottom: H - baseline + lift,\n              width: blockW,\n              transformOrigin: \"0 100%\",\n              transform: `scale(${sc.toFixed(4)})`,\n              opacity: heights ? gone : 0,\n              textWrap: \"balance\",\n            }}\n          >\n            {words.map((w, wi) => {\n              const p = rise(s0 + 2 + wi * WORD_GAP);\n              return (\n                <span\n                  key={`${wi}-${w}`}\n                  style={{\n                    display: \"inline-block\",\n                    marginRight: \"0.24em\",\n                    color: c.ink,\n                    opacity: p * inkAlpha,\n                    transform: `translateY(${((1 - p) * 0.3).toFixed(3)}em)`,\n                  }}\n                >\n                  {w}\n                </span>\n              );\n            })}\n            <span\n              style={{\n                display: \"inline-block\",\n                color: hi,\n                opacity: yetT,\n                transform: `translateX(${((1 - yetT) * 0.35).toFixed(3)}em)`,\n              }}\n            >\n              {word}\n            </span>\n          </div>\n        );\n      })}\n    </AbsoluteFill>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/remocn/not-yet.tsx"
    }
  ],
  "type": "registry:component"
}
