{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "loader-rocket-trail",
  "type": "registry:component",
  "title": "Loader Rocket Trail",
  "description": "A small rocket accelerates along a curved path and leaves a trail that fades behind it, then launches again.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "loaders",
    "loader",
    "rocket",
    "launch",
    "deploy",
    "trail",
    "svg"
  ],
  "docs": "https://hyperblur.dev/effects/loader-rocket-trail",
  "files": [
    {
      "path": "registry/hyperblur/loader-rocket-trail.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/loader-rocket-trail.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface LoaderRocketTrailProps extends React.HTMLAttributes<HTMLSpanElement> {\n  size?: number;\n  color?: string;\n  accent?: string;\n  speed?: number;\n  label?: string;\n}\n\nconst PATH_UNITS = [8, 68, 10, 30, 40, 8, 92, 14];\nconst TRAIL = [\n  { len: 38, alpha: 0.2 },\n  { len: 28, alpha: 0.26 },\n  { len: 19, alpha: 0.34 },\n  { len: 10, alpha: 0.5 },\n];\n\nfunction pathAt(k: number): string {\n  const v = PATH_UNITS.map((n) => (n * k).toFixed(2));\n  return `M ${v[0]} ${v[1]} C ${v[2]} ${v[3]}, ${v[4]} ${v[5]}, ${v[6]} ${v[7]}`;\n}\n\nconst css = `\n.hb-yb8 {\n  position: relative;\n  display: inline-flex;\n  flex-direction: column;\n  align-items: center;\n  gap: 8px;\n  vertical-align: middle;\n  box-sizing: border-box;\n  font-family: inherit;\n}\n.hb-yb8 *, .hb-yb8 *::before, .hb-yb8 *::after { box-sizing: border-box; }\n.hb-yb8-sky {\n  position: relative;\n  flex: none;\n  width: var(--hb-yb8-s);\n  height: calc(var(--hb-yb8-s) * 0.8);\n}\n.hb-yb8-svg {\n  position: absolute;\n  inset: 0;\n  display: block;\n  width: 100%;\n  height: 100%;\n  overflow: visible;\n}\n.hb-yb8-guide {\n  fill: none;\n  stroke: var(--hb-yb8-c);\n  stroke-width: 0.8;\n  stroke-dasharray: 1.5 3.5;\n  stroke-linecap: round;\n  opacity: 0.22;\n}\n.hb-yb8-trail {\n  animation: hb-yb8-show var(--hb-yb8-d) linear infinite;\n}\n.hb-yb8-tr {\n  fill: none;\n  stroke: var(--hb-yb8-c);\n  stroke-width: 2.6;\n  stroke-linecap: round;\n  stroke-dasharray: var(--hb-yb8-l) 300;\n  stroke-dashoffset: var(--hb-yb8-l);\n  animation: hb-yb8-streak var(--hb-yb8-d) linear infinite;\n}\n.hb-yb8-rk {\n  position: absolute;\n  left: 0;\n  top: 0;\n  width: calc(var(--hb-yb8-s) * 0.3);\n  height: calc(var(--hb-yb8-s) * 0.12);\n  offset-path: var(--hb-yb8-path);\n  offset-rotate: auto;\n  offset-anchor: 50% 50%;\n  offset-distance: 0%;\n  opacity: 0;\n  animation:\n    hb-yb8-fly var(--hb-yb8-d) cubic-bezier(0.45, 0, 0.8, 0.6) infinite,\n    hb-yb8-appear var(--hb-yb8-d) linear infinite;\n}\n.hb-yb8-rk svg {\n  display: block;\n  width: 100%;\n  height: 100%;\n  overflow: visible;\n}\n.hb-yb8-fl {\n  transform-box: fill-box;\n  transform-origin: 100% 50%;\n  animation: hb-yb8-flick 0.14s ease-in-out infinite alternate;\n}\n.hb-yb8-l {\n  font-size: 12px;\n  line-height: 1.2;\n  letter-spacing: 0.01em;\n  color: inherit;\n  opacity: 0.72;\n  white-space: nowrap;\n}\n.hb-yb8-sr {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  margin: -1px;\n  padding: 0;\n  overflow: hidden;\n  clip-path: inset(50%);\n  white-space: nowrap;\n  border: 0;\n}\n@keyframes hb-yb8-fly {\n  0% { offset-distance: 0%; }\n  72%, 100% { offset-distance: 100%; }\n}\n@keyframes hb-yb8-appear {\n  0% { opacity: 0; }\n  3%, 71% { opacity: 1; }\n  76%, 100% { opacity: 0; }\n}\n@keyframes hb-yb8-show {\n  0% { opacity: 0; }\n  3%, 80% { opacity: 1; }\n  93%, 100% { opacity: 0; }\n}\n@keyframes hb-yb8-streak {\n  0% { stroke-dashoffset: var(--hb-yb8-l); animation-timing-function: cubic-bezier(0.45, 0, 0.8, 0.6); }\n  72% { stroke-dashoffset: calc(var(--hb-yb8-l) - 100); animation-timing-function: cubic-bezier(0.2, 0.6, 0.4, 1); }\n  92%, 100% { stroke-dashoffset: -100; }\n}\n@keyframes hb-yb8-flick {\n  from { transform: scaleX(0.62); }\n  to { transform: scaleX(1.12); }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-yb8-rk { animation: none; opacity: 1; offset-distance: 58%; }\n  .hb-yb8-trail { animation: none; }\n  .hb-yb8-tr { animation: none; stroke-dashoffset: calc(var(--hb-yb8-l) - 58); }\n  .hb-yb8-fl { animation: none; }\n}\n`;\n\nexport function LoaderRocketTrail({\n  size = 72,\n  color = \"#2f7bff\",\n  accent = \"#ff8a4c\",\n  speed = 2.4,\n  label,\n  className = \"\",\n  style,\n  ...rest\n}: LoaderRocketTrailProps) {\n  const vars = {\n    \"--hb-yb8-s\": `${size}px`,\n    \"--hb-yb8-d\": `${(speed > 0 ? speed : 2.4).toFixed(3)}s`,\n    \"--hb-yb8-c\": color,\n    \"--hb-yb8-path\": `path(\"${pathAt(size / 100)}\")`,\n    ...style,\n  } as React.CSSProperties;\n  const units = pathAt(1);\n\n  return (\n    <span role=\"status\" className={`hb-yb8 ${className}`} style={vars} {...rest}>\n      <style href=\"hb-loader-rocket-trail\" precedence=\"default\">{css}</style>\n      <span className=\"hb-yb8-sky\" aria-hidden=\"true\">\n        <svg className=\"hb-yb8-svg\" viewBox=\"0 0 100 80\" focusable=\"false\">\n          <path className=\"hb-yb8-guide\" d={units} />\n          <g className=\"hb-yb8-trail\">\n            {TRAIL.map((t) => (\n              <path\n                key={t.len}\n                className=\"hb-yb8-tr\"\n                d={units}\n                pathLength={100}\n                opacity={t.alpha}\n                style={{ \"--hb-yb8-l\": t.len } as React.CSSProperties}\n              />\n            ))}\n          </g>\n        </svg>\n        <span className=\"hb-yb8-rk\">\n          <svg viewBox=\"-8 0 30 12\" focusable=\"false\">\n            <g className=\"hb-yb8-fl\">\n              <path d=\"M3 6 L-7 3.2 Q-4 6 -7 8.8 Z\" fill={accent} />\n              <path d=\"M3 6 L-3.5 4.7 L-3.5 7.3 Z\" fill=\"#fff4d6\" />\n            </g>\n            <path d=\"M6 3.4 L2 0.2 L10 2.6 Z\" fill={accent} />\n            <path d=\"M6 8.6 L2 11.8 L10 9.4 Z\" fill={accent} />\n            <path d=\"M3 4.4 C8 1.2 15 2.2 21 6 C15 9.8 8 10.8 3 7.6 Z\" fill=\"#ededed\" />\n            <path d=\"M15.5 3.2 C17.5 3.8 19.5 5 21 6 C19.5 7 17.5 8.2 15.5 8.8 C16.6 7.4 16.6 4.6 15.5 3.2 Z\" fill={color} />\n            <circle cx=\"11.5\" cy=\"6\" r=\"1.8\" fill=\"#0a0a0a\" stroke={color} strokeWidth=\"0.8\" />\n          </svg>\n        </span>\n      </span>\n      <span className={label ? \"hb-yb8-l\" : \"hb-yb8-sr\"}>{label ?? \"Loading\"}</span>\n    </span>\n  );\n}\n"
    }
  ]
}