Spaces:
Sleeping
Sleeping
Download src/components/HomeView.tsx from Musabek/NOVAESPORT: direct link, hf CLI and curl.
- Browser
- Download file 29.7 kB
-
https://huggingface.co/spaces/Musabek/NOVAESPORT/resolve/main/src/components/HomeView.tsx
- Command line
-
hf download hf://spaces/Musabek/NOVAESPORT/src/components/HomeView.tsx
-
curl -L -o HomeView.tsx https://huggingface.co/spaces/Musabek/NOVAESPORT/resolve/main/src/components/HomeView.tsx
29.7 kB
| import React, { useState } from 'react'; | |
| import { Tournament, Game, LiveMatch, NewsArticle } from '../types'; | |
| import { Trophy, Calendar, Users, Gamepad2, ArrowRight, Sparkles, Volume2, ShieldAlert, X } from 'lucide-react'; | |
| import { TRANSLATIONS, Language } from '../translations'; | |
| import { motion } from 'motion/react'; | |
| import { PrizePoolBadge } from './PrizePoolBadge'; | |
| import { TournamentCalendar } from './TournamentCalendar'; | |
| interface HomeViewProps { | |
| tournaments: Tournament[]; | |
| games: Game[]; | |
| liveMatches: LiveMatch[]; | |
| news: NewsArticle[]; | |
| setCurrentView: (view: string) => void; | |
| onSelectTournament: (id: string) => void; | |
| currentLanguage: Language; | |
| } | |
| export const HomeView: React.FC<HomeViewProps> = ({ | |
| tournaments, | |
| games, | |
| liveMatches, | |
| news, | |
| setCurrentView, | |
| onSelectTournament, | |
| currentLanguage, | |
| }) => { | |
| const [activeSlide, setActiveSlide] = useState(0); | |
| const [selectedArticle, setSelectedArticle] = useState<NewsArticle | null>(null); | |
| const t = TRANSLATIONS[currentLanguage] || TRANSLATIONS['EN']; | |
| // Filter tournaments for upcoming slider | |
| const keyTournaments = tournaments.filter((t) => t.status === 'upcoming'); | |
| const ongoingTournaments = tournaments.filter((t) => t.status === 'ongoing'); | |
| // Multi-language stats labels mapper | |
| const getStatsLabel = (labelKey: string) => { | |
| const statsStrings: Record<Language, Record<string, string>> = { | |
| EN: { | |
| active: 'Active Gladiators', | |
| prizes: 'Championship Prize Pools', | |
| rooms: 'Live Battle Rooms', | |
| hostings: 'Successfully Hosted' | |
| }, | |
| UZ: { | |
| active: 'Faol Gladiatorlar', | |
| prizes: 'Chempionat Mukofot Jamgʻarmalari', | |
| rooms: 'Jonli Jang Xonalari', | |
| hostings: 'Muvaffaqiyatli Oʻtkazilgan' | |
| }, | |
| RU: { | |
| active: 'Активные Гладиаторы', | |
| prizes: 'Призовые Фонды Чемпионатов', | |
| rooms: 'Игровые Комнаты Онлайн', | |
| hostings: 'Успешно Проведено' | |
| } | |
| }; | |
| return statsStrings[currentLanguage]?.[labelKey] || statsStrings['EN'][labelKey]; | |
| }; | |
| const stats = [ | |
| { label: getStatsLabel('active'), value: '142,850', icon: <Users className="w-5 h-5 text-cyan-400" /> }, | |
| { label: getStatsLabel('prizes'), value: '$840,000+', icon: <Trophy className="w-5 h-5 text-yellow-400" /> }, | |
| { label: getStatsLabel('rooms'), value: '42 Matches', icon: <Gamepad2 className="w-5 h-5 text-purple-400" /> }, | |
| { label: getStatsLabel('hostings'), value: '1,280+', icon: <Sparkles className="w-5 h-5 text-emerald-400" /> }, | |
| ]; | |
| // Local helper UI phrases | |
| const localUi = { | |
| EN: { | |
| seasonAnnounce: 'CYBER ARENA SEASON 4 REGISTRATION OPEN', | |
| liveMatchStation: 'LIVE MATCH STATION', | |
| vs: 'V / S', | |
| rank: 'Standings rank', | |
| watchStream: 'Watch Stream Now', | |
| allTourneys: 'All Tourneys', | |
| liveStreamDeck: 'Live Stream Deck', | |
| liveSim: 'LIVE SIM', | |
| tuneStream: 'Tune into stream channel', | |
| combatDisciplines: 'Active Combat Disciplines', | |
| pressCenter: 'Arena Press Center', | |
| pressSub: 'Official platform statements, roster exchanges, patch updates.', | |
| articleViews: 'VIEWS', | |
| readArticle: 'Read article' | |
| }, | |
| UZ: { | |
| seasonAnnounce: 'KIBER ARENA 4-MAVSUM RO‘YXATDAN O‘TISH OCHIQ', | |
| liveMatchStation: 'JONLI MATCH STANSIYASI', | |
| vs: 'V / S', | |
| rank: 'Guruh reytingi', | |
| watchStream: 'Hozir tomosha qilish', | |
| allTourneys: 'Barcha turnirlar', | |
| liveStreamDeck: 'Jonli o‘yinlar stoli', | |
| liveSim: 'JONLI SIM', | |
| tuneStream: 'Translyatsiyani ko‘rish', | |
| combatDisciplines: 'Faol kiber yo‘nalishlar', | |
| pressCenter: 'Arena matbuot markazi', | |
| pressSub: 'Rasmiy bayonotlar, tarkib almashinuvi va yangilanishlar.', | |
| articleViews: 'KO‘RILDI', | |
| readArticle: 'Maqolani o‘qish' | |
| }, | |
| RU: { | |
| seasonAnnounce: 'РЕГИСТРАЦИЯ НА 4 СЕЗОН КИБЕРАРЕНЫ ОТКРЫТА', | |
| liveMatchStation: 'СТАНЦИЯ ЖИВЫХ МАТЧЕЙ', | |
| vs: 'В / С', | |
| rank: 'Ранг в таблице', | |
| watchStream: 'Смотреть трансляцию', | |
| allTourneys: 'Все турниры', | |
| liveStreamDeck: 'Панель стримов', | |
| liveSim: 'ТРАНСЛЯЦИЯ', | |
| tuneStream: 'Подключиться к стриму', | |
| combatDisciplines: 'Активные дисциплины', | |
| pressCenter: 'Пресс-центр арены', | |
| pressSub: 'Официальные заявления платформы, патчи и трансферы.', | |
| articleViews: 'ПРОСМОТРЫ', | |
| readArticle: 'Читать статью' | |
| } | |
| }; | |
| const ui = localUi[currentLanguage] || localUi['EN']; | |
| return ( | |
| <div className="space-y-16 animate-in fade-in duration-300 font-sans" id="home-dashboard-view"> | |
| {/* 1. Cyber Esports Hero Banner */} | |
| <section className="relative overflow-hidden min-h-[500px] md:min-h-[600px] flex items-center bg-transparent px-4 md:px-8 border-b border-white/5"> | |
| {/* Animated ambient backdrop grids and spotlights */} | |
| <div className="absolute inset-0 bg-[radial-gradient(ellipse_at_top,_var(--tw-gradient-stops))] from-cyan-950/10 via-[#020205] to-[#020205] z-0 pointer-events-none" /> | |
| <div className="absolute top-1/4 right-[15%] w-80 h-80 bg-cyan-500/10 rounded-full blur-3xl pointer-events-none animate-pulse" /> | |
| <div className="absolute bottom-1/4 left-[15%] w-80 h-80 bg-purple-600/10 rounded-full blur-3xl pointer-events-none" /> | |
| <div className="max-w-7xl mx-auto grid grid-cols-1 lg:grid-cols-12 gap-8 items-center relative z-10 w-full pt-10"> | |
| <div className="lg:col-span-7 space-y-6 text-left"> | |
| <div className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-white/5 border border-white/10 text-xs font-bold font-mono text-cyan-400 tracking-wider uppercase animate-pulse"> | |
| <span className="w-1.5 h-1.5 rounded-full bg-cyan-400" /> | |
| {ui.seasonAnnounce} | |
| </div> | |
| <h1 className="text-4xl sm:text-5xl md:text-6xl font-black text-white uppercase tracking-tight leading-none font-mono"> | |
| {t.heroTitle} | |
| </h1> | |
| <p className="text-slate-300 text-sm md:text-base leading-relaxed max-w-xl font-sans"> | |
| {t.heroSub} | |
| </p> | |
| <div className="flex flex-col sm:flex-row gap-4 pt-2"> | |
| <button | |
| onClick={() => setCurrentView('register')} | |
| className="px-8 py-4 bg-gradient-to-r from-cyan-500 to-blue-600 hover:from-cyan-400 hover:to-blue-500 text-white font-extrabold text-xs tracking-widest uppercase rounded-xl border border-white/10 shadow-lg shadow-cyan-500/10 active:scale-95 transition-all text-center cursor-pointer" | |
| > | |
| {t.registerNow} | |
| </button> | |
| <button | |
| onClick={() => setCurrentView('results')} | |
| className="px-8 py-4 bg-white/5 border border-white/10 text-white hover:bg-white/10 text-xs font-extrabold tracking-widest uppercase rounded-xl active:scale-95 transition-all text-center cursor-pointer backdrop-blur-sm" | |
| > | |
| {t.viewLiveBrackets} | |
| </button> | |
| </div> | |
| </div> | |
| {/* Hero Premium Side Graphic/Card */} | |
| <div className="lg:col-span-5 hidden lg:block select-none relative"> | |
| <div className="absolute -inset-1 rounded-2xl bg-gradient-to-r from-cyan-500 to-purple-600 blur-xl opacity-20 animate-pulse" /> | |
| <div className="relative bg-white/5 border border-white/10 rounded-2xl p-6 shadow-2xl backdrop-blur-md"> | |
| <div className="flex justify-between items-center mb-6"> | |
| <span className="text-[10px] bg-white/5 border border-white/10 text-cyan-400 font-bold font-mono px-2.5 py-1 rounded">{ui.liveMatchStation}</span> | |
| <span className="w-2.5 h-2.5 rounded-full bg-red-500 animate-ping" /> | |
| </div> | |
| {liveMatches.length > 0 && ( | |
| <div className="space-y-4"> | |
| <div className="flex justify-between items-center text-center"> | |
| <div className="flex-1 space-y-1 flex flex-col items-center"> | |
| <div className="w-10 h-10 rounded-lg bg-black/40 border border-white/10 flex items-center justify-center overflow-hidden"> | |
| {liveMatches[0].teamA?.logo && (liveMatches[0].teamA.logo.startsWith('data:') || liveMatches[0].teamA.logo.startsWith('http')) ? ( | |
| <img src={liveMatches[0].teamA.logo} className="w-full h-full object-contain" alt="" referrerPolicy="no-referrer" /> | |
| ) : ( | |
| <span className="text-xl">{liveMatches[0].teamA?.logo || "⚔️"}</span> | |
| )} | |
| </div> | |
| <h4 className="text-xs font-bold text-white uppercase">{liveMatches[0].teamA?.name || "Team A"}</h4> | |
| <span className="text-xs text-slate-500">{ui.rank}: 1</span> | |
| </div> | |
| <div className="px-4 text-center"> | |
| <span className="text-xs text-red-400 font-mono font-bold block bg-white/5 border border-white/10 py-1 px-2.5 rounded mb-2 uppercase tracking-wide"> | |
| {ui.vs} | |
| </span> | |
| <span className="text-lg font-mono font-bold text-white"> | |
| {liveMatches[0].teamA?.score ?? 0} : {liveMatches[0].teamB?.score ?? 0} | |
| </span> | |
| </div> | |
| <div className="flex-1 space-y-1 flex flex-col items-center"> | |
| <div className="w-10 h-10 rounded-lg bg-black/40 border border-white/10 flex items-center justify-center overflow-hidden"> | |
| {liveMatches[0].teamB?.logo && (liveMatches[0].teamB.logo.startsWith('data:') || liveMatches[0].teamB.logo.startsWith('http')) ? ( | |
| <img src={liveMatches[0].teamB.logo} className="w-full h-full object-contain" alt="" referrerPolicy="no-referrer" /> | |
| ) : ( | |
| <span className="text-xl">{liveMatches[0].teamB?.logo || "🛡️"}</span> | |
| )} | |
| </div> | |
| <h4 className="text-xs font-bold text-white uppercase">{liveMatches[0].teamB?.name || "Team B"}</h4> | |
| <span className="text-xs text-slate-500">{ui.rank}: 2</span> | |
| </div> | |
| </div> | |
| <div className="border-t border-white/10 pt-4 text-center"> | |
| <p className="text-[11px] text-slate-400 font-mono"> | |
| Current Cup: <span className="text-cyan-400 font-bold">{liveMatches[0].tournamentTitle || "Tournament"}</span> | |
| </p> | |
| <button | |
| onClick={() => { | |
| const url = liveMatches[0].streamUrl; | |
| if (url) { | |
| window.open(url, '_blank', 'noopener,noreferrer'); | |
| } else { | |
| setCurrentView('results'); | |
| } | |
| }} | |
| className="text-xs mt-3 text-cyan-400 hover:text-cyan-300 transition-colors uppercase font-bold tracking-widest inline-flex items-center gap-1 cursor-pointer" | |
| > | |
| {ui.watchStream} <ArrowRight className="w-3 h-3" /> | |
| </button> | |
| </div> | |
| </div> | |
| )} | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| {/* 2. Bento Statistics Row */} | |
| <section className="max-w-7xl mx-auto px-4"> | |
| <div className="grid grid-cols-2 lg:grid-cols-4 gap-4 md:gap-6"> | |
| {stats.map((st, idx) => ( | |
| <div | |
| key={idx} | |
| className="bg-white/5 border border-white/10 p-5 rounded-2xl flex items-center justify-between shadow-lg relative group overflow-hidden backdrop-blur-sm" | |
| > | |
| <div className="absolute top-0 left-0 w-2 h-full bg-gradient-to-b from-cyan-400/20 to-transparent opacity-0 group-hover:opacity-100 transition-opacity" /> | |
| <div className="space-y-1"> | |
| <span className="text-[10px] text-slate-400 uppercase tracking-widest font-mono block"> | |
| {st.label} | |
| </span> | |
| <span className="text-lg md:text-2xl font-black text-white font-mono block"> | |
| {st.value} | |
| </span> | |
| </div> | |
| <div className="w-10 h-10 rounded-xl bg-white/5 border border-white/10 flex items-center justify-center"> | |
| {st.icon} | |
| </div> | |
| </div> | |
| ))} | |
| </div> | |
| </section> | |
| {/* 3. Featured Tournaments Row Slider slider */} | |
| <section className="max-w-7xl mx-auto px-4 space-y-6"> | |
| <div className="flex justify-between items-end"> | |
| <div> | |
| <h2 className="text-xl md:text-2xl font-black text-white uppercase tracking-wider font-mono"> | |
| ★ {t.activeChampionships} | |
| </h2> | |
| <p className="text-slate-400 text-xs mt-1"> | |
| {t.activeChampionshipsSub} | |
| </p> | |
| </div> | |
| <button | |
| onClick={() => setCurrentView('register')} | |
| className="text-xs font-bold text-cyan-400 hover:text-cyan-300 uppercase tracking-widest inline-flex items-center gap-1.5 cursor-pointer border border-white/10 px-3.5 py-1.5 bg-white/5 hover:bg-white/10 rounded-lg transition-colors" | |
| > | |
| {ui.allTourneys} <ArrowRight className="w-3.5 h-3.5" /> | |
| </button> | |
| </div> | |
| <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"> | |
| {keyTournaments.slice(0, 3).map((tour) => ( | |
| <motion.div | |
| key={tour.id} | |
| onClick={() => { | |
| onSelectTournament(tour.id); | |
| setCurrentView('register'); | |
| }} | |
| whileHover={{ | |
| y: -6, | |
| scale: 1.015, | |
| boxShadow: "0 20px 25px -5px rgba(6, 182, 212, 0.1), 0 8px 10px -6px rgba(6, 182, 212, 0.1)" | |
| }} | |
| whileTap={{ scale: 0.985 }} | |
| transition={{ type: "spring", stiffness: 350, damping: 25 }} | |
| className="bg-white/5 border border-white/10 rounded-2xl overflow-hidden hover:border-cyan-500/30 transition-colors text-left flex flex-col justify-between shadow-md relative group cursor-pointer backdrop-blur-sm" | |
| > | |
| <div className="absolute top-3 right-3 z-10"> | |
| <span className="bg-[#020205]/80 border border-white/10 backdrop-blur-md text-cyan-400 text-[10px] font-mono uppercase px-2.5 py-1 rounded-md font-bold block"> | |
| {tour.entryFee} {t.entryFeeLabel.toUpperCase()} | |
| </span> | |
| </div> | |
| {/* Cover */} | |
| <div className="relative h-44 overflow-hidden bg-slate-950"> | |
| <img | |
| src={tour.coverImage} | |
| alt={tour.title} | |
| referrerPolicy="no-referrer" | |
| className="w-full h-full object-cover opacity-80 group-hover:scale-105 transition-transform duration-300" | |
| /> | |
| <div className="absolute inset-0 bg-gradient-to-t from-[#020205] via-transparent to-transparent" /> | |
| <div className="absolute bottom-3 left-4"> | |
| <span className="bg-cyan-500/20 text-white text-[9px] uppercase font-black px-2 py-0.5 rounded tracking-widest"> | |
| {tour.gameTitle} | |
| </span> | |
| </div> | |
| </div> | |
| {/* Details text */} | |
| <div className="p-4 flex-1 flex flex-col justify-between space-y-4"> | |
| <div className="space-y-3"> | |
| <h3 className="text-sm font-bold text-white tracking-wide leading-snug uppercase font-mono truncate"> | |
| {tour.title} | |
| </h3> | |
| {/* Dynamic Prize Pool Component */} | |
| <PrizePoolBadge | |
| prizePool={tour.prizePool} | |
| prizeDistribution={tour.prizeDistribution} | |
| currentLanguage={currentLanguage} | |
| /> | |
| <div className="flex items-center justify-between text-[11px] text-slate-400 font-mono pt-1"> | |
| <span className="flex items-center gap-1"> | |
| <Calendar className="w-3.5 h-3.5 text-slate-500" /> {tour.startDate} | |
| </span> | |
| <span className="text-[10px] text-slate-400"> | |
| SQUADS:{' '} | |
| <span className="text-cyan-400 font-bold font-mono"> | |
| {tour.slotsFilled}/{tour.slotsTotal} | |
| </span> | |
| </span> | |
| </div> | |
| </div> | |
| <div className="border-t border-white/10 pt-3 flex items-center justify-between"> | |
| <div className="text-[10px] font-mono text-slate-500 uppercase"> | |
| REGISTRATION STATUS: <span className="text-emerald-400 font-bold">OPEN</span> | |
| </div> | |
| <span className="text-[10px] text-cyan-400 group-hover:text-cyan-300 font-bold uppercase tracking-widest flex items-center gap-1"> | |
| {t.quickRegister} <ArrowRight className="w-3.5 h-3.5" /> | |
| </span> | |
| </div> | |
| </div> | |
| </motion.div> | |
| ))} | |
| </div> | |
| </section> | |
| {/* Tournament Calendar Section */} | |
| <section className="max-w-7xl mx-auto px-4"> | |
| <TournamentCalendar | |
| tournaments={tournaments} | |
| onSelectTournament={onSelectTournament} | |
| setCurrentView={setCurrentView} | |
| currentLanguage={currentLanguage} | |
| /> | |
| </section> | |
| {/* 4. Upcoming & Live Timelines Section details */} | |
| <section className="max-w-7xl mx-auto px-4 grid grid-cols-1 lg:grid-cols-12 gap-8"> | |
| {/* Left Side: Live Stream Center Matches */} | |
| <div className="lg:col-span-4 space-y-4"> | |
| <div className="border-b border-rose-500/10 pb-2"> | |
| <h3 className="text-md font-bold text-white uppercase tracking-wider font-mono flex items-center gap-2"> | |
| <span className="w-2.5 h-2.5 bg-rose-500 rounded-full animate-ping" /> | |
| {ui.liveStreamDeck} | |
| </h3> | |
| </div> | |
| <div className="space-y-4"> | |
| {liveMatches.filter(m => m.status === 'live').map((mat) => ( | |
| <div key={mat.id} className="bg-white/5 border border-white/10 rounded-xl p-4 space-y-3 relative overflow-hidden backdrop-blur-sm"> | |
| <div className="absolute top-0 right-0 py-0.5 px-2 bg-rose-950/40 text-rose-400 border-l border-b border-white/10 text-[9px] font-bold uppercase tracking-widest rounded-bl"> | |
| {ui.liveSim} | |
| </div> | |
| <span className="text-[9px] text-cyan-400 uppercase tracking-widest font-mono font-bold block"> | |
| {mat.tournamentTitle || "Tournament"} | |
| </span> | |
| <div className="flex items-center justify-between bg-white/5 p-2.5 rounded-lg border border-white/10"> | |
| <div className="flex items-center gap-2"> | |
| <div className="w-6 h-6 rounded bg-black/40 border border-white/10 flex items-center justify-center overflow-hidden shrink-0"> | |
| {mat.teamA?.logo && (mat.teamA.logo.startsWith('data:') || mat.teamA.logo.startsWith('http')) ? ( | |
| <img src={mat.teamA.logo} className="w-full h-full object-contain" alt="" referrerPolicy="no-referrer" /> | |
| ) : ( | |
| <span className="text-xs">{mat.teamA?.logo || "⚔️"}</span> | |
| )} | |
| </div> | |
| <span className="text-xs font-bold text-slate-200 truncate">{mat.teamA?.name || "Team A"}</span> | |
| </div> | |
| <span className="text-xs font-mono font-bold text-emerald-400 border border-white/10 px-2 bg-white/5 rounded"> | |
| {mat.teamA?.score ?? 0} | |
| </span> | |
| </div> | |
| <div className="flex items-center justify-between bg-white/5 p-2.5 rounded-lg border border-white/10"> | |
| <div className="flex items-center gap-2"> | |
| <div className="w-6 h-6 rounded bg-black/40 border border-white/10 flex items-center justify-center overflow-hidden shrink-0"> | |
| {mat.teamB?.logo && (mat.teamB.logo.startsWith('data:') || mat.teamB.logo.startsWith('http')) ? ( | |
| <img src={mat.teamB.logo} className="w-full h-full object-contain" alt="" referrerPolicy="no-referrer" /> | |
| ) : ( | |
| <span className="text-xs">{mat.teamB?.logo || "🛡️"}</span> | |
| )} | |
| </div> | |
| <span className="text-xs font-bold text-slate-200 truncate">{mat.teamB?.name || "Team B"}</span> | |
| </div> | |
| <span className="text-xs font-mono font-bold text-pink-400 border border-white/10 px-2 bg-white/5 rounded"> | |
| {mat.teamB?.score ?? 0} | |
| </span> | |
| </div> | |
| <button | |
| onClick={() => { | |
| const url = mat.streamUrl; | |
| if (url) { | |
| window.open(url, '_blank', 'noopener,noreferrer'); | |
| } else { | |
| setCurrentView('results'); | |
| } | |
| }} | |
| className="w-full text-center py-2 bg-rose-950/20 hover:bg-rose-950/40 border border-rose-500/20 text-rose-400 hover:text-rose-300 rounded-lg text-xs font-bold uppercase tracking-widest transition-all cursor-pointer" | |
| > | |
| {ui.tuneStream} | |
| </button> | |
| </div> | |
| ))} | |
| </div> | |
| </div> {/* Right Side: Popular games cards showcase */} | |
| <div className="lg:col-span-8 space-y-4"> | |
| <div className="border-b border-white/10 pb-2"> | |
| <h3 className="text-md font-bold text-slate-350 uppercase tracking-wider font-mono flex items-center gap-2"> | |
| ★ {ui.combatDisciplines} | |
| </h3> | |
| </div> | |
| <div className="grid grid-cols-2 md:grid-cols-4 gap-4"> | |
| {games.slice(0, 4).map((game) => ( | |
| <div | |
| key={game.id} | |
| onClick={() => setCurrentView('games')} | |
| className="bg-white/5 border border-white/10 rounded-xl overflow-hidden hover:border-cyan-500/35 transition-all cursor-pointer group relative backdrop-blur-sm" | |
| > | |
| <div className="h-28 overflow-hidden bg-[#020205] relative"> | |
| <img | |
| src={game.coverImage} | |
| alt={game.title} | |
| referrerPolicy="no-referrer" | |
| className="w-full h-full object-cover opacity-60 group-hover:scale-105 transition-transform duration-300" | |
| /> | |
| <div className="absolute inset-0 bg-gradient-to-t from-[#020205] to-transparent" /> | |
| </div> | |
| <div className="p-3 text-left"> | |
| <h4 className="text-xs font-bold text-white uppercase font-mono truncate">{game.title}</h4> | |
| <span className="text-[10px] text-slate-500">{game.genre}</span> | |
| </div> | |
| </div> | |
| ))} | |
| </div> | |
| </div> | |
| </section> | |
| {/* 5. Trending News & Blog Section details */} | |
| {news && news.length > 0 && ( | |
| <section className="max-w-7xl mx-auto px-4 space-y-6"> | |
| <div className="border-b border-white/10 pb-4"> | |
| <h2 className="text-xl md:text-2xl font-black text-white uppercase tracking-wider font-mono"> | |
| 📰 {ui.pressCenter} | |
| </h2> | |
| <p className="text-slate-400 text-xs mt-1">{ui.pressSub}</p> | |
| </div> | |
| <div className="grid grid-cols-1 md:grid-cols-3 gap-6"> | |
| {news.map((item) => ( | |
| <article | |
| key={item.id} | |
| className="bg-white/5 border border-white/10 rounded-2xl overflow-hidden hover:border-white/20 transition-all flex flex-col justify-between backdrop-blur-sm" | |
| > | |
| <div className="h-44 bg-slate-950 overflow-hidden relative"> | |
| <img | |
| src={item.image} | |
| alt={item.title} | |
| referrerPolicy="no-referrer" | |
| className="w-full h-full object-cover opacity-75" | |
| /> | |
| <div className="absolute top-3 left-3"> | |
| <span className="bg-[#020205]/95 text-purple-400 border border-white/10 text-[10px] font-bold px-2 py-0.5 rounded tracking-wide font-mono uppercase"> | |
| {item.category} | |
| </span> | |
| </div> | |
| </div> | |
| <div className="p-4 flex-1 flex flex-col justify-between space-y-4"> | |
| <div className="space-y-2"> | |
| <span className="text-[10px] text-slate-500 font-mono block">{item.publishedAt}</span> | |
| <h3 className="text-sm font-bold text-white uppercase tracking-wide leading-snug line-clamp-2"> | |
| {item.title} | |
| </h3> | |
| <p className="text-xs text-slate-400 line-clamp-3 leading-relaxed font-sans"> | |
| {item.summary} | |
| </p> | |
| </div> | |
| <div className="border-t border-white/10 pt-3 flex items-center justify-between"> | |
| <span className="text-[10px] text-slate-500"> | |
| {ui.articleViews}: <span className="font-mono">{item.views.toLocaleString()}</span> | |
| </span> | |
| <button | |
| onClick={() => { | |
| setSelectedArticle(item); | |
| }} | |
| className="text-[10px] text-cyan-400 hover:text-cyan-300 font-bold uppercase cursor-pointer" | |
| > | |
| {ui.readArticle} | |
| </button> | |
| </div> | |
| </div> | |
| </article> | |
| ))} | |
| </div> | |
| </section> | |
| )} | |
| {/* Modern News Article Modal overlay - avoids iframe popups */} | |
| {selectedArticle && ( | |
| <div | |
| className="fixed inset-0 bg-black/85 backdrop-blur-md z-50 flex items-center justify-center p-4 animate-in fade-in duration-200" | |
| onClick={() => setSelectedArticle(null)} | |
| > | |
| <div | |
| className="bg-[#0b0c14] border border-cyan-500/20 rounded-2xl p-6 w-full max-w-lg shadow-[0_0_50px_rgba(6,182,212,0.15)] relative overflow-hidden animate-in zoom-in-95 duration-200 text-left" | |
| onClick={(e) => e.stopPropagation()} | |
| > | |
| {/* Gradient border line */} | |
| <div className="absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-purple-500 via-cyan-500 to-amber-500" /> | |
| <div className="flex justify-between items-start gap-4 mb-4"> | |
| <div> | |
| <span className="text-[10px] text-purple-400 font-mono uppercase tracking-wider block mb-1"> | |
| ★ {selectedArticle.category} | |
| </span> | |
| <h3 className="text-md md:text-lg font-black text-white uppercase tracking-wide font-mono leading-tight"> | |
| {selectedArticle.title} | |
| </h3> | |
| <span className="text-[10px] text-slate-500 font-mono mt-1 block"> | |
| {selectedArticle.publishedAt} | {selectedArticle.views.toLocaleString()} views | |
| </span> | |
| </div> | |
| <button | |
| onClick={() => setSelectedArticle(null)} | |
| className="text-slate-500 hover:text-white transition-colors cursor-pointer bg-white/5 hover:bg-white/10 p-1.5 rounded-lg border border-white/5" | |
| > | |
| <X className="w-4 h-4" /> | |
| </button> | |
| </div> | |
| <div className="mt-4 py-3 border-y border-white/5 overflow-y-auto max-h-[50vh] custom-scrollbar text-xs text-slate-300 space-y-3 leading-relaxed font-sans whitespace-pre-wrap"> | |
| <p className="font-semibold text-white"> | |
| {selectedArticle.summary} | |
| </p> | |
| <p> | |
| {selectedArticle.content} | |
| </p> | |
| </div> | |
| <div className="mt-5 flex justify-end"> | |
| <button | |
| onClick={() => setSelectedArticle(null)} | |
| className="px-5 py-2 border border-white/10 hover:bg-white/5 text-slate-300 hover:text-white text-xs font-bold font-mono uppercase rounded-xl transition-all cursor-pointer" | |
| > | |
| Close Article | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| )} | |
| </div> | |
| ); | |
| }; | |