import React from 'react'; import { motion } from 'framer-motion'; import { Card as CardType, CardRarity } from '../types/card'; import '../styles/Card.css'; interface CardProps { card: CardType; isRevealing?: boolean; detailed?: boolean; } const CARD_INFO: Record = { 0: { name: "アイ", color: "#fff700" }, 1: { name: "夢幻", color: "#b19cd9" }, 2: { name: "光彩", color: "#ffd700" }, 3: { name: "中性子", color: "#cacfd2" }, 4: { name: "太陽", color: "#ff6b35" }, 5: { name: "夜空", color: "#1a1a2e" }, 6: { name: "雪", color: "#e3f2fd" }, 7: { name: "雷", color: "#ffd93d" }, 8: { name: "超究", color: "#6c5ce7" }, 9: { name: "剣", color: "#a8e6cf" }, 10: { name: "破壊", color: "#ff4757" }, 11: { name: "地球", color: "#4834d4" }, 12: { name: "天の川", color: "#9c88ff" }, 13: { name: "創造", color: "#00d2d3" }, 14: { name: "超新星", color: "#ff9ff3" }, 15: { name: "世界", color: "#54a0ff" }, }; export const Card: React.FC = ({ card, isRevealing = false, detailed = false }) => { const cardInfo = CARD_INFO[card.id] || { name: "Unknown", color: "#666" }; const imageUrl = `https://git.syui.ai/ai/card/raw/branch/main/img/${card.id}.webp`; const getRarityClass = () => { switch (card.status) { case CardRarity.UNIQUE: return 'card-unique'; case CardRarity.KIRA: return 'card-kira'; case CardRarity.SUPER_RARE: return 'card-super-rare'; case CardRarity.RARE: return 'card-rare'; default: return 'card-normal'; } }; if (!detailed) { // Simple view - only image and frame return (
{cardInfo.name} { (e.target as HTMLImageElement).style.display = 'none'; }} />
); } // Detailed view - all information return (
#{card.id} CP: {card.cp}
{cardInfo.name} { (e.target as HTMLImageElement).style.display = 'none'; }} />

{cardInfo.name}

{card.is_unique && (
UNIQUE
)}
{card.skill && (

{card.skill}

)}
{card.status.toUpperCase()}
); };