'use client'; import { motion, AnimatePresence } from 'framer-motion'; import { ReactNode } from 'react'; type FloatingGlassPanelProps = { open: boolean; clickMaskClose?: boolean; onClose?: () => void; children: ReactNode; width?: string; r_key?: string | number; panel_style?: React.CSSProperties; className?: string; }; export default function FloatingGlassPanel({ open, onClose, children, width = '320px', r_key, panel_style, clickMaskClose = true, className }: FloatingGlassPanelProps) { // 定义弹出动画 const bounceAnimation = { scale: [0.95, 1.02, 0.98, 1], rotate: [0, -1, 1, -1, 0], }; return ( {open && (
{children}
{/* 添加遮罩层,点击时关闭面板 */}
)}
); }