import { useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { Users, Tag, X, Mail, Phone, UserCheck, GraduationCap, Info, Atom, Wifi, Printer, Zap, Languages, Calculator, HeartHandshake, Rocket, Camera, Sparkles, Mic, Target, ArrowRight, RotateCcw, MessageCircle, ExternalLink, CheckCircle2, Compass, Globe, BookOpen, Heart } from 'lucide-react'; import SectionTitle from '@/components/SectionTitle/SectionTitle'; import { StaggerContainer, StaggerItem } from '@/components/AnimatedContainer/AnimatedContainer'; import AnimatedContainer from '@/components/AnimatedContainer/AnimatedContainer'; import { CLUBS_DATA } from '@/constants'; import type { Club } from '@/types'; const CLUB_CATEGORY_COLORS: Record = { Technical: '#3B82F6', Cultural: '#EC4899', Social: '#10B981', Creative: '#F59E0B', }; const CLUB_ICON_MAP: Record> = { Atom, Wifi, Printer, Zap, Languages, Calculator, HeartHandshake, Rocket, Camera, Sparkles, Mic, BookOpen, Globe, Users, }; // ─── Inline Brand SVG Icons for Feature 5 ────────────────────────────────────── const InstagramIcon = ({ className = 'w-4 h-4' }: { className?: string }) => ( ); const LinkedinIcon = ({ className = 'w-4 h-4' }: { className?: string }) => ( ); const YoutubeIcon = ({ className = 'w-4 h-4' }: { className?: string }) => ( ); // ─── Quiz Questions Data for Feature 1 (3-Question Matcher) ───────────────────── const QUIZ_QUESTIONS = [ { id: 'interest', title: '1. What topics or domains are you most interested in?', options: [ { label: '🚀 Space Tech, Astronomy & Rocketry', clubIds: ['stellar_space_tech', 'infinitus'] }, { label: '⚙️ AI Quests, Chip Design, RobochipX & STEM', clubIds: ['steam', 'wistem', 'techspark'] }, { label: '🎙️ Radio, Podcasting, Storytelling & RJing', clubIds: ['podx', 'mediastic'] }, { label: '🤝 Community Service, Village Development & NSS Drives', clubIds: ['nss', 'unnat_bharat'] }, { label: '🎭 Dance, Music, Band & Cultural Arts', clubIds: ['artist_league', 'podx'] }, { label: '🧮 Fast Calculation, PiDoku, Logic & Mathematics', clubIds: ['infinitus', 'stellar_space_tech'] }, { label: '✍️ Tamil Literature, Debates & Cultural Heritage', clubIds: ['vaarithi', 'fusion'] }, { label: '🌸 Japanese Culture, Anime, Manga & Foreign Languages', clubIds: ['nippon', 'fusion'] }, { label: '📷 Photo/Video Production & Social Media Content', clubIds: ['mediastic', 'helios', 'podx'] }, ], }, { id: 'skills', title: '2. What skills do you currently have or want to develop?', options: [ { label: '💻 Web3, AI Tools, Circuit Design & Coding Hackathons', clubIds: ['wistem', 'steam', 'techspark'] }, { label: '🌌 Space Science & Physics Problem Solving', clubIds: ['stellar_space_tech', 'infinitus'] }, { label: '🎙️ Public Speaking, Interviewing & Voice Recording', clubIds: ['podx', 'mediastic'] }, { label: '🤝 Social Work, Environmental Protection & Leadership', clubIds: ['nss', 'unnat_bharat'] }, { label: '🕺 Stage Performance, Singing, Dance & Rap', clubIds: ['artist_league'] }, { label: '📐 Analytical Thinking, Logic Puzzles & Aptitude', clubIds: ['infinitus'] }, { label: '📝 Essay Writing, Tamil/English Oratory & Literature', clubIds: ['vaarithi', 'fusion'] }, { label: '🎥 Camera Operations, Video Editing & Digital Media', clubIds: ['mediastic', 'helios'] }, ], }, { id: 'goal', title: '3. What is your main goal for joining a club at RIT?', options: [ { label: '🤖 Build hackathon projects, chip designs & STEM innovations', clubIds: ['steam', 'wistem', 'techspark'] }, { label: '🚀 Work on aerospace tech & scientific projects', clubIds: ['stellar_space_tech', 'infinitus'] }, { label: '🌟 Share inspiring stories & host campus podcasts', clubIds: ['podx', 'mediastic'] }, { label: '👥 Drive social change & serve rural communities', clubIds: ['nss', 'unnat_bharat'] }, { label: '🏆 Perform live at cultural fests & stage shows', clubIds: ['artist_league', 'vaarithi'] }, { label: '📖 Master new languages & explore world cultures', clubIds: ['nippon', 'fusion', 'vaarithi'] }, ], }, ]; export default function Events() { const [selectedClub, setSelectedClub] = useState(null); // ─── Interactive Like / Favorite System State ───────────────────────────── const [likedClubs, setLikedClubs] = useState>(() => { try { const saved = localStorage.getItem('rit_freshers_liked_clubs'); return saved ? new Set(JSON.parse(saved)) : new Set(['podx', 'stellar_space_tech']); } catch { return new Set(['podx', 'stellar_space_tech']); } }); const [likesMap, setLikesMap] = useState>(() => { const initialMap: Record = {}; CLUBS_DATA.forEach((c, idx) => { initialMap[c.id] = Math.round(c.members * 0.42) + (idx % 5) * 14 + 35; }); return initialMap; }); const toggleLike = (clubId: string) => { setLikedClubs((prev) => { const next = new Set(prev); const isCurrentlyLiked = next.has(clubId); if (isCurrentlyLiked) { next.delete(clubId); setLikesMap((l) => ({ ...l, [clubId]: Math.max(0, (l[clubId] || 1) - 1) })); } else { next.add(clubId); setLikesMap((l) => ({ ...l, [clubId]: (l[clubId] || 0) + 1 })); } try { localStorage.setItem('rit_freshers_liked_clubs', JSON.stringify(Array.from(next))); } catch {} return next; }); }; // ─── Club Matcher Quiz State (Feature 1) ───────────────────────────────── const [isQuizOpen, setIsQuizOpen] = useState(false); const [quizStep, setQuizStep] = useState(0); const [selectedAnswers, setSelectedAnswers] = useState([]); const [quizResults, setQuizResults] = useState<{ club: Club; score: number }[] | null>(null); const handleSelectOption = (optionIdx: number) => { const updated = [...selectedAnswers]; updated[quizStep] = optionIdx; setSelectedAnswers(updated); if (quizStep < QUIZ_QUESTIONS.length - 1) { setQuizStep(quizStep + 1); } else { calculateQuizResults(updated); } }; const calculateQuizResults = (answers: number[]) => { const scoreMap: Record = {}; CLUBS_DATA.forEach((c) => (scoreMap[c.id] = 0)); answers.forEach((ansIdx, qIdx) => { const option = QUIZ_QUESTIONS[qIdx].options[ansIdx]; option.clubIds.forEach((clubId, idx) => { scoreMap[clubId] = (scoreMap[clubId] || 0) + (3 - idx); }); }); const ranked = CLUBS_DATA.map((club) => ({ club, score: scoreMap[club.id] || 0, })).sort((a, b) => b.score - a.score); setQuizResults(ranked.slice(0, 3)); }; const resetQuiz = () => { setQuizStep(0); setSelectedAnswers([]); setQuizResults(null); }; return (
{/* Header */}

Student{' '} Clubs

Explore official RIT student clubs & societies, leadership details, and community links.

{/* ─── Feature 1: "Find My Ideal Club" Banner ────────────────────────── */}
{/* Background Glow */}
Interactive Club Matcher

Not sure which club to join?

Take our 3-step AI-powered Club Matcher quiz to get instant recommendations tailored to your interests, skills, and goals!

{ resetQuiz(); setIsQuizOpen(true); }} className="relative z-10 px-6 py-3.5 rounded-2xl text-white font-semibold text-sm flex items-center gap-2.5 shadow-lg shrink-0 cursor-pointer" style={{ background: 'linear-gradient(135deg, #F97316, #FB923C)', fontFamily: 'Poppins, sans-serif' }} > Find My Ideal Club
{/* Clubs Directory Section */} {(() => { const fullGridCount = Math.floor(CLUBS_DATA.length / 3) * 3; const mainGridClubs = CLUBS_DATA.slice(0, fullGridCount); const remainingClubs = CLUBS_DATA.slice(fullGridCount); const renderClubCard = (club: Club) => { const IconComponent = (club.icon && CLUB_ICON_MAP[club.icon]) || Atom; const categoryColor = CLUB_CATEGORY_COLORS[club.category] || '#F97316'; const isLiked = likedClubs.has(club.id); const likesCount = likesMap[club.id] || 0; return ( setSelectedClub(club)} className="bg-white rounded-2xl border border-[#E5E7EB] p-5 cursor-pointer hover:border-[#F97316] transition-all flex flex-col justify-between h-full group" style={{ boxShadow: '0 2px 15px -3px rgba(0,0,0,0.07)' }} >
{/* Top Row: Tech Icon / Club Logo & Interactive Heart Like Button */}
{club.logoUrl ? (
{club.name}
) : (
)} {/* Like Button & Members Count */}
{ e.stopPropagation(); toggleLike(club.id); }} className={`flex items-center gap-1 px-2.5 py-1 rounded-full text-xs font-semibold transition-all cursor-pointer border ${ isLiked ? 'bg-rose-50 border-rose-200 text-rose-600 shadow-2xs' : 'bg-slate-50 border-slate-200 text-slate-500 hover:border-rose-300 hover:text-rose-500' }`} > {likesCount}
{club.members}
{/* Club Title & Description */}

{club.name}

{club.description}

{/* Bottom Row: Category Tag & View Details Button */}
{club.category} View Details
); }; return ( {/* 3-Column Grid for Full Rows */}
{mainGridClubs.map((club) => ( {renderClubCard(club)} ))}
{/* Centered Flex Row for Remaining Clubs (WiSTEM & STEAM) */} {remainingClubs.length > 0 && (
{remainingClubs.map((club) => ( {renderClubCard(club)} ))}
)}
); })()}
{/* ─── Club Matcher Quiz Modal (Feature 1) ─────────────────────────────── */} {isQuizOpen && (
{/* Close Button */} {!quizResults ? (
{/* Quiz Progress */}
Question {quizStep + 1} of {QUIZ_QUESTIONS.length} Step {quizStep + 1} / {QUIZ_QUESTIONS.length}
{/* Question Header */}
Club Matcher Quiz

{QUIZ_QUESTIONS[quizStep].title}

{/* Options List */}
{QUIZ_QUESTIONS[quizStep].options.map((opt, idx) => ( ))}
{quizStep > 0 && ( )}
) : ( /* Results Screen */

Your Ideal Club Matches!

Based on your interests & goals, here are your top recommended RIT clubs:

{/* Top 3 Matches */}
{quizResults.map((item, i) => { const IconComponent = (item.club.icon && CLUB_ICON_MAP[item.club.icon]) || Atom; const catColor = CLUB_CATEGORY_COLORS[item.club.category] || '#F97316'; const matchPercent = i === 0 ? '98%' : i === 1 ? '91%' : '84%'; return (
{ setIsQuizOpen(false); setSelectedClub(item.club); }} className="p-4 rounded-2xl border border-slate-200 hover:border-[#F97316] bg-slate-50 hover:bg-white cursor-pointer transition-all flex items-center justify-between" >
{item.club.logoUrl ? (
{item.club.name}
) : (
)}
{item.club.name} {i === 0 && Top Match 🏆}
{item.club.category} Club • {item.club.members} members
{matchPercent} Match
); })}
)}
)} {/* ─── Club Details Modal (Featuring Feature 5: Social Link Hub) ───────── */} {selectedClub && (
{/* Close Button */} {/* Modal Header */} {(() => { const IconComponent = (selectedClub.icon && CLUB_ICON_MAP[selectedClub.icon]) || Atom; const categoryColor = CLUB_CATEGORY_COLORS[selectedClub.category] || '#F97316'; const isLiked = likedClubs.has(selectedClub.id); const likesCount = likesMap[selectedClub.id] || 0; return (
{selectedClub.logoUrl ? (
{selectedClub.name}
) : (
)}
{selectedClub.category}

{selectedClub.name}

{/* Interactive Like Button in Modal */} toggleLike(selectedClub.id)} className={`px-4 py-2 rounded-xl text-xs font-bold flex items-center gap-2 transition-all cursor-pointer shadow-xs border shrink-0 ${ isLiked ? 'bg-rose-500 text-white border-rose-600 shadow-rose-200' : 'bg-rose-50 text-rose-600 border-rose-200 hover:bg-rose-100' }`} > {isLiked ? 'Liked' : 'Like Club'} ({likesCount})
); })()} {/* Club Detailed Description */}
About the Club

{selectedClub.details || selectedClub.description}

{/* Leadership & Contact Information - Icon Based Color Cards */}
{/* President Card - Indigo Theme */}
President / Student Lead {selectedClub.presidentName || 'Student President'}
{/* Year Card - Purple Theme */}
Year & Department {selectedClub.year || 'Senior Year'}
{/* Email Card - Emerald Theme */} {/* Phone Card - Sky Theme */}
Contact Phone {selectedClub.contactPhone || '+91 98765 43210'}
{/* ─── Feature 5: Social & Community Link Hub (Dummy Links) ─────── */}
Community & Social Links
✓ Verified RIT Handle
{selectedClub.socialLinks?.instagram && ( Instagram )} {selectedClub.socialLinks?.website && ( Linktree Hub )} {selectedClub.socialLinks?.linkedin && ( LinkedIn )} {selectedClub.socialLinks?.whatsapp && ( WhatsApp Group )} {selectedClub.socialLinks?.youtube && ( YouTube Channel )}
{/* Close Button */}
)}
); }