{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hero-section-1",
  "title": "Hero Section 1",
  "description": "Solace UI hero section block variation 1.",
  "dependencies": [
    "motion",
    "lucide-react"
  ],
  "registryDependencies": [
    "button"
  ],
  "files": [
    {
      "path": "src/registry/blocks/hero-section/one/index.tsx",
      "content": "\"use client\";\r\n\r\nimport React from \"react\";\r\nimport Link from \"next/link\";\r\nimport { ArrowRight } from \"lucide-react\";\r\nimport { Button } from \"@/components/ui/button\"; // Adjust to your path\r\nimport { TextEffect } from \"@/registry/blocks/hero-section/text-effect\";\nimport { AnimatedGroup } from \"@/components/ui/animated-group\"; // Adjust to your path\r\nimport CircularGallery from \"@/registry/blocks/hero-section/one/circular-gallery\";\nimport { Variants } from \"motion/react\";\r\n\r\nconst transitionVariants: { item: Variants } = {\r\n  item: {\r\n    hidden: {\r\n      opacity: 0,\r\n      filter: \"blur(12px)\",\r\n      y: 12,\r\n    },\r\n    visible: {\r\n      opacity: 1,\r\n      filter: \"blur(0px)\",\r\n      y: 0,\r\n      transition: {\r\n        type: \"spring\",\r\n        bounce: 0.3,\r\n        duration: 1.5,\r\n      },\r\n    },\r\n  },\r\n};\r\n\r\nexport default function HeroSection1() {\r\n  const defaultItems = [\r\n    {\r\n      image: `https://assets.solaceui.com/solaceui-Behance-screen.png`,\r\n      text: \"Behance\",\r\n    },\r\n    {\r\n      image: `https://assets.solaceui.com/solaceui-Notion-screen.png`,\r\n      text: \"Notion\",\r\n    },\r\n    {\r\n      image: `https://assets.solaceui.com/solaceui-One-screen.png`,\r\n      text: \"One\",\r\n    },\r\n    {\r\n      image: `https://assets.solaceui.com/solaceui-Reddit-nj7hwh.png`,\r\n      text: \"Reddit\",\r\n    },\r\n    {\r\n      image: `https://assets.solaceui.com/solaceui-Behance-screen.png`,\r\n      text: \"Behance\",\r\n    },\r\n    {\r\n      image: `https://assets.solaceui.com/solaceui-Notion-screen.png`,\r\n      text: \"Notion\",\r\n    },\r\n  ];\r\n\r\n  return (\r\n    <>\r\n      <main className=\"z-10\">\r\n        <section>\r\n          <div className=\"relative overflow-hidden pt-2 md:pt-4\">\r\n            {/* Constrained content for the hero text */}\r\n            <div className=\"mx-auto max-w-7xl px-6\">\r\n              <div className=\"text-center sm:mx-auto lg:mr-auto lg:mt-0\">\r\n                <AnimatedGroup variants={transitionVariants}>\r\n                  <Link\r\n                    href=\"#link\"\r\n                    className=\"hover:bg-background dark:hover:border-t-border bg-muted group mx-auto flex w-fit items-center gap-4 rounded-full border p-1 pl-4 shadow-md shadow-zinc-950/5 transition-colors duration-300 dark:border-t-white/5 dark:shadow-zinc-950\"\r\n                  >\r\n                    <span className=\"text-foreground text-sm\">\r\n                      Introducing Exclusive Curated UI Designs\r\n                    </span>\r\n                    <span className=\"dark:border-background block h-4 w-0.5 border-l bg-white dark:bg-zinc-700\"></span>\r\n                    <div className=\"bg-background group-hover:bg-muted size-6 overflow-hidden rounded-full duration-500\">\r\n                      <div className=\"flex w-12 -translate-x-1/2 duration-500 ease-in-out group-hover:translate-x-0\">\r\n                        <span className=\"flex size-6\">\r\n                          <ArrowRight className=\"m-auto size-3 dark:text-white text-black\" />\r\n                        </span>\r\n                        <span className=\"flex size-6\">\r\n                          <ArrowRight className=\"m-auto size-3 dark:text-white text-black\" />\r\n                        </span>\r\n                      </div>\r\n                    </div>\r\n                  </Link>\r\n                </AnimatedGroup>\r\n\r\n                <TextEffect\r\n                  preset=\"fade-in-blur\"\r\n                  speedSegment={0.3}\r\n                  as=\"h1\"\r\n                  className=\"mt-8 text-balance text-6xl dark:text-white text-black md:text-7xl lg:mt-16 xl:text-[5.25rem] \"\r\n                >\r\n                  The Ultimate Library of Curated UI Designs\r\n                </TextEffect>\r\n                <TextEffect\r\n                  per=\"line\"\r\n                  preset=\"fade-in-blur\"\r\n                  speedSegment={0.3}\r\n                  delay={0.5}\r\n                  as=\"p\"\r\n                  className=\"mx-auto mt-8 max-w-2xl text-balance text-lg dark:text-white/60 text-black\"\r\n                >\r\n                  Explore hundreds of beautifully crafted user interfaces from\r\n                  top designers around the world. Choose our handpicked gallery\r\n                  of modern UI inspiration.\r\n                </TextEffect>\r\n\r\n                <AnimatedGroup\r\n                  variants={{\r\n                    container: {\r\n                      visible: {\r\n                        transition: {\r\n                          staggerChildren: 0.05,\r\n                          delayChildren: 0.75,\r\n                        },\r\n                      },\r\n                    },\r\n                    ...transitionVariants,\r\n                  }}\r\n                  className=\"mt-12 flex flex-col items-center justify-center gap-2 md:flex-row\"\r\n                >\r\n                  <div key={1} className=\"\">\r\n                    <Button\r\n                      asChild\r\n                      size=\"lg\"\r\n                      className=\"rounded-md px-5 text-base dark:bg-white bg-black\"\r\n                    >\r\n                      <Link href=\"#link\">\r\n                        <span className=\"text-nowra dark:text-black text-white\">\r\n                          Browse Designs\r\n                        </span>\r\n                      </Link>\r\n                    </Button>\r\n                  </div>\r\n                  <Button\r\n                    key={2}\r\n                    asChild\r\n                    size=\"lg\"\r\n                    variant=\"ghost\"\r\n                    className=\"rounded-md px-5 bg-foreground/10\"\r\n                  >\r\n                    <Link href=\"#link\">\r\n                      <span className=\"text-nowrap dark:text-white text-black\">\r\n                        Submit Your Work\r\n                      </span>\r\n                    </Link>\r\n                  </Button>\r\n                </AnimatedGroup>\r\n              </div>\r\n            </div>\r\n\r\n            <div className=\"mt-12 w-screen relative left-1/2 right-1/2 ml-[-50vw] mr-[-50vw]\">\r\n              <CircularGallery\r\n                items={defaultItems}\r\n                bend={-9}\r\n                textColor=\"#ffffff\"\r\n                borderRadius={0.03}\r\n              />\r\n            </div>\r\n          </div>\r\n        </section>\r\n      </main>\r\n    </>\r\n  );\r\n}\r\n",
      "type": "registry:component",
      "target": "components/hero-section-1.tsx"
    },
    {
      "path": "src/registry/blocks/hero-section/one/circular-gallery.tsx",
      "content": "// Component from React Bits\r\n\r\n// Install the dependency\r\n// npm install ogl\r\n\r\n\"use client\";\r\nimport { useRef, useEffect } from \"react\";\r\nimport {\r\n    Renderer,\r\n    Camera,\r\n    Transform,\r\n    Plane,\r\n    Mesh,\r\n    Program,\r\n    Texture,\r\n} from \"ogl\";\r\n\r\ntype GL = Renderer[\"gl\"];\r\n\r\n/**\r\n * Simple utility: debounce\r\n */\r\nfunction debounce<T extends (...args: any[]) => void>(func: T, wait: number) {\r\n    let timeout: number;\r\n    return function (this: any, ...args: Parameters<T>) {\r\n        window.clearTimeout(timeout);\r\n        timeout = window.setTimeout(() => func.apply(this, args), wait);\r\n    };\r\n}\r\n\r\n/**\r\n * Linear interpolation\r\n */\r\nfunction lerp(p1: number, p2: number, t: number): number {\r\n    return p1 + (p2 - p1) * t;\r\n}\r\n\r\n/**\r\n * Auto-bind all class methods\r\n */\r\nfunction autoBind(instance: any): void {\r\n    const proto = Object.getPrototypeOf(instance);\r\n    Object.getOwnPropertyNames(proto).forEach((key) => {\r\n        if (key !== \"constructor\" && typeof instance[key] === \"function\") {\r\n            instance[key] = instance[key].bind(instance);\r\n        }\r\n    });\r\n}\r\n\r\n/**\r\n * Extract a numeric px font size from a string like \"bold 30px sans-serif\"\r\n */\r\nfunction getFontSize(font: string): number {\r\n    const match = font.match(/(\\d+)px/);\r\n    return match ? parseInt(match[1], 10) : 30;\r\n}\r\n\r\n/**\r\n * Create a texture from text (to display image titles, etc.)\r\n */\r\nfunction createTextTexture(\r\n    gl: GL,\r\n    text: string,\r\n    font: string = \"bold 30px monospace\",\r\n    color: string = \"black\"\r\n): { texture: Texture; width: number; height: number } {\r\n    const canvas = document.createElement(\"canvas\");\r\n    const context = canvas.getContext(\"2d\");\r\n    if (!context) throw new Error(\"Could not get 2d context\");\r\n\r\n    context.font = font;\r\n    const metrics = context.measureText(text);\r\n    const textWidth = Math.ceil(metrics.width);\r\n    const fontSize = getFontSize(font);\r\n    const textHeight = Math.ceil(fontSize * 1.2);\r\n\r\n    canvas.width = textWidth + 20;\r\n    canvas.height = textHeight + 20;\r\n\r\n    context.font = font;\r\n    context.fillStyle = color;\r\n    context.textBaseline = \"middle\";\r\n    context.textAlign = \"center\";\r\n    context.clearRect(0, 0, canvas.width, canvas.height);\r\n    context.fillText(text, canvas.width / 2, canvas.height / 2);\r\n\r\n    const texture = new Texture(gl, { generateMipmaps: false });\r\n    texture.image = canvas;\r\n    return { texture, width: canvas.width, height: canvas.height };\r\n}\r\n\r\ninterface TitleProps {\r\n    gl: GL;\r\n    plane: Mesh;\r\n    renderer: Renderer;\r\n    text: string;\r\n    textColor?: string;\r\n    font?: string;\r\n}\r\n\r\n/**\r\n * Displays a text label beneath each image\r\n */\r\nclass Title {\r\n    gl: GL;\r\n    plane: Mesh;\r\n    renderer: Renderer;\r\n    text: string;\r\n    textColor: string;\r\n    font: string;\r\n    mesh!: Mesh;\r\n\r\n    constructor({\r\n        gl,\r\n        plane,\r\n        renderer,\r\n        text,\r\n        textColor = \"#545050\",\r\n        font = \"30px sans-serif\",\r\n    }: TitleProps) {\r\n        autoBind(this);\r\n        this.gl = gl;\r\n        this.plane = plane;\r\n        this.renderer = renderer;\r\n        this.text = text;\r\n        this.textColor = textColor;\r\n        this.font = font;\r\n        this.createMesh();\r\n    }\r\n\r\n    createMesh() {\r\n        const { texture, width, height } = createTextTexture(\r\n            this.gl,\r\n            this.text,\r\n            this.font,\r\n            this.textColor\r\n        );\r\n        const geometry = new Plane(this.gl);\r\n        const program = new Program(this.gl, {\r\n            vertex: `\r\n        attribute vec3 position;\r\n        attribute vec2 uv;\r\n        uniform mat4 modelViewMatrix;\r\n        uniform mat4 projectionMatrix;\r\n        varying vec2 vUv;\r\n        void main() {\r\n          vUv = uv;\r\n          gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n        }\r\n      `,\r\n            fragment: `\r\n        precision highp float;\r\n        uniform sampler2D tMap;\r\n        varying vec2 vUv;\r\n        void main() {\r\n          vec4 color = texture2D(tMap, vUv);\r\n          // Discard very transparent fragments\r\n          if (color.a < 0.1) discard;\r\n          gl_FragColor = color;\r\n        }\r\n      `,\r\n            uniforms: { tMap: { value: texture } },\r\n            transparent: true,\r\n        });\r\n        this.mesh = new Mesh(this.gl, { geometry, program });\r\n\r\n        const aspect = width / height;\r\n        // Make text ~15% of plane height\r\n        const textHeightScaled = this.plane.scale.y * 0.15;\r\n        const textWidthScaled = textHeightScaled * aspect;\r\n        this.mesh.scale.set(textWidthScaled, textHeightScaled, 1);\r\n\r\n        // Position the text slightly below the plane\r\n        this.mesh.position.y =\r\n            -this.plane.scale.y * 0.5 - textHeightScaled * 0.5 - 0.05;\r\n\r\n        this.mesh.setParent(this.plane);\r\n    }\r\n}\r\n\r\ninterface ScreenSize {\r\n    width: number;\r\n    height: number;\r\n}\r\n\r\ninterface Viewport {\r\n    width: number;\r\n    height: number;\r\n}\r\n\r\ninterface MediaProps {\r\n    geometry: Plane;\r\n    gl: GL;\r\n    image: string;\r\n    index: number;\r\n    length: number;\r\n    renderer: Renderer;\r\n    scene: Transform;\r\n    screen: ScreenSize;\r\n    text: string;\r\n    viewport: Viewport;\r\n    bend: number;\r\n    textColor: string;\r\n    borderRadius?: number;\r\n    font?: string;\r\n}\r\n\r\n/**\r\n * Represents a single image + text in the circular gallery\r\n */\r\nclass Media {\r\n    extra: number = 0;\r\n    geometry: Plane;\r\n    gl: GL;\r\n    image: string;\r\n    index: number;\r\n    length: number;\r\n    renderer: Renderer;\r\n    scene: Transform;\r\n    screen: ScreenSize;\r\n    text: string;\r\n    viewport: Viewport;\r\n    bend: number;\r\n    textColor: string;\r\n    borderRadius: number;\r\n    font?: string;\r\n    program!: Program;\r\n    plane!: Mesh;\r\n    title!: Title;\r\n    scale!: number;\r\n    padding!: number;\r\n    width!: number;\r\n    widthTotal!: number;\r\n    x!: number;\r\n    speed: number = 0;\r\n    isBefore: boolean = false;\r\n    isAfter: boolean = false;\r\n\r\n    constructor({\r\n        geometry,\r\n        gl,\r\n        image,\r\n        index,\r\n        length,\r\n        renderer,\r\n        scene,\r\n        screen,\r\n        text,\r\n        viewport,\r\n        bend,\r\n        textColor,\r\n        borderRadius = 0,\r\n        font,\r\n    }: MediaProps) {\r\n        this.geometry = geometry;\r\n        this.gl = gl;\r\n        this.image = image;\r\n        this.index = index;\r\n        this.length = length;\r\n        this.renderer = renderer;\r\n        this.scene = scene;\r\n        this.screen = screen;\r\n        this.text = text;\r\n        this.viewport = viewport;\r\n        this.bend = bend;\r\n        this.textColor = textColor;\r\n        this.borderRadius = borderRadius;\r\n        this.font = font;\r\n\r\n        this.createShader();\r\n        this.createMesh();\r\n        this.createTitle();\r\n        this.onResize();\r\n    }\r\n\r\n    createShader() {\r\n        const texture = new Texture(this.gl, { generateMipmaps: false });\r\n        this.program = new Program(this.gl, {\r\n            depthTest: false,\r\n            depthWrite: false,\r\n            vertex: `\r\n        precision highp float;\r\n        attribute vec3 position;\r\n        attribute vec2 uv;\r\n        uniform mat4 modelViewMatrix;\r\n        uniform mat4 projectionMatrix;\r\n        uniform float uTime;\r\n        uniform float uSpeed;\r\n        varying vec2 vUv;\r\n        void main() {\r\n          vUv = uv;\r\n          vec3 p = position;\r\n          // Subtle wave\r\n          p.z = (sin(p.x * 4.0 + uTime) * 1.5 + cos(p.y * 2.0 + uTime) * 1.5) * (0.1 + uSpeed * 0.5);\r\n          gl_Position = projectionMatrix * modelViewMatrix * vec4(p, 1.0);\r\n        }\r\n      `,\r\n            fragment: `\r\n        precision highp float;\r\n        uniform vec2 uImageSizes;\r\n        uniform vec2 uPlaneSizes;\r\n        uniform sampler2D tMap;\r\n        uniform float uBorderRadius;\r\n        varying vec2 vUv;\r\n        \r\n        // Signed Distance Function for a rounded box\r\n        float roundedBoxSDF(vec2 p, vec2 b, float r) {\r\n          vec2 d = abs(p) - b;\r\n          return length(max(d, vec2(0.0))) + min(max(d.x, d.y), 0.0) - r;\r\n        }\r\n        \r\n        void main() {\r\n          // Fit the image while preserving aspect ratio\r\n          vec2 ratio = vec2(\r\n            min((uPlaneSizes.x / uPlaneSizes.y) / (uImageSizes.x / uImageSizes.y), 1.0),\r\n            min((uPlaneSizes.y / uPlaneSizes.x) / (uImageSizes.y / uImageSizes.x), 1.0)\r\n          );\r\n          vec2 uv = vec2(\r\n            vUv.x * ratio.x + (1.0 - ratio.x) * 0.5,\r\n            vUv.y * ratio.y + (1.0 - ratio.y) * 0.5\r\n          );\r\n          \r\n          vec4 color = texture2D(tMap, uv);\r\n          \r\n          // Rounded corners in UV space\r\n          float d = roundedBoxSDF(vUv - 0.5, vec2(0.5 - uBorderRadius), uBorderRadius);\r\n          if(d > 0.0) {\r\n            discard;\r\n          }\r\n          \r\n          gl_FragColor = vec4(color.rgb, 1.0);\r\n        }\r\n      `,\r\n            uniforms: {\r\n                tMap: { value: texture },\r\n                uPlaneSizes: { value: [0, 0] },\r\n                uImageSizes: { value: [0, 0] },\r\n                uSpeed: { value: 0 },\r\n                uTime: { value: 100 * Math.random() },\r\n                uBorderRadius: { value: this.borderRadius },\r\n            },\r\n            transparent: true,\r\n        });\r\n\r\n        const img = new Image();\r\n        img.crossOrigin = \"anonymous\";\r\n        img.src = this.image;\r\n        img.onload = () => {\r\n            texture.image = img;\r\n            this.program.uniforms.uImageSizes.value = [\r\n                img.naturalWidth,\r\n                img.naturalHeight,\r\n            ];\r\n        };\r\n    }\r\n\r\n    createMesh() {\r\n        this.plane = new Mesh(this.gl, {\r\n            geometry: this.geometry,\r\n            program: this.program,\r\n        });\r\n        this.plane.setParent(this.scene);\r\n    }\r\n\r\n    createTitle() {\r\n        this.title = new Title({\r\n            gl: this.gl,\r\n            plane: this.plane,\r\n            renderer: this.renderer,\r\n            text: this.text,\r\n            textColor: this.textColor,\r\n            font: this.font,\r\n        });\r\n    }\r\n\r\n    update(\r\n        scroll: { current: number; last: number },\r\n        direction: \"right\" | \"left\"\r\n    ) {\r\n        // Move horizontally\r\n        this.plane.position.x = this.x - scroll.current - this.extra;\r\n\r\n        // Bend the carousel\r\n        const x = this.plane.position.x;\r\n        const H = this.viewport.width / 2;\r\n        if (this.bend === 0) {\r\n            this.plane.position.y = 0;\r\n            this.plane.rotation.z = 0;\r\n        } else {\r\n            const B_abs = Math.abs(this.bend);\r\n            const R = (H * H + B_abs * B_abs) / (2 * B_abs);\r\n            const effectiveX = Math.min(Math.abs(x), H);\r\n            const arc = R - Math.sqrt(R * R - effectiveX * effectiveX);\r\n\r\n            if (this.bend > 0) {\r\n                this.plane.position.y = -arc;\r\n                this.plane.rotation.z = -Math.sign(x) * Math.asin(effectiveX / R);\r\n            } else {\r\n                this.plane.position.y = arc;\r\n                this.plane.rotation.z = Math.sign(x) * Math.asin(effectiveX / R);\r\n            }\r\n        }\r\n\r\n        // Animate wave\r\n        this.speed = scroll.current - scroll.last;\r\n        this.program.uniforms.uTime.value += 0.04;\r\n        this.program.uniforms.uSpeed.value = this.speed;\r\n\r\n        // Looping logic\r\n        const planeOffset = this.plane.scale.x / 2;\r\n        const viewportOffset = this.viewport.width / 2;\r\n        this.isBefore = this.plane.position.x + planeOffset < -viewportOffset;\r\n        this.isAfter = this.plane.position.x - planeOffset > viewportOffset;\r\n\r\n        if (direction === \"right\" && this.isBefore) {\r\n            this.extra -= this.widthTotal;\r\n            this.isBefore = this.isAfter = false;\r\n        }\r\n        if (direction === \"left\" && this.isAfter) {\r\n            this.extra += this.widthTotal;\r\n            this.isBefore = this.isAfter = false;\r\n        }\r\n    }\r\n\r\n    onResize({\r\n        screen,\r\n        viewport,\r\n    }: { screen?: ScreenSize; viewport?: Viewport } = {}) {\r\n        if (screen) this.screen = screen;\r\n        if (viewport) {\r\n            this.viewport = viewport;\r\n        }\r\n        // Scale the images based on screen size\r\n        this.scale = this.screen.height / 1500;\r\n        this.plane.scale.y =\r\n            (this.viewport.height * (900 * this.scale)) / this.screen.height;\r\n        this.plane.scale.x =\r\n            (this.viewport.width * (700 * this.scale)) / this.screen.width;\r\n\r\n        this.program.uniforms.uPlaneSizes.value = [\r\n            this.plane.scale.x,\r\n            this.plane.scale.y,\r\n        ];\r\n\r\n        this.padding = 2;\r\n        this.width = this.plane.scale.x + this.padding;\r\n        this.widthTotal = this.width * this.length;\r\n        this.x = this.width * this.index;\r\n    }\r\n}\r\n\r\ninterface AppConfig {\r\n    items?: { image: string; text: string }[];\r\n    bend?: number;\r\n    textColor?: string;\r\n    borderRadius?: number;\r\n    font?: string;\r\n}\r\n\r\n/**\r\n * Main application controlling the scene, camera, and a set of Media items\r\n */\r\nclass App {\r\n    container: HTMLElement;\r\n    scroll: {\r\n        ease: number;\r\n        current: number;\r\n        target: number;\r\n        last: number;\r\n        position?: number;\r\n    };\r\n    onCheckDebounce: (...args: any[]) => void;\r\n    renderer!: Renderer;\r\n    gl!: GL;\r\n    camera!: Camera;\r\n    scene!: Transform;\r\n    planeGeometry!: Plane;\r\n    medias: Media[] = [];\r\n    mediasImages: { image: string; text: string }[] = [];\r\n    screen!: { width: number; height: number };\r\n    viewport!: { width: number; height: number };\r\n    raf: number = 0;\r\n\r\n    boundOnResize!: () => void;\r\n    boundOnWheel!: () => void;\r\n    boundOnTouchDown!: (e: MouseEvent | TouchEvent) => void;\r\n    boundOnTouchMove!: (e: MouseEvent | TouchEvent) => void;\r\n    boundOnTouchUp!: () => void;\r\n\r\n    isDown: boolean = false;\r\n    start: number = 0;\r\n\r\n    constructor(\r\n        container: HTMLElement,\r\n        {\r\n            items,\r\n            bend = 1,\r\n            textColor = \"#ffffff\",\r\n            borderRadius = 0,\r\n            font = \"bold 30px DM Sans\",\r\n        }: AppConfig\r\n    ) {\r\n        document.documentElement.classList.remove(\"no-js\");\r\n        this.container = container;\r\n        this.scroll = { ease: 0.05, current: 0, target: 0, last: 0 };\r\n        this.onCheckDebounce = debounce(this.onCheck.bind(this), 200);\r\n\r\n        this.createRenderer();\r\n        this.createCamera();\r\n        this.createScene();\r\n        this.onResize();\r\n        this.createGeometry();\r\n        this.createMedias(items, bend, textColor, borderRadius, font);\r\n        this.update();\r\n        this.addEventListeners();\r\n    }\r\n\r\n    createRenderer() {\r\n        this.renderer = new Renderer({ alpha: true });\r\n        this.gl = this.renderer.gl;\r\n        this.gl.clearColor(0, 0, 0, 0);\r\n        this.container.appendChild(this.renderer.gl.canvas as HTMLCanvasElement);\r\n    }\r\n\r\n    createCamera() {\r\n        this.camera = new Camera(this.gl);\r\n        this.camera.fov = 45;\r\n        this.camera.position.z = 20;\r\n    }\r\n\r\n    createScene() {\r\n        this.scene = new Transform();\r\n    }\r\n\r\n    createGeometry() {\r\n        // Increase segments so the wave looks smoother\r\n        this.planeGeometry = new Plane(this.gl, {\r\n            heightSegments: 50,\r\n            widthSegments: 100,\r\n        });\r\n    }\r\n\r\n    createMedias(\r\n        items: { image: string; text: string }[] | undefined,\r\n        bend: number = 1,\r\n        textColor: string,\r\n        borderRadius: number,\r\n        font: string\r\n    ) {\r\n        // If no items provided, fallback to placeholders\r\n        const defaultItems = [\r\n            {\r\n                image: `https://picsum.photos/seed/5/800/600?grayscale`,\r\n                text: \"Deep Diving\",\r\n            },\r\n            {\r\n                image: `https://picsum.photos/seed/16/800/600?grayscale`,\r\n                text: \"Train Track\",\r\n            },\r\n            {\r\n                image: `https://picsum.photos/seed/17/800/600?grayscale`,\r\n                text: \"Santorini\",\r\n            },\r\n            {\r\n                image: `https://picsum.photos/seed/8/800/600?grayscale`,\r\n                text: \"Blurry Lights\",\r\n            },\r\n            {\r\n                image: `https://picsum.photos/seed/9/800/600?grayscale`,\r\n                text: \"New York\",\r\n            },\r\n            {\r\n                image: `https://picsum.photos/seed/10/800/600?grayscale`,\r\n                text: \"Good Boy\",\r\n            },\r\n            {\r\n                image: `https://picsum.photos/seed/21/800/600?grayscale`,\r\n                text: \"Coastline\",\r\n            },\r\n            {\r\n                image: `https://picsum.photos/seed/12/800/600?grayscale`,\r\n                text: \"Palm Trees\",\r\n            },\r\n        ];\r\n\r\n        const galleryItems = items && items.length ? items : defaultItems;\r\n        // Duplicate items for infinite loop effect\r\n        this.mediasImages = galleryItems.concat(galleryItems);\r\n\r\n        this.medias = this.mediasImages.map((data, index) => {\r\n            return new Media({\r\n                geometry: this.planeGeometry,\r\n                gl: this.gl,\r\n                image: data.image,\r\n                index,\r\n                length: this.mediasImages.length,\r\n                renderer: this.renderer,\r\n                scene: this.scene,\r\n                screen: this.screen,\r\n                text: data.text,\r\n                viewport: this.viewport,\r\n                bend,\r\n                textColor,\r\n                borderRadius,\r\n                font,\r\n            });\r\n        });\r\n    }\r\n\r\n    onTouchDown(e: MouseEvent | TouchEvent) {\r\n        this.isDown = true;\r\n        this.scroll.position = this.scroll.current;\r\n        this.start = \"touches\" in e ? e.touches[0].clientX : e.clientX;\r\n    }\r\n\r\n    onTouchMove(e: MouseEvent | TouchEvent) {\r\n        if (!this.isDown) return;\r\n        const x = \"touches\" in e ? e.touches[0].clientX : e.clientX;\r\n        const distance = (this.start - x) * 0.05;\r\n        this.scroll.target = (this.scroll.position ?? 0) + distance;\r\n    }\r\n\r\n    onTouchUp() {\r\n        this.isDown = false;\r\n        this.onCheck();\r\n    }\r\n\r\n    onWheel() {\r\n        // Scroll horizontally\r\n        this.scroll.target += 2;\r\n        this.onCheckDebounce();\r\n    }\r\n\r\n    onCheck() {\r\n        // Snap to nearest image\r\n        if (!this.medias.length) return;\r\n        const width = this.medias[0].width;\r\n        const itemIndex = Math.round(Math.abs(this.scroll.target) / width);\r\n        const item = width * itemIndex;\r\n        this.scroll.target = this.scroll.target < 0 ? -item : item;\r\n    }\r\n\r\n    onResize() {\r\n        this.screen = {\r\n            width: this.container.clientWidth,\r\n            height: this.container.clientHeight,\r\n        };\r\n        this.renderer.setSize(this.screen.width, this.screen.height);\r\n\r\n        // Update camera\r\n        this.camera.perspective({\r\n            aspect: this.screen.width / this.screen.height,\r\n        });\r\n\r\n        // Convert FOV to radians\r\n        const fov = (this.camera.fov * Math.PI) / 180;\r\n        const height = 2 * Math.tan(fov / 2) * this.camera.position.z;\r\n        const width = height * this.camera.aspect;\r\n        this.viewport = { width, height };\r\n\r\n        // Resize each Media\r\n        this.medias.forEach((media) =>\r\n            media.onResize({ screen: this.screen, viewport: this.viewport })\r\n        );\r\n    }\r\n\r\n    update() {\r\n        this.scroll.current = lerp(\r\n            this.scroll.current,\r\n            this.scroll.target,\r\n            this.scroll.ease\r\n        );\r\n\r\n        const direction = this.scroll.current > this.scroll.last ? \"right\" : \"left\";\r\n        this.medias.forEach((media) => media.update(this.scroll, direction));\r\n\r\n        this.renderer.render({ scene: this.scene, camera: this.camera });\r\n        this.scroll.last = this.scroll.current;\r\n        this.raf = window.requestAnimationFrame(this.update.bind(this));\r\n    }\r\n\r\n    addEventListeners() {\r\n        this.boundOnResize = this.onResize.bind(this);\r\n        this.boundOnWheel = this.onWheel.bind(this);\r\n        this.boundOnTouchDown = this.onTouchDown.bind(this);\r\n        this.boundOnTouchMove = this.onTouchMove.bind(this);\r\n        this.boundOnTouchUp = this.onTouchUp.bind(this);\r\n\r\n        window.addEventListener(\"resize\", this.boundOnResize);\r\n        window.addEventListener(\"mousewheel\", this.boundOnWheel);\r\n        window.addEventListener(\"wheel\", this.boundOnWheel);\r\n        window.addEventListener(\"mousedown\", this.boundOnTouchDown);\r\n        window.addEventListener(\"mousemove\", this.boundOnTouchMove);\r\n        window.addEventListener(\"mouseup\", this.boundOnTouchUp);\r\n        window.addEventListener(\"touchstart\", this.boundOnTouchDown);\r\n        window.addEventListener(\"touchmove\", this.boundOnTouchMove);\r\n        window.addEventListener(\"touchend\", this.boundOnTouchUp);\r\n    }\r\n\r\n    destroy() {\r\n        window.cancelAnimationFrame(this.raf);\r\n        window.removeEventListener(\"resize\", this.boundOnResize);\r\n        window.removeEventListener(\"mousewheel\", this.boundOnWheel);\r\n        window.removeEventListener(\"wheel\", this.boundOnWheel);\r\n        window.removeEventListener(\"mousedown\", this.boundOnTouchDown);\r\n        window.removeEventListener(\"mousemove\", this.boundOnTouchMove);\r\n        window.removeEventListener(\"mouseup\", this.boundOnTouchUp);\r\n        window.removeEventListener(\"touchstart\", this.boundOnTouchDown);\r\n        window.removeEventListener(\"touchmove\", this.boundOnTouchMove);\r\n        window.removeEventListener(\"touchend\", this.boundOnTouchUp);\r\n\r\n        if (this.renderer?.gl?.canvas?.parentNode) {\r\n            this.renderer.gl.canvas.parentNode.removeChild(\r\n                this.renderer.gl.canvas as HTMLCanvasElement\r\n            );\r\n        }\r\n    }\r\n}\r\n\r\ninterface CircularGalleryProps {\r\n    items?: { image: string; text: string }[];\r\n    bend?: number;\r\n    textColor?: string;\r\n    borderRadius?: number;\r\n    font?: string;\r\n}\r\n\r\n/**\r\n * Public React component for the circular gallery\r\n */\r\nexport default function CircularGallery({\r\n    items,\r\n    bend = 3,\r\n    textColor = \"#ffffff\",\r\n    borderRadius = 0.05,\r\n    font = \"bold 30px DM Sans\",\r\n}: CircularGalleryProps) {\r\n    const containerRef = useRef<HTMLDivElement>(null);\r\n\r\n    useEffect(() => {\r\n        if (!containerRef.current) return;\r\n        const app = new App(containerRef.current, {\r\n            items,\r\n            bend,\r\n            textColor,\r\n            borderRadius,\r\n            font,\r\n        });\r\n\r\n        return () => {\r\n            app.destroy();\r\n        };\r\n    }, [items, bend, textColor, borderRadius, font]);\r\n\r\n    return (\r\n        <div\r\n            className=\"w-full h-[400px] overflow-hidden cursor-grab active:cursor-grabbing\"\r\n            ref={containerRef}\r\n        />\r\n    );\r\n}\r\n",
      "type": "registry:component",
      "target": "components/circular-gallery.tsx"
    },
    {
      "path": "src/registry/blocks/hero-section/text-effect.tsx",
      "content": "// Component From Motion Primitives\r\n\r\n\"use client\";\r\nimport { cn } from \"@/lib/utils\";\r\nimport {\r\n    AnimatePresence,\r\n    motion,\r\n    TargetAndTransition,\r\n    Transition,\r\n    Variant,\r\n    Variants,\r\n} from \"motion/react\";\r\nimport React from \"react\";\r\n\r\nexport type PresetType = \"blur\" | \"fade-in-blur\" | \"scale\" | \"fade\" | \"slide\";\r\n\r\nexport type PerType = \"word\" | \"char\" | \"line\";\r\n\r\nexport type TextEffectProps = {\r\n    children: string;\r\n    per?: PerType;\r\n    as?: keyof React.JSX.IntrinsicElements;\r\n    variants?: {\r\n        container?: Variants;\r\n        item?: Variants;\r\n    };\r\n    className?: string;\r\n    preset?: PresetType;\r\n    delay?: number;\r\n    speedReveal?: number;\r\n    speedSegment?: number;\r\n    trigger?: boolean;\r\n    onAnimationComplete?: () => void;\r\n    onAnimationStart?: () => void;\r\n    segmentWrapperClassName?: string;\r\n    containerTransition?: Transition;\r\n    segmentTransition?: Transition;\r\n    style?: React.CSSProperties;\r\n};\r\n\r\nconst defaultStaggerTimes: Record<PerType, number> = {\r\n    char: 0.03,\r\n    word: 0.05,\r\n    line: 0.1,\r\n};\r\n\r\nconst defaultContainerVariants: Variants = {\r\n    hidden: { opacity: 0 },\r\n    visible: {\r\n        opacity: 1,\r\n        transition: {\r\n            staggerChildren: 0.05,\r\n        },\r\n    },\r\n    exit: {\r\n        transition: { staggerChildren: 0.05, staggerDirection: -1 },\r\n    },\r\n};\r\n\r\nconst defaultItemVariants: Variants = {\r\n    hidden: { opacity: 0 },\r\n    visible: {\r\n        opacity: 1,\r\n    },\r\n    exit: { opacity: 0 },\r\n};\r\n\r\nconst presetVariants: Record<\r\n    PresetType,\r\n    { container: Variants; item: Variants }\r\n> = {\r\n    blur: {\r\n        container: defaultContainerVariants,\r\n        item: {\r\n            hidden: { opacity: 0, filter: \"blur(12px)\" },\r\n            visible: { opacity: 1, filter: \"blur(0px)\" },\r\n            exit: { opacity: 0, filter: \"blur(12px)\" },\r\n        },\r\n    },\r\n    \"fade-in-blur\": {\r\n        container: defaultContainerVariants,\r\n        item: {\r\n            hidden: { opacity: 0, y: 20, filter: \"blur(12px)\" },\r\n            visible: { opacity: 1, y: 0, filter: \"blur(0px)\" },\r\n            exit: { opacity: 0, y: 20, filter: \"blur(12px)\" },\r\n        },\r\n    },\r\n    scale: {\r\n        container: defaultContainerVariants,\r\n        item: {\r\n            hidden: { opacity: 0, scale: 0 },\r\n            visible: { opacity: 1, scale: 1 },\r\n            exit: { opacity: 0, scale: 0 },\r\n        },\r\n    },\r\n    fade: {\r\n        container: defaultContainerVariants,\r\n        item: {\r\n            hidden: { opacity: 0 },\r\n            visible: { opacity: 1 },\r\n            exit: { opacity: 0 },\r\n        },\r\n    },\r\n    slide: {\r\n        container: defaultContainerVariants,\r\n        item: {\r\n            hidden: { opacity: 0, y: 20 },\r\n            visible: { opacity: 1, y: 0 },\r\n            exit: { opacity: 0, y: 20 },\r\n        },\r\n    },\r\n};\r\n\r\nconst AnimationComponent: React.FC<{\r\n    segment: string;\r\n    variants: Variants;\r\n    per: \"line\" | \"word\" | \"char\";\r\n    segmentWrapperClassName?: string;\r\n}> = React.memo(({ segment, variants, per, segmentWrapperClassName }) => {\r\n    const content =\r\n        per === \"line\" ? (\r\n            <motion.span variants={variants} className=\"block\">\r\n                {segment}\r\n            </motion.span>\r\n        ) : per === \"word\" ? (\r\n            <motion.span\r\n                aria-hidden=\"true\"\r\n                variants={variants}\r\n                className=\"inline-block whitespace-pre\"\r\n            >\r\n                {segment}\r\n            </motion.span>\r\n        ) : (\r\n            <motion.span className=\"inline-block whitespace-pre\">\r\n                {segment.split(\"\").map((char, charIndex) => (\r\n                    <motion.span\r\n                        key={`char-${charIndex}`}\r\n                        aria-hidden=\"true\"\r\n                        variants={variants}\r\n                        className=\"inline-block whitespace-pre\"\r\n                    >\r\n                        {char}\r\n                    </motion.span>\r\n                ))}\r\n            </motion.span>\r\n        );\r\n\r\n    if (!segmentWrapperClassName) {\r\n        return content;\r\n    }\r\n\r\n    const defaultWrapperClassName = per === \"line\" ? \"block\" : \"inline-block\";\r\n\r\n    return (\r\n        <span className={cn(defaultWrapperClassName, segmentWrapperClassName)}>\r\n            {content}\r\n        </span>\r\n    );\r\n});\r\n\r\nAnimationComponent.displayName = \"AnimationComponent\";\r\n\r\nconst splitText = (text: string, per: \"line\" | \"word\" | \"char\") => {\r\n    if (per === \"line\") return text.split(\"\\n\");\r\n    return text.split(/(\\s+)/);\r\n};\r\n\r\nconst hasTransition = (\r\n    variant: Variant\r\n): variant is TargetAndTransition & { transition?: Transition } => {\r\n    return (\r\n        typeof variant === \"object\" && variant !== null && \"transition\" in variant\r\n    );\r\n};\r\n\r\nconst createVariantsWithTransition = (\r\n    baseVariants: Variants,\r\n    transition?: Transition & { exit?: Transition }\r\n): Variants => {\r\n    if (!transition) return baseVariants;\r\n\r\n    const { exit: _, ...mainTransition } = transition;\r\n\r\n    return {\r\n        ...baseVariants,\r\n        visible: {\r\n            ...baseVariants.visible,\r\n            transition: {\r\n                ...(hasTransition(baseVariants.visible)\r\n                    ? baseVariants.visible.transition\r\n                    : {}),\r\n                ...mainTransition,\r\n            },\r\n        },\r\n        exit: {\r\n            ...baseVariants.exit,\r\n            transition: {\r\n                ...(hasTransition(baseVariants.exit)\r\n                    ? baseVariants.exit.transition\r\n                    : {}),\r\n                ...mainTransition,\r\n                staggerDirection: -1,\r\n            },\r\n        },\r\n    };\r\n};\r\n\r\nexport function TextEffect({\r\n    children,\r\n    per = \"word\",\r\n    as = \"p\",\r\n    variants,\r\n    className,\r\n    preset = \"fade\",\r\n    delay = 0,\r\n    speedReveal = 1,\r\n    speedSegment = 1,\r\n    trigger = true,\r\n    onAnimationComplete,\r\n    onAnimationStart,\r\n    segmentWrapperClassName,\r\n    containerTransition,\r\n    segmentTransition,\r\n    style,\r\n}: TextEffectProps) {\r\n    const segments = splitText(children, per);\r\n    const MotionTag = motion[as as keyof typeof motion] as typeof motion.div;\r\n\r\n    const baseVariants = preset\r\n        ? presetVariants[preset]\r\n        : { container: defaultContainerVariants, item: defaultItemVariants };\r\n\r\n    const stagger = defaultStaggerTimes[per] / speedReveal;\r\n\r\n    const baseDuration = 0.3 / speedSegment;\r\n\r\n    const customStagger = hasTransition(variants?.container?.visible ?? {})\r\n        ? (variants?.container?.visible as TargetAndTransition).transition\r\n            ?.staggerChildren\r\n        : undefined;\r\n\r\n    const customDelay = hasTransition(variants?.container?.visible ?? {})\r\n        ? (variants?.container?.visible as TargetAndTransition).transition\r\n            ?.delayChildren\r\n        : undefined;\r\n\r\n    const computedVariants = {\r\n        container: createVariantsWithTransition(\r\n            variants?.container || baseVariants.container,\r\n            {\r\n                staggerChildren: customStagger ?? stagger,\r\n                delayChildren: customDelay ?? delay,\r\n                ...containerTransition,\r\n                exit: {\r\n                    staggerChildren: customStagger ?? stagger,\r\n                    staggerDirection: -1,\r\n                },\r\n            }\r\n        ),\r\n        item: createVariantsWithTransition(variants?.item || baseVariants.item, {\r\n            duration: baseDuration,\r\n            ...segmentTransition,\r\n        }),\r\n    };\r\n\r\n    return (\r\n        <AnimatePresence mode=\"popLayout\">\r\n            {trigger && (\r\n                <MotionTag\r\n                    initial=\"hidden\"\r\n                    animate=\"visible\"\r\n                    exit=\"exit\"\r\n                    variants={computedVariants.container}\r\n                    className={className}\r\n                    onAnimationComplete={onAnimationComplete}\r\n                    onAnimationStart={onAnimationStart}\r\n                    style={style}\r\n                >\r\n                    {per !== \"line\" ? <span className=\"sr-only\">{children}</span> : null}\r\n                    {segments.map((segment, index) => (\r\n                        <AnimationComponent\r\n                            key={`${per}-${index}-${segment}`}\r\n                            segment={segment}\r\n                            variants={computedVariants.item}\r\n                            per={per}\r\n                            segmentWrapperClassName={segmentWrapperClassName}\r\n                        />\r\n                    ))}\r\n                </MotionTag>\r\n            )}\r\n        </AnimatePresence>\r\n    );\r\n}\r\n",
      "type": "registry:component",
      "target": "components/text-effect.tsx"
    },
    {
      "path": "src/components/ui/animated-group.tsx",
      "content": "// Component From Motion Primitives\r\n\r\n\"use client\";\r\nimport { ReactNode } from \"react\";\r\nimport { motion, Variants, HTMLMotionProps } from \"motion/react\";\r\nimport React from \"react\";\r\n\r\nexport type PresetType =\r\n  | \"fade\"\r\n  | \"slide\"\r\n  | \"scale\"\r\n  | \"blur\"\r\n  | \"blur-slide\"\r\n  | \"zoom\"\r\n  | \"flip\"\r\n  | \"bounce\"\r\n  | \"rotate\"\r\n  | \"swing\";\r\n\r\nexport type AnimatedGroupProps = {\r\n  children: ReactNode;\r\n  className?: string;\r\n  variants?: {\r\n    container?: Variants;\r\n    item?: Variants;\r\n  };\r\n  preset?: PresetType;\r\n  as?: React.ElementType;\r\n  asChild?: React.ElementType;\r\n};\r\n\r\nconst defaultContainerVariants: Variants = {\r\n  visible: {\r\n    transition: {\r\n      staggerChildren: 0.1,\r\n    },\r\n  },\r\n};\r\n\r\nconst defaultItemVariants: Variants = {\r\n  hidden: { opacity: 0 },\r\n  visible: { opacity: 1 },\r\n};\r\n\r\nconst presetVariants: Record<PresetType, Variants> = {\r\n  fade: {},\r\n  slide: {\r\n    hidden: { y: 20 },\r\n    visible: { y: 0 },\r\n  },\r\n  scale: {\r\n    hidden: { scale: 0.8 },\r\n    visible: { scale: 1 },\r\n  },\r\n  blur: {\r\n    hidden: { filter: \"blur(4px)\" },\r\n    visible: { filter: \"blur(0px)\" },\r\n  },\r\n  \"blur-slide\": {\r\n    hidden: { filter: \"blur(4px)\", y: 20 },\r\n    visible: { filter: \"blur(0px)\", y: 0 },\r\n  },\r\n  zoom: {\r\n    hidden: { scale: 0.5 },\r\n    visible: {\r\n      scale: 1,\r\n      transition: { type: \"spring\", stiffness: 300, damping: 20 },\r\n    },\r\n  },\r\n  flip: {\r\n    hidden: { rotateX: -90 },\r\n    visible: {\r\n      rotateX: 0,\r\n      transition: { type: \"spring\", stiffness: 300, damping: 20 },\r\n    },\r\n  },\r\n  bounce: {\r\n    hidden: { y: -50 },\r\n    visible: {\r\n      y: 0,\r\n      transition: { type: \"spring\", stiffness: 400, damping: 10 },\r\n    },\r\n  },\r\n  rotate: {\r\n    hidden: { rotate: -180 },\r\n    visible: {\r\n      rotate: 0,\r\n      transition: { type: \"spring\", stiffness: 200, damping: 15 },\r\n    },\r\n  },\r\n  swing: {\r\n    hidden: { rotate: -10 },\r\n    visible: {\r\n      rotate: 0,\r\n      transition: { type: \"spring\", stiffness: 300, damping: 8 },\r\n    },\r\n  },\r\n};\r\n\r\nconst mergeVariants = (\r\n  defaultVariants: Variants,\r\n  customVariants: Partial<Variants> = {},\r\n): Variants => {\r\n  return {\r\n    hidden: {\r\n      ...defaultVariants.hidden,\r\n      ...customVariants.hidden,\r\n    },\r\n    visible: {\r\n      ...defaultVariants.visible,\r\n      ...customVariants.visible,\r\n    },\r\n  };\r\n};\r\n\r\nfunction AnimatedGroup({\r\n  children,\r\n  className,\r\n  variants,\r\n  preset = \"fade\",\r\n  as = \"div\",\r\n  asChild = \"div\",\r\n}: AnimatedGroupProps) {\r\n  const MotionContainer = motion.div;\r\n  const MotionChild = motion.div;\r\n\r\n  const presetVariant = preset ? presetVariants[preset] : {};\r\n  const itemVariants = variants?.item\r\n    ? mergeVariants(defaultItemVariants, variants.item)\r\n    : mergeVariants(defaultItemVariants, presetVariant);\r\n\r\n  const containerVariants = variants?.container || defaultContainerVariants;\r\n\r\n  return (\r\n    <MotionContainer\r\n      initial=\"hidden\"\r\n      animate=\"visible\"\r\n      variants={containerVariants}\r\n      className={className}\r\n    >\r\n      {React.Children.map(children, (child, index) => (\r\n        <MotionChild key={index} variants={itemVariants}>\r\n          {child}\r\n        </MotionChild>\r\n      ))}\r\n    </MotionContainer>\r\n  );\r\n}\r\n\r\nexport { AnimatedGroup };\r\n",
      "type": "registry:ui",
      "target": "components/animated-group.tsx"
    }
  ],
  "type": "registry:block"
}