"use client"; import { motion } from "framer-motion"; import { useMemo } from "react"; import { cn } from "@/lib/utils"; interface SparklesCoreProps { id?: string; background?: string; minSize?: number; maxSize?: number; speed?: number; particleColor?: string; particleDensity?: number; className?: string; } const SparklesCore = ({ id, background = "transparent", minSize = 0.4, maxSize = 1, speed = 1, particleColor = "#FFFFFF", particleDensity = 500, className, }: SparklesCoreProps) => { const particles = useMemo(() => { const count = Math.min(particleDensity, 200); return Array.from({ length: count }, (_, i) => ({ id: i, x: Math.random() * 100, y: Math.random() * 100, size: minSize + Math.random() * (maxSize - minSize), duration: 2 + Math.random() * 4, delay: Math.random() * 2, })); }, [particleDensity, minSize, maxSize]); return (
{particles.map((particle) => ( ))}
); }; export { SparklesCore };