"use client"; import { motion } from "framer-motion"; export function InteractiveAuroraBackground({ children }: { children: React.ReactNode }) { return (
{/* اینجا اصل جادو اتفاق می‌افتد. یک شبه‌المان (pseudo-element) روی کل صفحه کشیده می‌شود. پس‌زمینه آن یک گرادیان شعاعی (radial-gradient) است که در موقعیت متغیرهای --x و --y قرار گرفته. این متغیرها توسط حرکت موس آپدیت می‌شوند. */}
{ const { clientX, clientY, currentTarget } = e; const { left, top, width, height } = currentTarget.getBoundingClientRect(); const xPercent = ((clientX - left) / width) * 100; const yPercent = ((clientY - top) / height) * 100; currentTarget.style.setProperty("--x", `${xPercent.toFixed(2)}%`); currentTarget.style.setProperty("--y", `${yPercent.toFixed(2)}%`); }} /> {/* خطوط گرید برای حفظ حس مهندسی */}
{/* محتوای اصلی صفحه در لایه بالاتر قرار می‌گیرد */}
{children}
); }