|
| 1 | +import React from 'react'; |
| 2 | +import { motion } from 'framer-motion'; |
| 3 | +import { ArrowSquareOut } from '@phosphor-icons/react'; |
| 4 | +import GenerativeArt from './GenerativeArt'; |
| 5 | + |
| 6 | +const TransmissionTile = ({ item, categoryKey, onClick }) => { |
| 7 | + const getCategoryTheme = (key) => { |
| 8 | + switch (key) { |
| 9 | + case 'friends': return { color: '#10b981', bg: 'rgba(16, 185, 129, 0.1)', badge: 'Signal' }; |
| 10 | + case 'books': return { color: '#06b6d4', bg: 'rgba(6, 182, 212, 0.1)', badge: 'Archive' }; |
| 11 | + default: return { color: '#f59e0b', bg: 'rgba(245, 158, 11, 0.1)', badge: 'Node' }; |
| 12 | + } |
| 13 | + }; |
| 14 | + |
| 15 | + const theme = getCategoryTheme(categoryKey); |
| 16 | + const title = item.title; |
| 17 | + const subTitle = item.description || (item.author ? `By ${item.author}` : ''); |
| 18 | + |
| 19 | + const handleClick = (e) => { |
| 20 | + e.preventDefault(); |
| 21 | + onClick(item); |
| 22 | + }; |
| 23 | + |
| 24 | + return ( |
| 25 | + <motion.div |
| 26 | + whileHover={{ y: -10 }} |
| 27 | + className="group relative flex flex-col overflow-hidden rounded-sm bg-[#0c0a09] border border-white/10 h-full transition-all duration-500 hover:border-emerald-500/50 hover:shadow-[0_0_30px_rgba(16,185,129,0.1)]" |
| 28 | + > |
| 29 | + {/* Subtle Brown Overlay */} |
| 30 | + <div className="absolute inset-0 bg-[#443627] opacity-[0.03] pointer-events-none group-hover:opacity-[0.05] transition-opacity" /> |
| 31 | + |
| 32 | + {/* Corner Accents */} |
| 33 | + <div className="absolute top-0 right-0 w-4 h-4 border-t border-r border-white/20 group-hover:border-emerald-500 transition-colors z-20" /> |
| 34 | + <div className="absolute bottom-0 left-0 w-4 h-4 border-b border-l border-white/20 group-hover:border-emerald-500 transition-colors z-20" /> |
| 35 | + |
| 36 | + <button |
| 37 | + onClick={handleClick} |
| 38 | + className="flex flex-col h-full text-left relative z-10" |
| 39 | + > |
| 40 | + {/* Visual Header */} |
| 41 | + <div className="relative h-48 w-full overflow-hidden border-b border-white/5"> |
| 42 | + <GenerativeArt |
| 43 | + seed={"2"+title+"[]"} |
| 44 | + className="w-full h-full opacity-40 transition-transform duration-1000 ease-out group-hover:scale-125 group-hover:opacity-60 sepia-[0.2]" |
| 45 | + /> |
| 46 | + <div className="absolute inset-0 bg-gradient-to-t from-[#0c0a09] via-[#0c0a09]/20 to-transparent" /> |
| 47 | + |
| 48 | + {/* CSS Scanline Overlay on hover */} |
| 49 | + <div className="absolute inset-0 opacity-0 group-hover:opacity-10 pointer-events-none transition-opacity bg-[linear-gradient(rgba(18,16,16,0)_50%,rgba(0,0,0,0.25)_50%),linear-gradient(90deg,rgba(255,0,0,0.06),rgba(0,255,0,0.02),rgba(0,0,255,0.06))] bg-[length:100%_2px,3px_100%]" /> |
| 50 | + |
| 51 | + <div className="absolute bottom-4 left-6 flex items-center gap-3"> |
| 52 | + <span |
| 53 | + className="px-3 py-1 text-[10px] font-mono font-bold uppercase tracking-widest border rounded-sm transition-all duration-300 text-gray-300" |
| 54 | + style={{ |
| 55 | + borderColor: theme.color, |
| 56 | + backgroundColor: theme.bg, |
| 57 | + }} |
| 58 | + > |
| 59 | + {theme.badge} |
| 60 | + </span> |
| 61 | + </div> |
| 62 | + </div> |
| 63 | + |
| 64 | + {/* Content */} |
| 65 | + <div className="flex flex-col flex-grow p-8 relative bg-inherit"> |
| 66 | + <div className="absolute top-0 right-0 p-4 font-mono text-[10px] text-white/5 uppercase select-none tracking-widest"> |
| 67 | + {categoryKey} |
| 68 | + </div> |
| 69 | + |
| 70 | + <h3 className="text-3xl font-normal font-playfairDisplay text-white mb-4 group-hover:text-emerald-400 transition-colors line-clamp-2 leading-tight tracking-tighter"> |
| 71 | + {title} |
| 72 | + </h3> |
| 73 | + |
| 74 | + <p className="text-base text-gray-400 font-arvo line-clamp-3 mb-8 leading-relaxed opacity-60 group-hover:opacity-100 transition-opacity"> |
| 75 | + {subTitle} |
| 76 | + </p> |
| 77 | + |
| 78 | + <div className="mt-auto pt-6 flex items-center justify-between border-t border-white/5 group-hover:border-emerald-500/20 transition-colors"> |
| 79 | + <div className="flex items-center gap-2"> |
| 80 | + <div className="w-2 h-2 rounded-full bg-emerald-500 animate-pulse" /> |
| 81 | + <span className="text-[10px] font-mono font-bold uppercase tracking-[0.3em] text-gray-500 group-hover:text-white transition-colors"> |
| 82 | + Access Intel |
| 83 | + </span> |
| 84 | + </div> |
| 85 | + <ArrowSquareOut |
| 86 | + weight="bold" |
| 87 | + size={18} |
| 88 | + className="text-emerald-500 transform -translate-x-2 opacity-0 transition-all duration-300 group-hover:translate-x-0 group-hover:opacity-100" |
| 89 | + /> |
| 90 | + </div> |
| 91 | + </div> |
| 92 | + </button> |
| 93 | + </motion.div> |
| 94 | + ); |
| 95 | +}; |
| 96 | + |
| 97 | +export default TransmissionTile; |
0 commit comments