// axi0 Motion 0.2.0: Foil card. A collectible card tilts toward the pointer while its foil and glitter catch the light.
// Generated from src/foil-card/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 FoilCardProps extends HTMLAttributes<HTMLElement> {
  /** the largest tilt in degrees (default 14) */
  max?: number;
  /** how much the card grows while held (default 1.04) */
  scale?: number;
  /** foil strength, 0 to 1 (default 0.7) */
  foil?: number;
  /** glitter strength, 0 to 1 (default 0.8) */
  glitter?: number;
  /** The element to render (default "div") */
  as?: string;
  children?: ReactNode;
}

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

export function FoilCard({ as = "div", max, scale, foil, glitter, ...rest }: FoilCardProps) {
  return createElement(as, { ...rest, "data-motion": "foil-card", "data-motion-max": s(max), "data-motion-scale": s(scale), "data-motion-foil": s(foil), "data-motion-glitter": s(glitter) });
}

export default FoilCard;
