{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "transition-curtain-call",
  "type": "registry:component",
  "title": "Transition Curtain Call",
  "description": "Pleated stage drapes swing shut from both wings with a lagging hem, a valance drops and a warm spot hits the closed curtain. The scene changes behind it and the drapes part again.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "transitions",
    "curtain",
    "theatre",
    "stage",
    "drapes",
    "transition"
  ],
  "docs": "https://hyperblur.dev/effects/transition-curtain-call",
  "files": [
    {
      "path": "registry/hyperblur/transition-curtain-call.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/transition-curtain-call.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface TransitionCurtainCallProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"children\" | \"color\"> {\n  children?: React.ReactNode;\n  from?: React.ReactNode;\n  to?: React.ReactNode;\n  active?: boolean;\n  defaultActive?: boolean;\n  onActiveChange?: (active: boolean) => void;\n  autoPlay?: boolean;\n  interval?: number;\n  duration?: number;\n  color?: string;\n  trim?: string;\n  spotlight?: boolean;\n}\n\nconst css = `\n.hb-vj5 {\n  position: relative;\n  display: grid;\n  grid-template: minmax(0, 1fr) / minmax(0, 1fr);\n  overflow: hidden;\n  isolation: isolate;\n  box-sizing: border-box;\n  font-family: inherit;\n  background: #050506;\n}\n.hb-vj5 *, .hb-vj5 *::before, .hb-vj5 *::after { box-sizing: border-box; }\n.hb-vj5-l {\n  grid-area: 1 / 1;\n  display: grid;\n  min-width: 0;\n  min-height: 0;\n  visibility: hidden;\n  transition: visibility 0s linear calc(var(--hb-vj5-d) * 0.5);\n}\n.hb-vj5-l[data-on=\"true\"] { visibility: visible; }\n.hb-vj5-stage {\n  position: absolute;\n  inset: 0;\n  z-index: 3;\n  pointer-events: none;\n}\n.hb-vj5-p {\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  width: 51%;\n  transform: scaleX(0);\n  background:\n    linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.55)),\n    repeating-linear-gradient(\n      90deg,\n      color-mix(in srgb, var(--hb-vj5-c) 55%, #000000) 0px,\n      var(--hb-vj5-c) 9px,\n      color-mix(in srgb, var(--hb-vj5-c) 78%, #ffffff) 15px,\n      var(--hb-vj5-c) 21px,\n      color-mix(in srgb, var(--hb-vj5-c) 48%, #000000) 30px\n    );\n  box-shadow: inset 0 -5px 0 var(--hb-vj5-trim), inset 0 -7px 0 rgba(0, 0, 0, 0.5);\n}\n.hb-vj5-p[data-side=\"l\"] { left: 0; transform-origin: 0 0; }\n.hb-vj5-p[data-side=\"r\"] { right: 0; transform-origin: 100% 0; }\n.hb-vj5-p::after {\n  content: \"\";\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  width: 18px;\n  background: linear-gradient(90deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));\n}\n.hb-vj5-p[data-side=\"l\"]::after { right: 0; transform: scaleX(-1); }\n.hb-vj5-p[data-side=\"r\"]::after { left: 0; }\n.hb-vj5-val {\n  position: absolute;\n  left: 0;\n  right: 0;\n  top: 0;\n  height: 15%;\n  min-height: 16px;\n  transform: translateY(-110%);\n  background:\n    linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0) 60%),\n    repeating-linear-gradient(90deg, color-mix(in srgb, var(--hb-vj5-c) 70%, #000000) 0 2px, var(--hb-vj5-c) 2px 16px, color-mix(in srgb, var(--hb-vj5-c) 85%, #ffffff) 16px 20px, var(--hb-vj5-c) 20px 34px);\n  border-bottom: 2px solid var(--hb-vj5-trim);\n  -webkit-mask: linear-gradient(#000, #000) top / 100% calc(100% - 7px) no-repeat, radial-gradient(circle 9px at 50% 0, #000 96%, transparent 100%) bottom / 18px 7px repeat-x;\n  mask: linear-gradient(#000, #000) top / 100% calc(100% - 7px) no-repeat, radial-gradient(circle 9px at 50% 0, #000 96%, transparent 100%) bottom / 18px 7px repeat-x;\n}\n.hb-vj5-spot {\n  position: absolute;\n  inset: 0;\n  opacity: 0;\n  background: radial-gradient(ellipse 34% 58% at 50% 62%, rgba(255, 236, 200, 0.42), rgba(255, 236, 200, 0.08) 55%, transparent 72%);\n  mix-blend-mode: screen;\n}\n.hb-vj5[data-ran=\"true\"][data-active=\"true\"] .hb-vj5-p[data-side=\"l\"] { animation: hb-vj5-l-a var(--hb-vj5-d) linear both; }\n.hb-vj5[data-ran=\"true\"][data-active=\"false\"] .hb-vj5-p[data-side=\"l\"] { animation: hb-vj5-l-b var(--hb-vj5-d) linear both; }\n.hb-vj5[data-ran=\"true\"][data-active=\"true\"] .hb-vj5-p[data-side=\"r\"] { animation: hb-vj5-r-a var(--hb-vj5-d) linear both; }\n.hb-vj5[data-ran=\"true\"][data-active=\"false\"] .hb-vj5-p[data-side=\"r\"] { animation: hb-vj5-r-b var(--hb-vj5-d) linear both; }\n.hb-vj5[data-ran=\"true\"][data-active=\"true\"] .hb-vj5-val { animation: hb-vj5-v-a var(--hb-vj5-d) linear both; }\n.hb-vj5[data-ran=\"true\"][data-active=\"false\"] .hb-vj5-val { animation: hb-vj5-v-b var(--hb-vj5-d) linear both; }\n.hb-vj5[data-ran=\"true\"][data-active=\"true\"] .hb-vj5-spot { animation: hb-vj5-s-a var(--hb-vj5-d) linear both; }\n.hb-vj5[data-ran=\"true\"][data-active=\"false\"] .hb-vj5-spot { animation: hb-vj5-s-b var(--hb-vj5-d) linear both; }\n@keyframes hb-vj5-l-a {\n  0% { transform: scaleX(0) skewX(0deg); animation-timing-function: cubic-bezier(0.55, 0, 0.3, 1); }\n  30% { transform: scaleX(0.82) skewX(-4deg); animation-timing-function: cubic-bezier(0.3, 0, 0.3, 1); }\n  42% { transform: scaleX(1.02) skewX(1.5deg); animation-timing-function: ease-out; }\n  48% { transform: scaleX(1) skewX(0deg); }\n  58% { transform: scaleX(1) skewX(0deg); animation-timing-function: cubic-bezier(0.6, 0, 0.4, 1); }\n  84% { transform: scaleX(0.12) skewX(5deg); animation-timing-function: ease-out; }\n  100% { transform: scaleX(0) skewX(0deg); }\n}\n@keyframes hb-vj5-l-b {\n  0% { transform: scaleX(0) skewX(0deg); animation-timing-function: cubic-bezier(0.55, 0, 0.3, 1); }\n  30% { transform: scaleX(0.82) skewX(-4deg); animation-timing-function: cubic-bezier(0.3, 0, 0.3, 1); }\n  42% { transform: scaleX(1.02) skewX(1.5deg); animation-timing-function: ease-out; }\n  48% { transform: scaleX(1) skewX(0deg); }\n  58% { transform: scaleX(1) skewX(0deg); animation-timing-function: cubic-bezier(0.6, 0, 0.4, 1); }\n  84% { transform: scaleX(0.12) skewX(5deg); animation-timing-function: ease-out; }\n  100% { transform: scaleX(0) skewX(0deg); }\n}\n@keyframes hb-vj5-r-a {\n  0% { transform: scaleX(0) skewX(0deg); animation-timing-function: cubic-bezier(0.55, 0, 0.3, 1); }\n  30% { transform: scaleX(0.82) skewX(4deg); animation-timing-function: cubic-bezier(0.3, 0, 0.3, 1); }\n  42% { transform: scaleX(1.02) skewX(-1.5deg); animation-timing-function: ease-out; }\n  48% { transform: scaleX(1) skewX(0deg); }\n  58% { transform: scaleX(1) skewX(0deg); animation-timing-function: cubic-bezier(0.6, 0, 0.4, 1); }\n  84% { transform: scaleX(0.12) skewX(-5deg); animation-timing-function: ease-out; }\n  100% { transform: scaleX(0) skewX(0deg); }\n}\n@keyframes hb-vj5-r-b {\n  0% { transform: scaleX(0) skewX(0deg); animation-timing-function: cubic-bezier(0.55, 0, 0.3, 1); }\n  30% { transform: scaleX(0.82) skewX(4deg); animation-timing-function: cubic-bezier(0.3, 0, 0.3, 1); }\n  42% { transform: scaleX(1.02) skewX(-1.5deg); animation-timing-function: ease-out; }\n  48% { transform: scaleX(1) skewX(0deg); }\n  58% { transform: scaleX(1) skewX(0deg); animation-timing-function: cubic-bezier(0.6, 0, 0.4, 1); }\n  84% { transform: scaleX(0.12) skewX(-5deg); animation-timing-function: ease-out; }\n  100% { transform: scaleX(0) skewX(0deg); }\n}\n@keyframes hb-vj5-v-a {\n  0% { transform: translateY(-110%); animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }\n  26% { transform: translateY(0); }\n  70% { transform: translateY(0); animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.4); }\n  100% { transform: translateY(-110%); }\n}\n@keyframes hb-vj5-v-b {\n  0% { transform: translateY(-110%); animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }\n  26% { transform: translateY(0); }\n  70% { transform: translateY(0); animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.4); }\n  100% { transform: translateY(-110%); }\n}\n@keyframes hb-vj5-s-a {\n  0%, 40% { opacity: 0; }\n  50% { opacity: 1; }\n  58% { opacity: 0.85; }\n  66%, 100% { opacity: 0; }\n}\n@keyframes hb-vj5-s-b {\n  0%, 40% { opacity: 0; }\n  50% { opacity: 1; }\n  58% { opacity: 0.85; }\n  66%, 100% { opacity: 0; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-vj5-l { transition: none; }\n  .hb-vj5[data-ran=\"true\"] .hb-vj5-p,\n  .hb-vj5[data-ran=\"true\"] .hb-vj5-val,\n  .hb-vj5[data-ran=\"true\"] .hb-vj5-spot { animation: none !important; }\n}\n`;\n\nfunction useSwap(\n  active: boolean | undefined,\n  defaultActive: boolean,\n  onActiveChange: ((active: boolean) => void) | undefined,\n  autoPlay: boolean,\n  interval: number,\n) {\n  const [inner, setInner] = React.useState(defaultActive);\n  const controlled = active !== undefined;\n  const value = controlled ? active : inner;\n  const set = React.useCallback(\n    (next: boolean) => {\n      if (!controlled) setInner(next);\n      onActiveChange?.(next);\n    },\n    [controlled, onActiveChange],\n  );\n  React.useEffect(() => {\n    if (!autoPlay) return;\n    if (window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) return;\n    const id = window.setTimeout(() => set(!value), interval);\n    return () => window.clearTimeout(id);\n  }, [autoPlay, interval, value, set]);\n  return value;\n}\n\nfunction Scene({ tone, kicker, title }: { tone: string; kicker: string; title: string }) {\n  return (\n    <div style={{ display: \"grid\", alignContent: \"end\", gap: 4, padding: 20, minHeight: 180, background: tone, color: \"#ededed\" }}>\n      <span style={{ fontSize: 11, letterSpacing: \"0.14em\", textTransform: \"uppercase\", color: \"rgba(237,237,237,0.6)\" }}>{kicker}</span>\n      <strong style={{ fontSize: 20, fontWeight: 600, letterSpacing: \"-0.01em\" }}>{title}</strong>\n    </div>\n  );\n}\n\nexport function TransitionCurtainCall({\n  children,\n  from,\n  to,\n  active,\n  defaultActive = false,\n  onActiveChange,\n  autoPlay = false,\n  interval = 3600,\n  duration = 2000,\n  color = \"#5a1220\",\n  trim = \"#c9a45c\",\n  spotlight = true,\n  className,\n  style,\n  ...rest\n}: TransitionCurtainCallProps) {\n  const value = useSwap(active, defaultActive, onActiveChange, autoPlay, interval);\n  const [prev, setPrev] = React.useState(value);\n  const [ran, setRan] = React.useState(false);\n  if (prev !== value) {\n    setPrev(value);\n    setRan(true);\n  }\n  const kids = React.Children.toArray(children);\n  const a = from ?? kids[0] ?? <Scene tone=\"radial-gradient(circle at 50% 30%, #3b2a1a, #0c0906 70%)\" kicker=\"Act one\" title=\"The letter arrives\" />;\n  const b = to ?? kids[1] ?? <Scene tone=\"radial-gradient(circle at 50% 30%, #1a2b3b, #06090c 70%)\" kicker=\"Act two\" title=\"A storm at sea\" />;\n\n  const vars = {\n    \"--hb-vj5-d\": `${duration}ms`,\n    \"--hb-vj5-c\": color,\n    \"--hb-vj5-trim\": trim,\n  } as React.CSSProperties;\n\n  return (\n    <div className={[\"hb-vj5\", className].filter(Boolean).join(\" \")} style={{ ...vars, ...style }} data-active={value} data-ran={ran} {...rest}>\n      <style href=\"hb-transition-curtain-call\" precedence=\"default\">{css}</style>\n      <div className=\"hb-vj5-l\" data-on={!value} aria-hidden={value} inert={value}>{a}</div>\n      <div className=\"hb-vj5-l\" data-on={value} aria-hidden={!value} inert={!value}>{b}</div>\n      <div className=\"hb-vj5-stage\" aria-hidden=\"true\">\n        <div className=\"hb-vj5-p\" data-side=\"l\" />\n        <div className=\"hb-vj5-p\" data-side=\"r\" />\n        {spotlight ? <div className=\"hb-vj5-spot\" /> : null}\n        <div className=\"hb-vj5-val\" />\n      </div>\n    </div>\n  );\n}\n"
    }
  ]
}