{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "cinema-trailer-slam",
  "type": "registry:component",
  "title": "Cinema Trailer Slam",
  "description": "Teaser-style words slam into frame one beat at a time with a camera shake, a white flash and an anamorphic flare, then resolve into the title and release date. It loops for showcases or plays once.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "cinematic",
    "cinematic",
    "trailer",
    "kinetic type",
    "shake",
    "flash",
    "teaser"
  ],
  "docs": "https://hyperblur.dev/effects/cinema-trailer-slam",
  "files": [
    {
      "path": "registry/hyperblur/cinema-trailer-slam.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/cinema-trailer-slam.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface CinemaTrailerSlamProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  words?: string[];\n  title?: string;\n  release?: string;\n  studio?: string;\n  beat?: number;\n  hold?: number;\n  loop?: boolean;\n  ctaLabel?: string;\n  ctaHref?: string;\n  accent?: string;\n  headingAs?: \"h1\" | \"h2\";\n  onComplete?: () => void;\n}\n\nconst css = `\n.hb-vc2 {\n  --hb-vc2-accent: #4aa8ff;\n  position: relative;\n  box-sizing: border-box;\n  display: grid;\n  place-items: center;\n  width: 100%;\n  min-height: 560px;\n  overflow: hidden;\n  isolation: isolate;\n  container-type: inline-size;\n  background: #030406;\n  color: #f2f4f7;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-vc2 *, .hb-vc2 *::before, .hb-vc2 *::after { box-sizing: border-box; }\n.hb-vc2-smoke {\n  position: absolute;\n  inset: -20%;\n  z-index: 0;\n  background:\n    radial-gradient(40% 30% at 30% 60%, rgba(60, 90, 140, .22), transparent 70%),\n    radial-gradient(35% 28% at 72% 40%, rgba(40, 60, 100, .2), transparent 70%),\n    radial-gradient(60% 50% at 50% 50%, rgba(20, 30, 50, .5), transparent 80%);\n  animation: hb-vc2-drift 18s ease-in-out infinite alternate;\n}\n@keyframes hb-vc2-drift {\n  from { transform: translate3d(-3%, 1%, 0) scale(1); }\n  to { transform: translate3d(3%, -2%, 0) scale(1.08); }\n}\n.hb-vc2-flare {\n  position: absolute;\n  left: -10%;\n  right: -10%;\n  top: 50%;\n  z-index: 1;\n  height: 2px;\n  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--hb-vc2-accent) 70%, #fff) 50%, transparent);\n  box-shadow: 0 0 18px 2px color-mix(in srgb, var(--hb-vc2-accent) 60%, transparent), 0 0 80px 10px color-mix(in srgb, var(--hb-vc2-accent) 18%, transparent);\n  opacity: 0;\n  transform: scaleX(.2);\n}\n.hb-vc2-stage[data-beat] .hb-vc2-flare { animation: hb-vc2-flare .9s cubic-bezier(.2, .7, .2, 1) both; }\n@keyframes hb-vc2-flare {\n  0% { opacity: 0; transform: scaleX(.2); }\n  15% { opacity: 1; transform: scaleX(1); }\n  100% { opacity: 0; transform: scaleX(1.3); }\n}\n.hb-vc2-stage {\n  position: absolute;\n  inset: 0;\n  z-index: 2;\n  display: grid;\n  place-items: center;\n}\n.hb-vc2-shake {\n  position: absolute;\n  inset: 0;\n  display: grid;\n  place-items: center;\n  animation: hb-vc2-shake .42s cubic-bezier(.36, .07, .19, .97) both;\n}\n@keyframes hb-vc2-shake {\n  0% { transform: translate3d(0, 0, 0); }\n  14% { transform: translate3d(-9px, 5px, 0) rotate(-.5deg); }\n  28% { transform: translate3d(8px, -6px, 0) rotate(.4deg); }\n  44% { transform: translate3d(-5px, 3px, 0); }\n  60% { transform: translate3d(3px, -2px, 0); }\n  80% { transform: translate3d(-1px, 1px, 0); }\n  100% { transform: none; }\n}\n.hb-vc2-word {\n  margin: 0;\n  padding: 0 24px;\n  color: #f2f4f7;\n  font-family: var(--font-grotesk, var(--font-sans, ui-sans-serif, system-ui, sans-serif));\n  font-size: clamp(40px, 10.5cqi, 140px);\n  font-weight: 700;\n  line-height: .9;\n  letter-spacing: -.02em;\n  text-align: center;\n  text-transform: uppercase;\n  background: linear-gradient(180deg, #ffffff 30%, #9aa6b8);\n  -webkit-background-clip: text;\n  background-clip: text;\n  -webkit-text-fill-color: transparent;\n  filter: drop-shadow(0 0 30px color-mix(in srgb, var(--hb-vc2-accent) 35%, transparent));\n  animation: hb-vc2-slam var(--hb-vc2-beat, 1200ms) cubic-bezier(.2, .9, .1, 1) both;\n}\n@keyframes hb-vc2-slam {\n  0% { opacity: 0; transform: scale(2.6); filter: blur(14px); }\n  10% { opacity: 1; transform: scale(.94); filter: blur(0); }\n  16% { transform: scale(1.02); }\n  22% { transform: scale(1); }\n  78% { opacity: 1; transform: scale(1.06); }\n  100% { opacity: 0; transform: scale(1.09); filter: blur(4px); }\n}\n.hb-vc2-flash {\n  position: absolute;\n  inset: 0;\n  z-index: 4;\n  pointer-events: none;\n  background: radial-gradient(60% 60% at 50% 50%, #ffffff, color-mix(in srgb, var(--hb-vc2-accent) 50%, #ffffff) 60%, transparent);\n  mix-blend-mode: screen;\n  animation: hb-vc2-flash .5s ease-out both;\n}\n@keyframes hb-vc2-flash {\n  0% { opacity: .95; }\n  100% { opacity: 0; }\n}\n.hb-vc2-final {\n  position: relative;\n  z-index: 3;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  padding: 0 24px;\n  text-align: center;\n}\n.hb-vc2-final[data-show=\"false\"] { visibility: hidden; }\n.hb-vc2-final[data-show=\"true\"] > * { animation: hb-vc2-in 1.2s cubic-bezier(.16, .8, .2, 1) both; }\n.hb-vc2-final[data-show=\"true\"] > *:nth-child(2) { animation-delay: .25s; }\n.hb-vc2-final[data-show=\"true\"] > *:nth-child(3) { animation-delay: .5s; }\n.hb-vc2-final[data-show=\"true\"] > *:nth-child(4) { animation-delay: .7s; }\n@keyframes hb-vc2-in {\n  from { opacity: 0; transform: scale(1.08); filter: blur(8px); }\n  to { opacity: 1; transform: none; filter: blur(0); }\n}\n.hb-vc2-studio {\n  margin: 0 0 16px;\n  color: rgba(242, 244, 247, .55);\n  font-size: 11px;\n  font-weight: 600;\n  letter-spacing: .42em;\n  text-transform: uppercase;\n}\n.hb-vc2-title {\n  margin: 0;\n  font-family: var(--font-grotesk, var(--font-sans, ui-sans-serif, system-ui, sans-serif));\n  font-size: clamp(44px, 12cqi, 160px);\n  font-weight: 700;\n  line-height: .85;\n  letter-spacing: -.04em;\n  text-transform: uppercase;\n  background: linear-gradient(180deg, #ffffff 20%, #7f8aa0 100%);\n  -webkit-background-clip: text;\n  background-clip: text;\n  -webkit-text-fill-color: transparent;\n}\n.hb-vc2-release {\n  display: flex;\n  align-items: center;\n  gap: 14px;\n  margin: 22px 0 0;\n  color: rgba(242, 244, 247, .8);\n  font-family: var(--font-mono, ui-monospace, monospace);\n  font-size: 12px;\n  letter-spacing: .24em;\n  text-transform: uppercase;\n}\n.hb-vc2-release::before, .hb-vc2-release::after {\n  content: \"\";\n  width: 36px;\n  height: 1px;\n  background: var(--hb-vc2-accent);\n}\n.hb-vc2-actions { display: flex; gap: 10px; margin-top: 28px; }\n.hb-vc2-btn {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  height: 42px;\n  padding: 0 18px;\n  border: 1px solid rgba(242, 244, 247, .18);\n  border-radius: 999px;\n  background: rgba(255, 255, 255, .04);\n  color: #f2f4f7;\n  font: inherit;\n  font-size: 13.5px;\n  font-weight: 550;\n  text-decoration: none;\n  cursor: pointer;\n  transition: background .25s ease, border-color .25s ease, transform .2s ease;\n}\n.hb-vc2-btn[data-primary] { border-color: transparent; background: #f2f4f7; color: #05070a; }\n.hb-vc2-btn:hover { border-color: rgba(242, 244, 247, .4); background: rgba(255, 255, 255, .1); }\n.hb-vc2-btn[data-primary]:hover { background: #fff; }\n.hb-vc2-btn:active { transform: scale(.97); }\n.hb-vc2-btn:focus-visible { outline: 2px solid var(--hb-vc2-accent); outline-offset: 3px; }\n.hb-vc2-pips {\n  position: absolute;\n  bottom: 22px;\n  left: 50%;\n  z-index: 5;\n  display: flex;\n  gap: 6px;\n  transform: translateX(-50%);\n}\n.hb-vc2-pip {\n  width: 22px;\n  height: 2px;\n  border-radius: 2px;\n  background: rgba(242, 244, 247, .16);\n  transition: background .3s ease, width .4s cubic-bezier(.2, .8, .2, 1);\n}\n.hb-vc2-pip[data-on=\"true\"] { width: 34px; background: var(--hb-vc2-accent); }\n.hb-vc2-rating {\n  position: absolute;\n  left: clamp(16px, 3cqi, 32px);\n  bottom: 18px;\n  z-index: 5;\n  padding: 5px 8px;\n  border: 1px solid rgba(242, 244, 247, .24);\n  color: rgba(242, 244, 247, .6);\n  font-family: var(--font-mono, ui-monospace, monospace);\n  font-size: 9.5px;\n  letter-spacing: .14em;\n  text-transform: uppercase;\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-vc2-smoke, .hb-vc2-shake, .hb-vc2-flare, .hb-vc2-final > * { animation: none !important; }\n  .hb-vc2-stage, .hb-vc2-flash { display: none; }\n  .hb-vc2-final[data-show=\"false\"] { visibility: visible; }\n}\n`;\n\nexport function CinemaTrailerSlam({\n  words = [\"This winter\", \"One signal\", \"Changes\", \"Everything\"],\n  title = \"Deep Relay\",\n  release = \"Only in theaters 11.27\",\n  studio = \"From the studio behind Coldwater\",\n  beat = 1150,\n  hold = 3600,\n  loop = true,\n  ctaLabel = \"Watch the trailer\",\n  ctaHref = \"#\",\n  accent = \"#4aa8ff\",\n  headingAs = \"h1\",\n  onComplete,\n  className,\n  style,\n  ...rest\n}: CinemaTrailerSlamProps) {\n  const Heading = headingAs;\n  const [step, setStep] = React.useState(0);\n  const [run, setRun] = React.useState(0);\n  const total = words.length;\n  const done = step >= total;\n  const completeRef = React.useRef(onComplete);\n\n  React.useEffect(() => {\n    completeRef.current = onComplete;\n  }, [onComplete]);\n\n  React.useEffect(() => {\n    if (typeof window !== \"undefined\" && window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) return;\n    let i = 0;\n    let timer = 0;\n    const tick = () => {\n      i += 1;\n      setStep(i);\n      if (i < total) {\n        timer = window.setTimeout(tick, beat);\n      } else {\n        completeRef.current?.();\n        if (loop) {\n          timer = window.setTimeout(() => {\n            i = 0;\n            setStep(0);\n            timer = window.setTimeout(tick, beat);\n          }, hold);\n        }\n      }\n    };\n    timer = window.setTimeout(tick, beat);\n    return () => window.clearTimeout(timer);\n  }, [total, beat, hold, loop, run]);\n\n  const replay = () => {\n    setStep(0);\n    setRun((r) => r + 1);\n  };\n\n  const vars = { \"--hb-vc2-accent\": accent, \"--hb-vc2-beat\": `${beat}ms`, ...style } as React.CSSProperties;\n\n  return (\n    <section className={[\"hb-vc2\", className].filter(Boolean).join(\" \")} style={vars} {...rest}>\n      <style href=\"hb-cinema-trailer-slam\" precedence=\"default\">{css}</style>\n      <div className=\"hb-vc2-smoke\" aria-hidden=\"true\" />\n      <div className=\"hb-vc2-stage\" aria-hidden=\"true\" data-beat={done ? undefined : step}>\n        <div className=\"hb-vc2-flare\" key={`f${run}-${step}`} />\n        {!done ? (\n          <div className=\"hb-vc2-shake\" key={`s${run}-${step}`}>\n            <p className=\"hb-vc2-word\">{words[step]}</p>\n          </div>\n        ) : null}\n        <div className=\"hb-vc2-flash\" key={`l${run}-${step}`} />\n      </div>\n      <div className=\"hb-vc2-final\" data-show={done ? \"true\" : \"false\"}>\n        {studio ? <p className=\"hb-vc2-studio\">{studio}</p> : null}\n        <Heading className=\"hb-vc2-title\">{title}</Heading>\n        {release ? <p className=\"hb-vc2-release\">{release}</p> : null}\n        <div className=\"hb-vc2-actions\">\n          <a className=\"hb-vc2-btn\" data-primary=\"\" href={ctaHref}>{ctaLabel}</a>\n          <button type=\"button\" className=\"hb-vc2-btn\" onClick={replay}>\n            <svg width=\"13\" height=\"13\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\"><path d=\"M3 8a5 5 0 1 0 1.6-3.7M3 2.5v2.8h2.8\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>\n            Replay\n          </button>\n        </div>\n      </div>\n      <div className=\"hb-vc2-pips\" aria-hidden=\"true\">\n        {words.map((w, i) => (\n          <span key={w + i} className=\"hb-vc2-pip\" data-on={i === step || (done && i === total - 1) ? \"true\" : \"false\"} />\n        ))}\n      </div>\n      <span className=\"hb-vc2-rating\" aria-hidden=\"true\">Teaser · Approved for all audiences</span>\n    </section>\n  );\n}\n"
    }
  ]
}