Files
lct2025-lonolith/Frontend/components/ui/cosmic-card.jsx
Nikolai Papin 90abe15a8f feat: compose;
feat: frontend added
2025-10-02 22:17:38 +03:00

26 lines
761 B
JavaScript

'use client';
import { motion } from 'framer-motion';
export default function CosmicCard({ children, className = '', animate = true, onClick, clickable = false }) {
const Component = animate ? motion.div : 'div';
const animationProps = animate && clickable
? {
whileHover: { scale: 1.02, y: -4 },
whileTap: { scale: 0.98 },
transition: { duration: 0.2 },
}
: {};
return (
<Component
className={`bg-gradient-to-br from-slate-900 to-slate-800 rounded-xl border border-slate-700 shadow-lg hover:shadow-blue-500/20 transition-shadow ${
clickable && onClick ? 'cursor-pointer' : ''
} ${className}`}
onClick={onClick}
{...animationProps}
>
{children}
</Component>
);
}