// axi0 Motion 0.2.0: Velocity band. Big rows of text slide sideways without end; scrolling speeds them up, turns them around and leans them.
// Generated from src/velocity-band/meta.json by motion-pack: a thin wrapper. The loader (motion.js) must be on the page once;
// it starts the effect on the element this renders. Options left out keep the effect's own defaults.
import { createElement } from "react";
import type { HTMLAttributes, ReactNode } from "react";

export interface VelocityBandProps extends HTMLAttributes<HTMLElement> {
  /** Speed at rest (default 80) */
  speed?: number;
  /** How much scrolling speeds it up (default 5) */
  boost?: number;
  /** Most lean while scrolling (default 7) */
  lean?: number;
  /** Space between copies (default 0.5) */
  gap?: number;
  /** The element to render (default "div") */
  as?: string;
  children?: ReactNode;
}

const s = (v: unknown) => (v === undefined ? undefined : String(v));

export function VelocityBand({ as = "div", speed, boost, lean, gap, ...rest }: VelocityBandProps) {
  return createElement(as, { ...rest, "data-motion": "velocity-band", "data-motion-speed": s(speed), "data-motion-boost": s(boost), "data-motion-lean": s(lean), "data-motion-gap": s(gap) });
}

export default VelocityBand;
