{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "loader-book-flip",
  "type": "registry:component",
  "title": "Loader Book Flip",
  "description": "An open book whose pages turn one after another in 3D, then return to the right-hand stack.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "loaders",
    "loader",
    "book",
    "pages",
    "3d",
    "reading",
    "css"
  ],
  "docs": "https://hyperblur.dev/effects/loader-book-flip",
  "files": [
    {
      "path": "registry/hyperblur/loader-book-flip.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/loader-book-flip.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface LoaderBookFlipProps extends React.HTMLAttributes<HTMLSpanElement> {\n  size?: number;\n  color?: string;\n  accent?: string;\n  speed?: number;\n  pages?: number;\n  label?: string;\n}\n\nconst css = `\n.hb-yb6 {\n  position: relative;\n  display: inline-flex;\n  flex-direction: column;\n  align-items: center;\n  gap: 10px;\n  vertical-align: middle;\n  box-sizing: border-box;\n  font-family: inherit;\n}\n.hb-yb6 *, .hb-yb6 *::before, .hb-yb6 *::after { box-sizing: border-box; }\n.hb-yb6-bk {\n  flex: none;\n  width: var(--hb-yb6-s);\n  height: calc(var(--hb-yb6-s) * 0.7);\n  perspective: calc(var(--hb-yb6-s) * 9);\n}\n.hb-yb6-st {\n  position: relative;\n  width: 100%;\n  height: 100%;\n  transform-style: preserve-3d;\n  transform: rotateX(22deg);\n}\n.hb-yb6-cv {\n  position: absolute;\n  inset: calc(var(--hb-yb6-s) * -0.045);\n  border-radius: calc(var(--hb-yb6-s) * 0.06);\n  background: linear-gradient(160deg, var(--hb-yb6-c), rgba(0, 0, 0, 0.35)), var(--hb-yb6-c);\n  box-shadow: 0 calc(var(--hb-yb6-s) * 0.08) calc(var(--hb-yb6-s) * 0.18) rgba(0, 0, 0, 0.45);\n  transform: translateZ(-1px);\n}\n.hb-yb6-sp {\n  position: absolute;\n  left: calc(50% - 1px);\n  top: 0;\n  bottom: 0;\n  width: 2px;\n  background: rgba(0, 0, 0, 0.4);\n  transform: translateZ(0.2px);\n}\n.hb-yb6-bs {\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  width: 50%;\n  background: linear-gradient(90deg, rgba(0, 0, 0, 0.1), transparent 26%), var(--hb-yb6-a);\n  filter: brightness(0.86);\n}\n.hb-yb6-bs-l { left: 0; border-radius: 3px 0 0 3px; transform: translateZ(0.1px); }\n.hb-yb6-bs-r { left: 50%; border-radius: 0 3px 3px 0; transform: translateZ(0.1px); }\n.hb-yb6-p {\n  position: absolute;\n  left: 50%;\n  top: 0;\n  width: 50%;\n  height: 100%;\n  border-radius: 0 3px 3px 0;\n  background: linear-gradient(90deg, rgba(0, 0, 0, 0.16), transparent 24%), var(--hb-yb6-a);\n  transform-origin: 0 50%;\n  transform: rotateY(var(--hb-yb6-r, 0deg)) translateZ(var(--hb-yb6-z));\n  animation: hb-yb6-flip var(--hb-yb6-d) infinite;\n  animation-delay: calc(var(--hb-yb6-i) * var(--hb-yb6-d) * 0.11);\n}\n.hb-yb6-p::after {\n  content: \"\";\n  position: absolute;\n  inset: 16% 14% 16% 20%;\n  background: repeating-linear-gradient(\n    180deg,\n    rgba(0, 0, 0, 0.24) 0,\n    rgba(0, 0, 0, 0.24) 1.5px,\n    transparent 1.5px,\n    transparent calc(var(--hb-yb6-s) * 0.085)\n  );\n}\n.hb-yb6-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-yb6-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-yb6-flip {\n  0%, 6% {\n    transform: rotateY(0deg) translateZ(var(--hb-yb6-z));\n    opacity: 1;\n    animation-timing-function: cubic-bezier(0.5, 0, 0.25, 1);\n  }\n  34%, 78% { transform: rotateY(-180deg) translateZ(var(--hb-yb6-z)); opacity: 1; }\n  90% { transform: rotateY(-180deg) translateZ(var(--hb-yb6-z)); opacity: 0; }\n  90.1% { transform: rotateY(0deg) translateZ(var(--hb-yb6-z)); opacity: 0; }\n  100% { transform: rotateY(0deg) translateZ(var(--hb-yb6-z)); opacity: 1; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-yb6-p { animation: none; }\n  .hb-yb6-p:nth-of-type(-n + 2) { --hb-yb6-r: -180deg; }\n}\n`;\n\nexport function LoaderBookFlip({\n  size = 56,\n  color = \"#2f7bff\",\n  accent = \"#ece8df\",\n  speed = 3.2,\n  pages = 5,\n  label,\n  className = \"\",\n  style,\n  ...rest\n}: LoaderBookFlipProps) {\n  const n = Math.max(3, Math.min(8, Math.round(pages)));\n  const vars = {\n    \"--hb-yb6-s\": `${size}px`,\n    \"--hb-yb6-d\": `${(speed > 0 ? speed : 3.2).toFixed(3)}s`,\n    \"--hb-yb6-c\": color,\n    \"--hb-yb6-a\": accent,\n    ...style,\n  } as React.CSSProperties;\n\n  return (\n    <span role=\"status\" className={`hb-yb6 ${className}`} style={vars} {...rest}>\n      <style href=\"hb-loader-book-flip\" precedence=\"default\">{css}</style>\n      <span className=\"hb-yb6-bk\" aria-hidden=\"true\">\n        <span className=\"hb-yb6-st\">\n          <b className=\"hb-yb6-cv\" />\n          <b className=\"hb-yb6-bs hb-yb6-bs-l\" />\n          <b className=\"hb-yb6-bs hb-yb6-bs-r\" />\n          <b className=\"hb-yb6-sp\" />\n          {Array.from({ length: n }, (_, i) => (\n            <i\n              key={i}\n              className=\"hb-yb6-p\"\n              style={\n                {\n                  \"--hb-yb6-i\": i,\n                  \"--hb-yb6-z\": `${((n - i) * 0.6).toFixed(2)}px`,\n                } as React.CSSProperties\n              }\n            />\n          ))}\n        </span>\n      </span>\n      <span className={label ? \"hb-yb6-l\" : \"hb-yb6-sr\"}>{label ?? \"Loading\"}</span>\n    </span>\n  );\n}\n"
    }
  ]
}