import { motion } from "motion/react" import useScreenSize from "@/hooks/use-screen-size" import Gravity, { MatterBody, } from "@/fancy/components/physics/cursor-attractor-and-gravity" export default function Preview() { const screenSize = useScreenSize() const words = [ "we", "analyze", { text: "millions", highlight: true }, { text: "of", highlight: true }, { text: "data", highlight: true }, { text: "points", highlight: true }, "per", "second", "to", "provide", "you", "with", "the", "most", "accurate", "insights.", ] return (
{[...Array(150)].map((_, i) => { // Adjust max size based on screen size const maxSize = screenSize.lessThan("sm") ? 20 : screenSize.lessThan("md") ? 30 : 40 const size = Math.max( screenSize.lessThan("sm") ? 10 : 20, Math.random() * maxSize ) return (
) })} {words.map((word, index) => { const text = typeof word === "string" ? word : word.text const highlight = typeof word === "object" && word.highlight return ( {text} ) })}
) }