VirtualIdCard.tsx 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import React from 'react';
  2. import ShieldIcon from './icons/ShieldIcon';
  3. interface VirtualIdCardProps {
  4. name: string;
  5. avatarUrl: string;
  6. virtualId: string;
  7. totalScore: number;
  8. }
  9. const VirtualIdCard: React.FC<VirtualIdCardProps> = ({ name, avatarUrl, virtualId, totalScore }) => {
  10. return (
  11. <div className="bg-gradient-to-br from-slate-900 via-slate-800 to-sky-900 rounded-2xl shadow-2xl p-6 text-white overflow-hidden relative group">
  12. {/* Decorative Circles */}
  13. <div className="absolute -top-10 -right-10 w-40 h-40 bg-sky-500/10 rounded-full"></div>
  14. <div className="absolute -bottom-16 -left-12 w-48 h-48 bg-slate-500/10 rounded-full"></div>
  15. <div className="relative z-10 flex flex-col sm:flex-row items-center gap-6">
  16. <img
  17. src={avatarUrl}
  18. alt={name}
  19. className="w-24 h-24 rounded-full border-4 border-slate-600 shadow-lg object-cover"
  20. />
  21. <div className="text-center sm:text-left">
  22. <h1 className="text-3xl font-bold tracking-wide">{name}</h1>
  23. <p className="text-sm text-slate-400 font-mono tracking-widest mt-1">{virtualId}</p>
  24. </div>
  25. </div>
  26. {/* Holographic Security Tag */}
  27. <div
  28. className="absolute bottom-4 right-6 w-14 h-14 flex items-center justify-center z-20"
  29. aria-label="Holographic Security Seal"
  30. >
  31. <div className="absolute inset-0 rounded-full bg-slate-700/30 backdrop-blur-sm border border-white/10"></div>
  32. <div className="absolute inset-1 rounded-full border border-white/10 animate-[spin_8s_linear_infinite]"></div>
  33. <div className={`relative w-12 h-12 rounded-full flex items-center justify-center overflow-hidden ${totalScore >= 30 ? 'holographic-gleam' : ''}`}>
  34. <div className="absolute inset-0 bg-gradient-to-br from-sky-400/20 to-purple-500/20"></div>
  35. <ShieldIcon />
  36. </div>
  37. </div>
  38. </div>
  39. );
  40. };
  41. export default VirtualIdCard;