import { motion, useMotionValue, useTransform, PanInfo } from 'framer-motion'; import { Heart, X, Sparkles } from 'lucide-react'; import type { DistroCard } from '@/data/distros'; interface SwipeCardProps { card: DistroCard; isTop: boolean; onSwipe: (direction: 'left' | 'right') => void; scale?: number; zIndex: number; offsetY?: number; } export default function SwipeCard({ card, isTop, onSwipe, scale = 1, zIndex, offsetY = 0, }: SwipeCardProps) { const x = useMotionValue(0); const rotate = useTransform(x, [-300, 0, 300], [-15, 0, 15]); const likeOpacity = useTransform(x, [0, 150], [0, 1]); const nopeOpacity = useTransform(x, [-150, 0], [1, 0]); const glowIntensity = useTransform(x, [-200, 0, 200], [1, 0, 1]); const handleDragEnd = (_: MouseEvent | TouchEvent | PointerEvent, info: PanInfo) => { const threshold = 150; if (info.offset.x > threshold) { onSwipe('right'); } else if (info.offset.x < -threshold) { onSwipe('left'); } }; return ( 0 ? 500 : -500, opacity: 0, rotate: x.get() > 0 ? 20 : -20, transition: { duration: 0.3 }, }} >
{`${card.distroName}
{card.desktopEnvironment}
{isTop && ( <>
0 ? 'radial-gradient(circle at center, rgba(34, 197, 94, 0.2) 0%, transparent 70%)' : 'radial-gradient(circle at center, rgba(239, 68, 68, 0.2) 0%, transparent 70%)' }} /> )}

"{card.wittyTitle}"

{card.distroName}
Linux Distribution
{card.tags.slice(0, 3).map((tag) => ( {tag} ))}
); }