ok / index.html
b85701's picture
I'll analyze the HTML code for the FC25 Ultimate Team web application: ## Overview This is a complete, interactive FIFA-style Ultimate Team web application with: - Pack opening functionality - Squad building - Match simulation against AI - Store for purchasing coins ## Key Features ### 1. Pack Opening System - Three types of packs (Premium Gold, Jumbo Premium, Ultimate) with different costs and rewards - Animations for pack opening and card reveals - Ability to add unpacked players to your club ### 2. Squad Builder - Drag-and-drop style interface on a football pitch - Formation visualization (4-4-2) - Auto-build and clear squad functions - Chemistry and rating calculations - Position filtering for player selection ### 3. Match Simulation - Play against AI with selectable difficulty - Tactical options (defensive, balanced, attacking) - Live commentary feed - Momentum system - Goal celebrations - Post-match rewards ### 4. Store Functionality - Modal for purchasing coins with real money (simulated) - Different coin packages available ### 5. Visual Design - Modern UI with Tailwind CSS - Animated elements (cards, buttons, etc.) - Football pitch background - Player cards with ratings and positions - Responsive layout ## Technical Implementation ### Frontend - Built with HTML, CSS (Tailwind), and vanilla JavaScript - Custom animations using CSS keyframes - Interactive elements with event listeners - Dynamic content generation ### Game Data - Includes 28 players with ratings, positions, nationalities, and clubs - Consumable items for packs - Stadium data ### State Management - Tracks: - User's club (all players) - Current squad (11 players) - Coin balance - Match statistics ## Potential Improvements 1. **Persistent Storage**: Add localStorage to save progress between sessions 2. **More Animations**: Enhance pack opening and match sequences 3. **Additional Features**: - Player trading - Squad challenges - More formations 4. **Backend Integration**: Connect to a real database for multiplayer functionality 5. **Enhanced Graphics**: Add player images and more detailed stadium visuals This is a comprehensive frontend implementation that successfully mimics the core Ultimate Team experience from FIFA games in a web browser. The code is well-structured and makes good use of modern CSS features for animations and styling. - Initial Deployment
2b7931d verified
Raw History Blame Contribute Delete
84.6 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>FC25 Ultimate Team</title> <script src="https://cdn.tailwindcss.com"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> <style> @keyframes cardReveal { 0% { transform: rotateY(0deg); opacity: 0; } 50% { transform: rotateY(90deg); opacity: 0.5; } 100% { transform: rotateY(0deg); opacity: 1; } } @keyframes packOpen { 0% { transform: scale(1); } 25% { transform: scale(1.2); } 50% { transform: scale(0.8); } 75% { transform: scale(1.1); } 100% { transform: scale(1); } } @keyframes glow { 0% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); } 50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); } 100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); } } @keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } } @keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0px); } } .card-reveal { animation: cardReveal 0.8s ease-in-out; } .pack-open { animation: packOpen 0.8s ease-in-out; } .glow { animation: glow 2s infinite; } .pulse { animation: pulse 2s infinite; } .float { animation: float 3s ease-in-out infinite; } @keyframes shake { 0%, 100% { transform: translateX(0); } 10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); } 20%, 40%, 60%, 80% { transform: translateX(5px); } } .animate-shake { animation: shake 0.5s ease-in-out; } .pitch-bg { background: linear-gradient(135deg, #1a5e1a 0%, #0e3a0e 100%); background-image: linear-gradient(to right, rgba(255,255,255,0.1) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,0.1) 1px, transparent 1px); background-size: 50px 50px; } .player-card { transition: all 0.3s ease; perspective: 1000px; } .player-card:hover { transform: translateY(-5px) scale(1.03); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3); } .rating-gradient { background: linear-gradient(135deg, #f5af19 0%, #f12711 100%); } .special-card { background: linear-gradient(135deg, #12c2e9 0%, #c471ed 50%, #f64f59 100%); position: relative; overflow: hidden; } .special-card::before { content: ""; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: linear-gradient( to bottom right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0) 100% ); transform: rotate(30deg); animation: shine 3s infinite; } @keyframes shine { 0% { transform: translateX(-100%) rotate(30deg); } 100% { transform: translateX(100%) rotate(30deg); } } .gameplay-screen { background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('https://images.unsplash.com/photo-1574629810360-7efbbe195018?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1896&q=80'); background-size: cover; background-position: center; border: 2px solid rgba(255,255,255,0.1); } .player-badge { transition: all 0.3s ease; } .player-badge:hover { transform: scale(1.1); box-shadow: 0 0 10px rgba(255,255,255,0.5); } .commentary-entry { border-bottom: 1px solid rgba(255,255,255,0.1); padding: 8px 0; transition: all 0.3s ease; } .commentary-entry:hover { background-color: rgba(255,255,255,0.05); } .tab-indicator { transition: all 0.3s ease; } .modal-content { transform: translateY(20px); opacity: 0; transition: all 0.3s ease; } .modal-show .modal-content { transform: translateY(0); opacity: 1; } .scrollbar-hidden::-webkit-scrollbar { display: none; } .scrollbar-hidden { -ms-overflow-style: none; scrollbar-width: none; } .fade-in { animation: fadeIn 0.5s ease-in; } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } .goal-celebration { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.7); display: flex; justify-content: center; align-items: center; z-index: 100; animation: fadeIn 0.3s ease-in; } .goal-text { font-size: 5rem; font-weight: bold; text-transform: uppercase; color: white; text-shadow: 0 0 10px rgba(255,255,255,0.8); animation: pulse 1s infinite; } </style> </head> <body class="bg-gray-900 text-white min-h-screen font-sans"> <!-- Header --> <header class="bg-black py-4 px-6 shadow-lg sticky top-0 z-40"> <div class="container mx-auto flex justify-between items-center"> <div class="flex items-center space-x-3"> <div class="relative"> <i class="fas fa-futbol text-3xl text-yellow-400 float"></i> <div class="absolute -top-1 -right-1 w-4 h-4 bg-red-500 rounded-full animate-ping"></div> </div> <h1 class="text-2xl md:text-3xl font-bold bg-gradient-to-r from-yellow-400 via-red-500 to-purple-500 bg-clip-text text-transparent"> FC25 Ultimate Team </h1> </div> <div class="flex items-center space-x-3 md:space-x-4"> <div class="bg-gray-800 px-4 py-2 rounded-full flex items-center glow"> <i class="fas fa-coins text-yellow-400 mr-2"></i> <span id="coins" class="font-bold">25,000</span> </div> <button id="openStoreBtn" class="bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded-full font-medium transition flex items-center pulse"> <i class="fas fa-shopping-cart mr-2"></i> <span class="hidden md:inline">Store</span> </button> </div> </div> </header> <!-- Main Content --> <main class="container mx-auto py-8 px-4 md:px-6"> <!-- Tabs --> <div class="flex border-b border-gray-700 mb-8 relative"> <div class="tab-indicator absolute bottom-0 left-0 h-0.5 bg-yellow-400 transition-all duration-300"></div> <button id="packTab" class="tab-btn active px-4 md:px-6 py-3 font-medium text-yellow-400"> <i class="fas fa-gift mr-2"></i> <span class="hidden sm:inline">Open Packs</span> </button> <button id="squadTab" class="tab-btn px-4 md:px-6 py-3 font-medium text-gray-400 hover:text-white"> <i class="fas fa-users mr-2"></i> <span class="hidden sm:inline">My Squad</span> </button> <button id="gameTab" class="tab-btn px-4 md:px-6 py-3 font-medium text-gray-400 hover:text-white"> <i class="fas fa-gamepad mr-2"></i> <span class="hidden sm:inline">Play vs AI</span> </button> </div> <!-- Pack Opening Section --> <section id="packSection" class="section-content fade-in"> <div class="text-center mb-8"> <h2 class="text-3xl font-bold mb-2 bg-gradient-to-r from-yellow-400 to-red-500 bg-clip-text text-transparent"> Open Packs </h2> <p class="text-gray-400 max-w-2xl mx-auto"> Unlock amazing players to build your ultimate team. Each pack contains rare players with special items! </p> </div> <div class="grid grid-cols-1 md:grid-cols-3 gap-6"> <!-- Premium Gold Pack --> <div class="bg-gradient-to-br from-gray-800 to-gray-900 rounded-xl p-6 shadow-lg border border-yellow-500 hover:border-yellow-300 transition-all duration-300 transform hover:-translate-y-1"> <div class="text-center mb-4"> <div class="w-24 h-24 mx-auto bg-gradient-to-br from-yellow-400 to-yellow-600 rounded-full flex items-center justify-center mb-4 shadow-lg glow"> <i class="fas fa-star text-4xl text-white"></i> </div> <h3 class="text-xl font-bold mb-2">Premium Gold Pack</h3> <p class="text-gray-400 mb-4">12 items, 3 rare players guaranteed</p> <div class="flex justify-center items-center mb-4"> <i class="fas fa-coins text-yellow-400 mr-2"></i> <span class="font-bold text-lg">7,500</span> </div> <button class="open-pack-btn w-full bg-gradient-to-r from-yellow-500 to-yellow-600 hover:from-yellow-400 hover:to-yellow-500 text-black font-bold py-3 rounded-lg transition-all duration-300 transform hover:scale-105" data-pack="premium"> <i class="fas fa-gift mr-2"></i>Open Pack </button> </div> </div> <!-- Jumbo Premium Gold Pack --> <div class="bg-gradient-to-br from-gray-800 to-gray-900 rounded-xl p-6 shadow-lg border border-blue-500 hover:border-blue-300 transition-all duration-300 transform hover:-translate-y-1"> <div class="text-center mb-4"> <div class="w-24 h-24 mx-auto bg-gradient-to-br from-blue-400 to-blue-600 rounded-full flex items-center justify-center mb-4 shadow-lg glow"> <i class="fas fa-gem text-4xl text-white"></i> </div> <h3 class="text-xl font-bold mb-2">Jumbo Premium Pack</h3> <p class="text-gray-400 mb-4">24 items, 6 rare players guaranteed</p> <div class="flex justify-center items-center mb-4"> <i class="fas fa-coins text-yellow-400 mr-2"></i> <span class="font-bold text-lg">15,000</span> </div> <button class="open-pack-btn w-full bg-gradient-to-r from-blue-500 to-blue-600 hover:from-blue-400 hover:to-blue-500 text-white font-bold py-3 rounded-lg transition-all duration-300 transform hover:scale-105" data-pack="jumbo"> <i class="fas fa-gift mr-2"></i>Open Pack </button> </div> </div> <!-- Ultimate Pack --> <div class="bg-gradient-to-br from-gray-800 to-gray-900 rounded-xl p-6 shadow-lg border border-purple-500 hover:border-purple-300 transition-all duration-300 transform hover:-translate-y-1"> <div class="text-center mb-4"> <div class="w-24 h-24 mx-auto bg-gradient-to-br from-purple-400 to-purple-600 rounded-full flex items-center justify-center mb-4 shadow-lg glow"> <i class="fas fa-crown text-4xl text-white"></i> </div> <h3 class="text-xl font-bold mb-2">Ultimate Pack</h3> <p class="text-gray-400 mb-4">30 items, 10 rare players guaranteed</p> <div class="flex justify-center items-center mb-4"> <i class="fas fa-coins text-yellow-400 mr-2"></i> <span class="font-bold text-lg">30,000</span> </div> <button class="open-pack-btn w-full bg-gradient-to-r from-purple-500 to-purple-600 hover:from-purple-400 hover:to-purple-500 text-white font-bold py-3 rounded-lg transition-all duration-300 transform hover:scale-105" data-pack="ultimate"> <i class="fas fa-gift mr-2"></i>Open Pack </button> </div> </div> </div> <!-- Pack Results --> <div id="packResults" class="mt-12 hidden"> <h3 class="text-2xl font-bold mb-6 flex items-center"> <i class="fas fa-box-open mr-3 text-yellow-400"></i> <span class="bg-gradient-to-r from-yellow-400 to-red-500 bg-clip-text text-transparent"> Pack Contents </span> </h3> <div id="packItems" class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-4"> <!-- Pack items will be inserted here by JavaScript --> </div> <div class="mt-8 text-center"> <button id="addToClubBtn" class="bg-gradient-to-r from-green-600 to-green-700 hover:from-green-500 hover:to-green-600 px-8 py-3 rounded-full font-bold transition-all duration-300 transform hover:scale-105"> <i class="fas fa-users mr-2"></i> Add All to Club </button> </div> </div> </section> <!-- Squad Building Section --> <section id="squadSection" class="section-content hidden fade-in"> <div class="flex flex-col lg:flex-row gap-6"> <!-- Squad Management --> <div class="lg:w-2/3"> <div class="flex justify-between items-center mb-6"> <h2 class="text-2xl font-bold bg-gradient-to-r from-blue-400 to-green-400 bg-clip-text text-transparent"> My Squad </h2> <div class="flex space-x-2"> <button id="autoSquadBtn" class="bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-500 hover:to-blue-600 px-4 py-2 rounded-full text-sm transition-all duration-300"> <i class="fas fa-magic mr-1"></i> Auto Build </button> <button id="clearSquadBtn" class="bg-gradient-to-r from-red-600 to-red-700 hover:from-red-500 hover:to-red-600 px-4 py-2 rounded-full text-sm transition-all duration-300"> <i class="fas fa-trash mr-1"></i> Clear </button> </div> </div> <!-- Football Pitch --> <div class="pitch-bg rounded-xl p-4 mb-6 border-2 border-gray-700 relative overflow-hidden"> <!-- Grass pattern --> <div class="absolute inset-0 bg-repeat bg-[length:50px_50px]" style="background-image: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);"></div> <!-- Pitch markings --> <div class="absolute inset-0 border-4 border-white rounded-lg"></div> <div class="absolute top-0 left-1/2 transform -translate-x-1/2 w-1/2 h-1/2 border-b-4 border-white rounded-b-full"></div> <div class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-16 h-16 border-4 border-white rounded-full"></div> <div class="absolute top-1/2 left-0 transform -translate-y-1/2 w-1/4 h-1/3 border-r-4 border-white"></div> <div class="absolute top-1/2 right-0 transform -translate-y-1/2 w-1/4 h-1/3 border-l-4 border-white"></div> <!-- Center circle --> <div class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-16 h-16 border-4 border-white rounded-full"></div> <!-- Player positions --> <div id="gk" class="player-slot absolute bottom-2 left-1/2 transform -translate-x-1/2" data-position="GK"></div> <div id="lb" class="player-slot absolute bottom-16 left-8" data-position="LB"></div> <div id="lcb" class="player-slot absolute bottom-24 left-1/4" data-position="LCB"></div> <div id="rcb" class="player-slot absolute bottom-24 right-1/4" data-position="RCB"></div> <div id="rb" class="player-slot absolute bottom-16 right-8" data-position="RB"></div> <div id="lm" class="player-slot absolute bottom-40 left-1/4" data-position="LM"></div> <div id="lcm" class="player-slot absolute bottom-44 left-1/3" data-position="LCM"></div> <div id="rcm" class="player-slot absolute bottom-44 right-1/3" data-position="RCM"></div> <div id="rm" class="player-slot absolute bottom-40 right-1/4" data-position="RM"></div> <div id="ls" class="player-slot absolute bottom-64 left-1/3" data-position="LS"></div> <div id="rs" class="player-slot absolute bottom-64 right-1/3" data-position="RS"></div> <!-- Formation text --> <div class="absolute top-2 left-2 bg-black bg-opacity-50 px-2 py-1 rounded text-xs"> Formation: 4-4-2 </div> </div> <!-- Squad Rating --> <div class="bg-gradient-to-br from-gray-800 to-gray-900 rounded-xl p-4 border border-gray-700"> <div class="flex justify-between items-center"> <div class="text-center flex-1"> <h3 class="font-bold text-lg text-gray-400">Squad Rating</h3> <p id="squadRating" class="text-4xl font-bold bg-gradient-to-r from-yellow-400 to-red-500 bg-clip-text text-transparent">0</p> </div> <div class="h-12 w-px bg-gray-700 mx-4"></div> <div class="text-center flex-1"> <h3 class="font-bold text-lg text-gray-400">Chemistry</h3> <p id="squadChemistry" class="text-4xl font-bold bg-gradient-to-r from-blue-400 to-green-400 bg-clip-text text-transparent">0</p> </div> </div> </div> </div> <!-- Player List --> <div class="lg:w-1/3"> <div class="mb-6"> <div class="flex items-center justify-between mb-4"> <h2 class="text-2xl font-bold bg-gradient-to-r from-purple-400 to-pink-500 bg-clip-text text-transparent"> My Club </h2> <div class="relative"> <select id="positionFilter" class="bg-gray-800 border border-gray-700 rounded-full px-4 py-2 appearance-none pr-8 focus:outline-none focus:ring-2 focus:ring-blue-500"> <option value="all">All Positions</option> <option value="GK">Goalkeepers</option> <option value="DEF">Defenders</option> <option value="MID">Midfielders</option> <option value="ATT">Attackers</option> </select> <div class="absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none"> <i class="fas fa-chevron-down text-gray-400"></i> </div> </div> </div> <div id="playerList" class="space-y-3 h-[32rem] overflow-y-auto pr-2 scrollbar-hidden"> <!-- Players will be inserted here by JavaScript --> <div class="text-center py-8 text-gray-500"> <i class="fas fa-users text-4xl mb-2 opacity-30"></i> <p>No players in your club yet. Open packs to get started!</p> </div> </div> </div> </div> </div> </section> <!-- Gameplay Section --> <section id="gameSection" class="section-content hidden fade-in"> <div class="text-center mb-8"> <h2 class="text-3xl font-bold mb-2 bg-gradient-to-r from-green-400 to-blue-500 bg-clip-text text-transparent"> Play vs AI </h2> <p class="text-gray-400 max-w-2xl mx-auto"> Test your ultimate team against computer-controlled opponents. Earn coins and rewards for victories! </p> </div> <div class="gameplay-screen rounded-xl p-6 mb-8 backdrop-blur-sm"> <div class="flex flex-col md:flex-row justify-between items-center mb-8"> <div class="text-center mb-4 md:mb-0"> <div class="w-20 h-20 mx-auto bg-gradient-to-br from-blue-500 to-blue-700 rounded-full flex items-center justify-center mb-2 shadow-lg"> <i class="fas fa-user text-3xl"></i> </div> <h3 class="text-xl font-bold">Your Team</h3> <p id="userTeamRating" class="text-2xl font-bold text-blue-400">0</p> </div> <div class="text-center mb-4 md:mb-0"> <div class="w-16 h-16 mx-auto bg-gradient-to-br from-gray-800 to-gray-900 rounded-full flex items-center justify-center mb-2 border-2 border-yellow-400 shadow-lg"> <h3 class="text-2xl font-bold text-yellow-400">VS</h3> </div> <p class="text-gray-300 font-medium">Semi-Pro</p> </div> <div class="text-center"> <div class="w-20 h-20 mx-auto bg-gradient-to-br from-red-500 to-red-700 rounded-full flex items-center justify-center mb-2 shadow-lg"> <i class="fas fa-robot text-3xl"></i> </div> <h3 class="text-xl font-bold">AI Team</h3> <p id="aiTeamRating" class="text-2xl font-bold text-red-400">75</p> </div> </div> <div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-8"> <div class="bg-gray-800 bg-opacity-70 rounded-lg p-4 border border-gray-700 backdrop-blur-sm"> <h4 class="font-bold mb-2 text-center text-gray-300">Difficulty</h4> <select id="aiDifficulty" class="w-full bg-gray-700 border border-gray-600 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"> <option value="50">Semi-Pro</option> <option value="65">Professional</option> <option value="80">World Class</option> <option value="90">Legendary</option> <option value="95">Ultimate</option> </select> </div> <div class="bg-gray-800 bg-opacity-70 rounded-lg p-4 border border-gray-700 backdrop-blur-sm"> <h4 class="font-bold mb-2 text-center text-gray-300">Half Length</h4> <select id="gameLength" class="w-full bg-gray-700 border border-gray-600 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"> <option value="3">3 minutes</option> <option value="4" selected>4 minutes</option> <option value="5">5 minutes</option> <option value="6">6 minutes</option> </select> </div> <div class="bg-gray-800 bg-opacity-70 rounded-lg p-4 border border-gray-700 backdrop-blur-sm"> <h4 class="font-bold mb-2 text-center text-gray-300">Stadium</h4> <select id="stadiumSelect" class="w-full bg-gray-700 border border-gray-600 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"> <option value="1">Camp Nou</option> <option value="2">Old Trafford</option> <option value="3">Santiago Bernabéu</option> <option value="4">Allianz Arena</option> <option value="5">Wembley</option> </select> </div> </div> <div class="text-center"> <button id="startGameBtn" class="bg-gradient-to-r from-green-600 to-green-700 hover:from-green-500 hover:to-green-600 px-8 py-3 rounded-full font-bold text-lg transition-all duration-300 transform hover:scale-105 shadow-lg"> <i class="fas fa-play mr-2"></i> Start Match </button> </div> </div> <!-- Match Simulation --> <div id="matchSimulation" class="hidden"> <div class="bg-gradient-to-br from-gray-800 to-gray-900 rounded-xl p-6 mb-6 border border-gray-700"> <div class="flex justify-between items-center mb-4"> <div class="flex items-center"> <span id="userTeamName" class="font-bold text-blue-400">Your Team</span> <span id="userTeamScore" class="text-3xl font-bold mx-3">0</span> <span class="mx-1">-</span> <span id="aiTeamScore" class="text-3xl font-bold mx-3">0</span> <span id="aiTeamName" class="font-bold text-red-400">AI Team</span> </div> <div id="gameClock" class="bg-gray-700 px-3 py-1 rounded-full font-mono">0:00</div> </div> <div class="relative h-4 bg-gray-700 rounded-full mb-4 overflow-hidden"> <div id="momentumBar" class="absolute h-full bg-gradient-to-r from-blue-500 via-purple-500 to-red-500 rounded-full" style="width: 50%; left: 25%;"></div> </div> <div id="commentaryFeed" class="bg-gray-900 rounded-lg p-4 h-48 overflow-y-auto mb-4 scrollbar-hidden border border-gray-800"> <div class="commentary-entry text-gray-300">Match about to begin...</div> </div> <div class="grid grid-cols-3 gap-4"> <button id="defensiveBtn" class="bg-gray-700 hover:bg-blue-700 py-2 rounded-lg transition-all duration-300 border border-gray-600"> <i class="fas fa-shield-alt mr-2"></i> Defensive </button> <button id="balancedBtn" class="bg-gray-700 hover:bg-green-700 py-2 rounded-lg transition-all duration-300 border border-gray-600"> <i class="fas fa-balance-scale mr-2"></i> Balanced </button> <button id="attackingBtn" class="bg-gray-700 hover:bg-red-700 py-2 rounded-lg transition-all duration-300 border border-gray-600"> <i class="fas fa-bolt mr-2"></i> Attacking </button> </div> </div> <div class="text-center"> <button id="simulateMatchBtn" class="bg-gradient-to-r from-yellow-500 to-yellow-600 hover:from-yellow-400 hover:to-yellow-500 text-black font-bold px-8 py-3 rounded-full transition-all duration-300 transform hover:scale-105 shadow-lg"> <i class="fas fa-forward mr-2"></i> Simulate Match </button> </div> </div> <!-- Match Result --> <div id="matchResult" class="hidden bg-gradient-to-br from-gray-800 to-gray-900 rounded-xl p-8 text-center border border-gray-700"> <h3 class="text-2xl font-bold mb-2">Match Completed</h3> <div class="text-5xl font-bold mb-6 flex justify-center items-center"> <span id="finalUserScore" class="text-blue-400">0</span> <span class="mx-6">-</span> <span id="finalAiScore" class="text-red-400">0</span> </div> <p id="resultMessage" class="text-xl mb-6">Draw!</p> <div class="flex flex-col sm:flex-row justify-center space-y-3 sm:space-y-0 sm:space-x-4"> <button id="playAgainBtn" class="bg-gradient-to-r from-green-600 to-green-700 hover:from-green-500 hover:to-green-600 px-6 py-2 rounded-full transition-all duration-300"> <i class="fas fa-redo mr-2"></i> Play Again </button> <button id="backToSquadBtn" class="bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-500 hover:to-blue-600 px-6 py-2 rounded-full transition-all duration-300"> <i class="fas fa-users mr-2"></i> Back to Squad </button> </div> </div> </section> </main> <!-- Store Modal --> <div id="storeModal" class="fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 hidden transition-opacity duration-300"> <div class="modal-content bg-gradient-to-br from-gray-800 to-gray-900 rounded-xl p-6 w-full max-w-2xl max-h-[90vh] overflow-y-auto border border-gray-700 shadow-2xl"> <div class="flex justify-between items-center mb-6"> <h2 class="text-2xl font-bold bg-gradient-to-r from-yellow-400 to-red-500 bg-clip-text text-transparent"> FC25 Store </h2> <button id="closeStoreBtn" class="text-gray-400 hover:text-white transition-all duration-300 transform hover:rotate-90"> <i class="fas fa-times text-2xl"></i> </button> </div> <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8"> <div class="bg-gradient-to-br from-gray-700 to-gray-800 rounded-lg p-4 border border-yellow-500 hover:border-yellow-300 transition-all duration-300"> <div class="flex justify-between items-start mb-4"> <div> <h3 class="font-bold text-lg">5,000 Coins</h3> <p class="text-gray-400 text-sm">Instant delivery</p> </div> <div class="bg-yellow-500 text-black px-3 py-1 rounded-full font-bold">$4.99</div> </div> <button class="w-full bg-gradient-to-r from-yellow-500 to-yellow-600 hover:from-yellow-400 hover:to-yellow-500 text-black font-bold py-2 rounded-lg transition-all duration-300"> Buy Now </button> </div> <div class="bg-gradient-to-br from-gray-700 to-gray-800 rounded-lg p-4 border border-blue-500 hover:border-blue-300 transition-all duration-300"> <div class="flex justify-between items-start mb-4"> <div> <h3 class="font-bold text-lg">12,000 Coins</h3> <p class="text-gray-400 text-sm">Best value</p> </div> <div class="bg-blue-500 text-white px-3 py-1 rounded-full font-bold">$9.99</div> </div> <button class="w-full bg-gradient-to-r from-blue-500 to-blue-600 hover:from-blue-400 hover:to-blue-500 text-white font-bold py-2 rounded-lg transition-all duration-300"> Buy Now </button> </div> <div class="bg-gradient-to-br from-gray-700 to-gray-800 rounded-lg p-4 border border-purple-500 hover:border-purple-300 transition-all duration-300"> <div class="flex justify-between items-start mb-4"> <div> <h3 class="font-bold text-lg">25,000 Coins</h3> <p class="text-gray-400 text-sm">Ultimate offer</p> </div> <div class="bg-purple-500 text-white px-3 py-1 rounded-full font-bold">$19.99</div> </div> <button class="w-full bg-gradient-to-r from-purple-500 to-purple-600 hover:from-purple-400 hover:to-purple-500 text-white font-bold py-2 rounded-lg transition-all duration-300"> Buy Now </button> </div> <div class="bg-gradient-to-br from-gray-700 to-gray-800 rounded-lg p-4 border border-green-500 hover:border-green-300 transition-all duration-300"> <div class="flex justify-between items-start mb-4"> <div> <h3 class="font-bold text-lg">50,000 Coins</h3> <p class="text-gray-400 text-sm">Mega pack included</p> </div> <div class="bg-green-500 text-white px-3 py-1 rounded-full font-bold">$39.99</div> </div> <button class="w-full bg-gradient-to-r from-green-500 to-green-600 hover:from-green-400 hover:to-green-500 text-white font-bold py-2 rounded-lg transition-all duration-300"> Buy Now </button> </div> </div> <div class="bg-gradient-to-br from-gray-900 to-gray-800 rounded-lg p-4 border border-red-500"> <h3 class="font-bold text-lg mb-3 text-red-400">Special Offers</h3> <div class="flex items-center justify-between bg-gray-800 bg-opacity-50 p-3 rounded-lg"> <div> <p class="text-yellow-400 font-medium">Starter Pack</p> <p class="text-gray-400 text-sm">2 Premium Gold Packs + 5,000 coins</p> </div> <div class="bg-red-500 text-white px-3 py-1 rounded-full font-bold">$7.99</div> </div> </div> </div> </div> <!-- Goal Celebration --> <div id="goalCelebration" class="goal-celebration hidden"> <div class="goal-text">GOAL!</div> </div> <script> // Game Data const players = [ // Goalkeepers { id: 1, name: "T. Courtois", rating: 90, position: "GK", nation: "Belgium", club: "Real Madrid", isRare: true }, { id: 2, name: "A. Becker", rating: 89, position: "GK", nation: "Brazil", club: "Liverpool", isRare: true }, { id: 3, name: "M. Neuer", rating: 88, position: "GK", nation: "Germany", club: "Bayern Munich", isRare: true }, { id: 4, name: "E. Martínez", rating: 85, position: "GK", nation: "Argentina", club: "Aston Villa", isRare: false }, { id: 5, name: "J. Oblak", rating: 87, position: "GK", nation: "Slovenia", club: "Atlético Madrid", isRare: false }, // Defenders { id: 6, name: "V. van Dijk", rating: 89, position: "CB", nation: "Netherlands", club: "Liverpool", isRare: true }, { id: 7, name: "R. Dias", rating: 88, position: "CB", nation: "Portugal", club: "Man City", isRare: true }, { id: 8, name: "A. Bastoni", rating: 86, position: "CB", nation: "Italy", club: "Inter", isRare: false }, { id: 9, name: "T. Hernández", rating: 87, position: "LB", nation: "France", club: "AC Milan", isRare: true }, { id: 10, name: "A. Davies", rating: 86, position: "LB", nation: "Canada", club: "Bayern Munich", isRare: true }, { id: 11, name: "K. Walker", rating: 85, position: "RB", nation: "England", club: "Man City", isRare: false }, { id: 12, name: "D. Alves", rating: 83, position: "RB", nation: "Brazil", club: "Pumas", isRare: false }, // Midfielders { id: 13, name: "K. De Bruyne", rating: 91, position: "CM", nation: "Belgium", club: "Man City", isRare: true }, { id: 14, name: "L. Modrić", rating: 88, position: "CM", nation: "Croatia", club: "Real Madrid", isRare: true }, { id: 15, name: "F. Valverde", rating: 86, position: "CM", nation: "Uruguay", club: "Real Madrid", isRare: false }, { id: 16, name: "B. Silva", rating: 88, position: "RM", nation: "Portugal", club: "Man City", isRare: true }, { id: 17, name: "V. Junior", rating: 89, position: "LM", nation: "Brazil", club: "Real Madrid", isRare: true }, { id: 18, name: "J. Kimmich", rating: 88, position: "CDM", nation: "Germany", club: "Bayern Munich", isRare: true }, // Attackers { id: 19, name: "K. Mbappé", rating: 92, position: "ST", nation: "France", club: "PSG", isRare: true }, { id: 20, name: "E. Haaland", rating: 91, position: "ST", nation: "Norway", club: "Man City", isRare: true }, { id: 21, name: "L. Messi", rating: 91, position: "RW", nation: "Argentina", club: "PSG", isRare: true }, { id: 22, name: "C. Ronaldo", rating: 90, position: "ST", nation: "Portugal", club: "Al Nassr", isRare: true }, { id: 23, name: "Neymar Jr", rating: 89, position: "LW", nation: "Brazil", club: "PSG", isRare: true }, { id: 24, name: "H. Kane", rating: 89, position: "ST", nation: "England", club: "Tottenham", isRare: false }, { id: 25, name: "R. Lewandowski", rating: 90, position: "ST", nation: "Poland", club: "Barcelona", isRare: true }, { id: 26, name: "K. Benzema", rating: 89, position: "ST", nation: "France", club: "Real Madrid", isRare: true }, { id: 27, name: "M. Salah", rating: 90, position: "RW", nation: "Egypt", club: "Liverpool", isRare: true }, { id: 28, name: "S. Mané", rating: 88, position: "LW", nation: "Senegal", club: "Bayern Munich", isRare: false }, ]; const consumables = [ { id: 101, name: "Fitness Card", type: "consumable", rarity: "common" }, { id: 102, name: "Injury Card", type: "consumable", rarity: "common" }, { id: 103, name: "Contract", type: "consumable", rarity: "common" }, { id: 104, name: "+10 All Stats", type: "consumable", rarity: "rare" }, { id: 105, name: "Position Change", type: "consumable", rarity: "rare" }, ]; const stadiums = [ { id: 1, name: "Camp Nou", city: "Barcelona" }, { id: 2, name: "Old Trafford", city: "Manchester" }, { id: 3, name: "Santiago Bernabéu", city: "Madrid" }, { id: 4, name: "Allianz Arena", city: "Munich" }, { id: 5, name: "Wembley", city: "London" }, ]; // Game State let userClub = JSON.parse(localStorage.getItem('userClub')) || []; let userSquad = JSON.parse(localStorage.getItem('userSquad')) || { GK: null, LB: null, LCB: null, RCB: null, RB: null, LM: null, LCM: null, RCM: null, RM: null, LS: null, RS: null }; let coins = parseInt(localStorage.getItem('coins')) || 25000; let packItems = []; let matchInProgress = false; let currentTactic = "balanced"; let matchStats = { userShots: 0, aiShots: 0, userPossession: 50, userScore: 0, aiScore: 0, gameTime: 0 }; // DOM Elements const packSection = document.getElementById('packSection'); const squadSection = document.getElementById('squadSection'); const gameSection = document.getElementById('gameSection'); const packResults = document.getElementById('packResults'); const packItemsContainer = document.getElementById('packItems'); const playerList = document.getElementById('playerList'); const positionFilter = document.getElementById('positionFilter'); const coinsDisplay = document.getElementById('coins'); const squadRating = document.getElementById('squadRating'); const squadChemistry = document.getElementById('squadChemistry'); const storeModal = document.getElementById('storeModal'); const openStoreBtn = document.getElementById('openStoreBtn'); const closeStoreBtn = document.getElementById('closeStoreBtn'); const addToClubBtn = document.getElementById('addToClubBtn'); const autoSquadBtn = document.getElementById('autoSquadBtn'); const clearSquadBtn = document.getElementById('clearSquadBtn'); const startGameBtn = document.getElementById('startGameBtn'); const matchSimulation = document.getElementById('matchSimulation'); const matchResult = document.getElementById('matchResult'); const commentaryFeed = document.getElementById('commentaryFeed'); const simulateMatchBtn = document.getElementById('simulateMatchBtn'); const playAgainBtn = document.getElementById('playAgainBtn'); const backToSquadBtn = document.getElementById('backToSquadBtn'); const userTeamRating = document.getElementById('userTeamRating'); const aiTeamRating = document.getElementById('aiTeamRating'); const userTeamScore = document.getElementById('userTeamScore'); const aiTeamScore = document.getElementById('aiTeamScore'); const finalUserScore = document.getElementById('finalUserScore'); const finalAiScore = document.getElementById('finalAiScore'); const resultMessage = document.getElementById('resultMessage'); const gameClock = document.getElementById('gameClock'); const momentumBar = document.getElementById('momentumBar'); const defensiveBtn = document.getElementById('defensiveBtn'); const balancedBtn = document.getElementById('balancedBtn'); const attackingBtn = document.getElementById('attackingBtn'); const goalCelebration = document.getElementById('goalCelebration'); const tabIndicator = document.querySelector('.tab-indicator'); // Tab Switching document.querySelectorAll('.tab-btn').forEach(btn => { btn.addEventListener('click', () => { // Update tab indicator position const tabRect = btn.getBoundingClientRect(); const containerRect = btn.parentElement.getBoundingClientRect(); const left = tabRect.left - containerRect.left; const width = tabRect.width; tabIndicator.style.left = `${left}px`; tabIndicator.style.width = `${width}px`; document.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active', 'text-yellow-400')); document.querySelectorAll('.tab-btn').forEach(b => b.classList.add('text-gray-400')); btn.classList.add('active', 'text-yellow-400'); btn.classList.remove('text-gray-400'); document.querySelectorAll('.section-content').forEach(section => { section.classList.add('hidden'); }); if (btn.id === 'packTab') { packSection.classList.remove('hidden'); } else if (btn.id === 'squadTab') { squadSection.classList.remove('hidden'); updatePlayerList(); calculateSquadStats(); } else if (btn.id === 'gameTab') { gameSection.classList.remove('hidden'); updateTeamRatings(); } }); }); // Initialize tab indicator position function initTabIndicator() { const activeTab = document.querySelector('.tab-btn.active'); if (activeTab) { const tabRect = activeTab.getBoundingClientRect(); const containerRect = activeTab.parentElement.getBoundingClientRect(); const left = tabRect.left - containerRect.left; const width = tabRect.width; tabIndicator.style.left = `${left}px`; tabIndicator.style.width = `${width}px`; } } // Store Modal openStoreBtn.addEventListener('click', () => { storeModal.classList.remove('hidden'); setTimeout(() => { storeModal.classList.add('modal-show'); }, 10); }); closeStoreBtn.addEventListener('click', () => { storeModal.classList.remove('modal-show'); setTimeout(() => { storeModal.classList.add('hidden'); }, 300); }); // Pack Opening document.querySelectorAll('.open-pack-btn').forEach(btn => { btn.addEventListener('click', function() { const packType = this.getAttribute('data-pack'); const packCost = packType === 'premium' ? 7500 : packType === 'jumbo' ? 15000 : 30000; if (coins >= packCost) { // Add pack opening animation this.classList.add('pack-open'); // Disable button during animation this.disabled = true; setTimeout(() => { coins -= packCost; coinsDisplay.textContent = coins.toLocaleString(); openPack(packType); this.classList.remove('pack-open'); this.disabled = false; }, 800); } else { // Shake animation for not enough coins this.classList.add('animate-shake'); setTimeout(() => { this.classList.remove('animate-shake'); }, 500); // Show notification const notification = document.createElement('div'); notification.className = 'fixed bottom-4 right-4 bg-red-600 text-white px-4 py-2 rounded-lg shadow-lg flex items-center'; notification.innerHTML = ` <i class="fas fa-exclamation-circle mr-2"></i> <span>Not enough coins to open this pack!</span> `; document.body.appendChild(notification); setTimeout(() => { notification.classList.add('opacity-0', 'transition-opacity', 'duration-500'); setTimeout(() => notification.remove(), 500); }, 3000); } }); }); function openPack(packType) { packItems = []; packItemsContainer.innerHTML = ''; let playerCount = 12; let rareCount = 3; let guaranteedHighRated = 0; if (packType === 'jumbo') { playerCount = 24; rareCount = 6; guaranteedHighRated = 1; } else if (packType === 'ultimate') { playerCount = 30; rareCount = 10; guaranteedHighRated = 3; } // Add guaranteed high-rated players for (let i = 0; i < guaranteedHighRated; i++) { const highRatedPlayers = players.filter(p => p.rating >= 88 && p.isRare); if (highRatedPlayers.length > 0) { const randomPlayer = highRatedPlayers[Math.floor(Math.random() * highRatedPlayers.length)]; packItems.push(randomPlayer); } } // Add other rare players for (let i = 0; i < rareCount - guaranteedHighRated; i++) { const rarePlayers = players.filter(p => p.isRare); const randomPlayer = rarePlayers[Math.floor(Math.random() * rarePlayers.length)]; packItems.push(randomPlayer); } // Add common players for (let i = 0; i < playerCount - rareCount; i++) { const commonPlayers = players.filter(p => !p.isRare); const randomPlayer = commonPlayers[Math.floor(Math.random() * commonPlayers.length)]; packItems.push(randomPlayer); } // Add some consumables for (let i = 0; i < 3; i++) { const isRare = Math.random() > 0.7; const eligibleConsumables = consumables.filter(c => (isRare ? c.rarity === "rare" : c.rarity === "common")); const randomConsumable = eligibleConsumables[Math.floor(Math.random() * eligibleConsumables.length)]; packItems.push(randomConsumable); } // Shuffle pack items packItems = shuffleArray(packItems); // Display with animation setTimeout(() => { packResults.classList.remove('hidden'); packItems.forEach((item, index) => { setTimeout(() => { const card = createCardElement(item, true); packItemsContainer.appendChild(card); // Trigger animation setTimeout(() => { card.classList.add('card-reveal'); }, 50); }, index * 100); }); }, 500); } function shuffleArray(array) { for (let i = array.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [array[i], array[j]] = [array[j], array[i]]; } return array; } function createCardElement(item, isPackItem = false) { const card = document.createElement('div'); card.className = 'player-card bg-gradient-to-br from-gray-800 to-gray-900 rounded-lg overflow-hidden shadow-lg cursor-pointer'; if (item.type === 'consumable') { card.className += ' border border-gray-600'; card.innerHTML = ` <div class="p-3"> <div class="bg-gray-700 rounded-lg p-2 mb-2 flex justify-center"> <i class="fas ${item.id === 101 ? 'fa-bolt' : item.id === 102 ? 'fa-band-aid' : item.id === 103 ? 'fa-file-signature' : item.id === 104 ? 'fa-arrow-up' : 'fa-exchange-alt'} text-xl ${item.rarity === 'rare' ? 'text-yellow-400' : 'text-gray-400'}"></i> </div> <h4 class="font-bold text-sm truncate">${item.name}</h4> <div class="text-xs text-gray-400 mt-1">${item.rarity === 'rare' ? 'Rare' : 'Common'} Consumable</div> </div> `; } else { // Player card const isSpecial = item.rating >= 88; if (isSpecial) { card.className += ' special-card'; } else if (item.isRare) { card.className += ' border border-yellow-500'; } else { card.className += ' border border-gray-700'; } // Determine position color let positionColor = 'text-gray-400'; if (item.position === 'GK') positionColor = 'text-blue-400'; else if (['CB', 'LB', 'RB', 'LCB', 'RCB'].includes(item.position)) positionColor = 'text-green-400'; else if (['CM', 'LM', 'RM', 'LCM', 'RCM', 'CDM'].includes(item.position)) positionColor = 'text-yellow-400'; else if (['ST', 'LW', 'RW', 'LS', 'RS'].includes(item.position)) positionColor = 'text-red-400'; card.innerHTML = ` <div class="relative"> <div class="absolute top-2 left-2 w-8 h-8 rounded-full flex items-center justify-center ${isSpecial ? 'bg-black' : 'rating-gradient'} shadow-md"> <span class="font-bold text-white">${item.rating}</span> </div> <div class="h-32 bg-gray-700 flex items-center justify-center relative overflow-hidden"> <i class="fas fa-user text-5xl text-gray-600"></i> ${isSpecial ? '<div class="absolute inset-0 bg-gradient-to-br from-transparent via-transparent to-black opacity-30"></div>' : ''} </div> </div> <div class="p-3"> <h4 class="font-bold truncate">${item.name}</h4> <div class="flex justify-between text-xs mt-1"> <span class="${positionColor}">${item.position}</span> <span class="text-gray-400">${item.club}</span> </div> <div class="flex justify-between text-xs mt-1"> <span class="text-gray-400">${item.nation}</span> ${isPackItem ? '<span class="text-yellow-400 font-bold">NEW</span>' : ''} </div> </div> `; } if (isPackItem) { card.addEventListener('click', () => { card.classList.toggle('ring-2'); card.classList.toggle('ring-yellow-400'); card.classList.toggle('transform'); card.classList.toggle('scale-105'); }); } else { card.addEventListener('click', () => { addPlayerToSquad(item); }); } return card; } // Add to Club addToClubBtn.addEventListener('click', () => { // Add animation to button addToClubBtn.classList.add('animate-pulse'); setTimeout(() => { const playersAdded = packItems.filter(i => i.type !== 'consumable').length; packItems.forEach(item => { if (item.type !== 'consumable') { userClub.push(item); } }); updatePlayerList(); packResults.classList.add('hidden'); // Show notification const notification = document.createElement('div'); notification.className = 'fixed bottom-4 right-4 bg-green-600 text-white px-4 py-2 rounded-lg shadow-lg flex items-center animate-bounce'; notification.innerHTML = ` <i class="fas fa-check-circle mr-2"></i> <span>${playersAdded} players added to your club!</span> `; document.body.appendChild(notification); setTimeout(() => { notification.classList.add('opacity-0', 'transition-opacity', 'duration-500'); setTimeout(() => notification.remove(), 500); }, 3000); addToClubBtn.classList.remove('animate-pulse'); }, 500); }); // Player List and Squad Management function updatePlayerList(filter = 'all') { playerList.innerHTML = ''; let filteredPlayers = userClub; if (filter === 'GK') { filteredPlayers = userClub.filter(p => p.position === 'GK'); } else if (filter === 'DEF') { filteredPlayers = userClub.filter(p => ['LB', 'CB', 'RB', 'LCB', 'RCB'].includes(p.position)); } else if (filter === 'MID') { filteredPlayers = userClub.filter(p => ['LM', 'CM', 'RM', 'LCM', 'RCM', 'CDM'].includes(p.position)); } else if (filter === 'ATT') { filteredPlayers = userClub.filter(p => ['ST', 'LW', 'RW', 'LS', 'RS'].includes(p.position)); } if (filteredPlayers.length === 0) { playerList.innerHTML = ` <div class="text-center py-8 text-gray-500"> <i class="fas fa-users text-4xl mb-2 opacity-30"></i> <p>No players found in this category.</p> </div> `; return; } // Sort by rating (highest first) filteredPlayers.sort((a, b) => b.rating - a.rating); filteredPlayers.forEach(player => { const playerElement = createCardElement(player); playerList.appendChild(playerElement); }); } positionFilter.addEventListener('change', () => { updatePlayerList(positionFilter.value); }); function addPlayerToSquad(player) { // Determine the best position for this player let position; if (player.position === 'GK') { position = 'GK'; } else if (['LB', 'LWB'].includes(player.position)) { position = 'LB'; } else if (['CB'].includes(player.position)) { // Check which CB position is empty position = userSquad.LCB === null ? 'LCB' : 'RCB'; } else if (['RB', 'RWB'].includes(player.position)) { position = 'RB'; } else if (['LM', 'LW'].includes(player.position)) { position = 'LM'; } else if (['CM', 'CAM', 'CDM'].includes(player.position)) { // Check which CM position is empty position = userSquad.LCM === null ? 'LCM' : 'RCM'; } else if (['RM', 'RW'].includes(player.position)) { position = 'RM'; } else if (['ST', 'CF'].includes(player.position)) { // Check which ST position is empty position = userSquad.LS === null ? 'LS' : 'RS'; } // If position is still not determined, find first available if (!position) { for (const pos in userSquad) { if (userSquad[pos] === null) { position = pos; break; } } } if (position) { // If there's already a player in this position, return them to club if (userSquad[position]) { userClub.push(userSquad[position]); // Show notification const notification = document.createElement('div'); notification.className = 'fixed bottom-4 right-4 bg-blue-600 text-white px-4 py-2 rounded-lg shadow-lg flex items-center'; notification.innerHTML = ` <i class="fas fa-exchange-alt mr-2"></i> <span>${userSquad[position].name} returned to club</span> `; document.body.appendChild(notification); setTimeout(() => { notification.classList.add('opacity-0', 'transition-opacity', 'duration-500'); setTimeout(() => notification.remove(), 500); }, 2000); } // Add new player to squad userSquad[position] = player; // Remove from club userClub = userClub.filter(p => p.id !== player.id); // Update displays updatePlayerList(positionFilter.value); renderSquad(); calculateSquadStats(); // Show notification const notification = document.createElement('div'); notification.className = 'fixed bottom-4 right-4 bg-green-600 text-white px-4 py-2 rounded-lg shadow-lg flex items-center'; notification.innerHTML = ` <i class="fas fa-check-circle mr-2"></i> <span>${player.name} added to ${position}</span> `; document.body.appendChild(notification); setTimeout(() => { notification.classList.add('opacity-0', 'transition-opacity', 'duration-500'); setTimeout(() => notification.remove(), 500); }, 2000); } else { // Shake animation for full squad const squadTab = document.getElementById('squadTab'); squadTab.classList.add('animate-shake'); setTimeout(() => { squadTab.classList.remove('animate-shake'); }, 500); // Show notification const notification = document.createElement('div'); notification.className = 'fixed bottom-4 right-4 bg-red-600 text-white px-4 py-2 rounded-lg shadow-lg flex items-center'; notification.innerHTML = ` <i class="fas fa-exclamation-triangle mr-2"></i> <span>Your squad is full! Remove a player first.</span> `; document.body.appendChild(notification); setTimeout(() => { notification.classList.add('opacity-0', 'transition-opacity', 'duration-500'); setTimeout(() => notification.remove(), 500); }, 3000); } } function renderSquad() { // Clear all player slots document.querySelectorAll('.player-slot').forEach(slot => { slot.innerHTML = ''; }); // Add players to their positions for (const position in userSquad) { if (userSquad[position]) { const player = userSquad[position]; const slot = document.getElementById(position.toLowerCase()); const playerBadge = document.createElement('div'); playerBadge.className = 'player-badge bg-gradient-to-br from-gray-800 to-gray-900 rounded-full w-12 h-12 flex items-center justify-center text-xs font-bold relative cursor-pointer shadow-md'; // Determine position color let positionColor = 'text-gray-400'; if (player.position === 'GK') positionColor = 'text-blue-400'; else if (['CB', 'LB', 'RB', 'LCB', 'RCB'].includes(player.position)) positionColor = 'text-green-400'; else if (['CM', 'LM', 'RM', 'LCM', 'RCM', 'CDM'].includes(player.position)) positionColor = 'text-yellow-400'; else if (['ST', 'LW', 'RW', 'LS', 'RS'].includes(player.position)) positionColor = 'text-red-400'; playerBadge.innerHTML = ` <div class="absolute -top-1 -right-1 w-5 h-5 rounded-full ${player.rating >= 88 ? 'special-card' : 'rating-gradient'} flex items-center justify-center text-xs shadow-sm"> ${player.rating} </div> <span class="${positionColor}">${player.name.split(' ').pop().charAt(0)}.${player.name.split(' ')[0]}</span> `; playerBadge.addEventListener('click', () => { // Return player to club userClub.push(userSquad[position]); userSquad[position] = null; // Update displays updatePlayerList(positionFilter.value); renderSquad(); calculateSquadStats(); }); slot.appendChild(playerBadge); } } } function calculateSquadStats() { // Calculate average rating let totalRating = 0; let playerCount = 0; for (const position in userSquad) { if (userSquad[position]) { totalRating += userSquad[position].rating; playerCount++; } } const avgRating = playerCount > 0 ? Math.round(totalRating / playerCount) : 0; squadRating.textContent = avgRating; // Simple chemistry calculation (just for demo) let chemistry = 0; if (playerCount >= 7) { chemistry = Math.min(100, Math.floor(Math.random() * 30) + 70); } else if (playerCount >= 4) { chemistry = Math.floor(Math.random() * 30) + 40; } else if (playerCount > 0) { chemistry = Math.floor(Math.random() * 40); } squadChemistry.textContent = chemistry; } // Auto Squad and Clear autoSquadBtn.addEventListener('click', () => { // Clear current squad for (const position in userSquad) { if (userSquad[position]) { userClub.push(userSquad[position]); userSquad[position] = null; } } // Get best players for each position const positions = { GK: ['GK'], LB: ['LB', 'LWB'], LCB: ['CB'], RCB: ['CB'], RB: ['RB', 'RWB'], LM: ['LM', 'LW'], LCM: ['CM', 'CAM', 'CDM'], RCM: ['CM', 'CAM', 'CDM'], RM: ['RM', 'RW'], LS: ['ST', 'CF'], RS: ['ST', 'CF'] }; for (const position in positions) { const eligiblePositions = positions[position]; const eligiblePlayers = userClub.filter(p => eligiblePositions.includes(p.position)); if (eligiblePlayers.length > 0) { // Sort by rating and take the highest eligiblePlayers.sort((a, b) => b.rating - a.rating); const bestPlayer = eligiblePlayers[0]; // Add to squad userSquad[position] = bestPlayer; // Remove from club userClub = userClub.filter(p => p.id !== bestPlayer.id); } } // Update displays updatePlayerList(positionFilter.value); renderSquad(); calculateSquadStats(); // Show notification const notification = document.createElement('div'); notification.className = 'fixed bottom-4 right-4 bg-blue-600 text-white px-4 py-2 rounded-lg shadow-lg flex items-center'; notification.innerHTML = ` <i class="fas fa-magic mr-2"></i> <span>Auto squad built with your best players!</span> `; document.body.appendChild(notification); setTimeout(() => { notification.classList.add('opacity-0', 'transition-opacity', 'duration-500'); setTimeout(() => notification.remove(), 500); }, 3000); }); clearSquadBtn.addEventListener('click', () => { // Return all players to club for (const position in userSquad) { if (userSquad[position]) { userClub.push(userSquad[position]); userSquad[position] = null; } } // Update displays updatePlayerList(positionFilter.value); renderSquad(); calculateSquadStats(); // Show notification const notification = document.createElement('div'); notification.className = 'fixed bottom-4 right-4 bg-red-600 text-white px-4 py-2 rounded-lg shadow-lg flex items-center'; notification.innerHTML = ` <i class="fas fa-trash mr-2"></i> <span>Squad cleared! All players returned to club.</span> `; document.body.appendChild(notification); setTimeout(() => { notification.classList.add('opacity-0', 'transition-opacity', 'duration-500'); setTimeout(() => notification.remove(), 500); }, 3000); }); // Game Simulation function updateTeamRatings() { // Calculate user team rating let totalRating = 0; let playerCount = 0; for (const position in userSquad) { if (userSquad[position]) { totalRating += userSquad[position].rating; playerCount++; } } const userRating = playerCount > 0 ? Math.round(totalRating / playerCount) : 0; userTeamRating.textContent = userRating; // Get AI difficulty const aiDifficulty = parseInt(document.getElementById('aiDifficulty').value); aiTeamRating.textContent = aiDifficulty; } // Tactics Buttons defensiveBtn.addEventListener('click', () => { currentTactic = "defensive"; defensiveBtn.classList.add('bg-blue-600'); balancedBtn.classList.remove('bg-green-600'); attackingBtn.classList.remove('bg-red-600'); addCommentary("Changed to defensive tactics"); }); balancedBtn.addEventListener('click', () => { currentTactic = "balanced"; balancedBtn.classList.add('bg-green-600'); defensiveBtn.classList.remove('bg-blue-600'); attackingBtn.classList.remove('bg-red-600'); addCommentary("Changed to balanced tactics"); }); attackingBtn.addEventListener('click', () => { currentTactic = "attacking"; attackingBtn.classList.add('bg-red-600'); defensiveBtn.classList.remove('bg-blue-600'); balancedBtn.classList.remove('bg-green-600'); addCommentary("Changed to attacking tactics"); }); // Match Simulation startGameBtn.addEventListener('click', () => { // Check if squad is complete let squadComplete = true; for (const position in userSquad) { if (!userSquad[position]) { squadComplete = false; break; } } if (!squadComplete) { // Shake animation startGameBtn.classList.add('animate-shake'); setTimeout(() => { startGameBtn.classList.remove('animate-shake'); }, 500); // Show notification const notification = document.createElement('div'); notification.className = 'fixed bottom-4 right-4 bg-red-600 text-white px-4 py-2 rounded-lg shadow-lg flex items-center'; notification.innerHTML = ` <i class="fas fa-exclamation-triangle mr-2"></i> <span>Your squad is incomplete! Fill all positions.</span> `; document.body.appendChild(notification); setTimeout(() => { notification.classList.add('opacity-0', 'transition-opacity', 'duration-500'); setTimeout(() => notification.remove(), 500); }, 3000); return; } // Start match matchInProgress = true; matchStats = { userShots: 0, aiShots: 0, userPossession: 50, userScore: 0, aiScore: 0, gameTime: 0 }; // Update UI document.getElementById('gameplay-screen').classList.add('hidden'); matchSimulation.classList.remove('hidden'); commentaryFeed.innerHTML = '<div class="commentary-entry text-gray-300">Match about to begin...</div>'; userTeamScore.textContent = '0'; aiTeamScore.textContent = '0'; gameClock.textContent = '0:00'; momentumBar.style.width = '50%'; momentumBar.style.left = '25%'; // Set initial tactics balancedBtn.click(); }); function addCommentary(text) { const entry = document.createElement('div'); entry.className = 'commentary-entry text-gray-300'; entry.textContent = text; commentaryFeed.prepend(entry); // Limit to 10 entries if (commentaryFeed.children.length > 10) { commentaryFeed.removeChild(commentaryFeed.lastChild); } } simulateMatchBtn.addEventListener('click', () => { if (!matchInProgress) return; const gameLength = parseInt(document.getElementById('gameLength').value) * 60; const aiDifficulty = parseInt(document.getElementById('aiDifficulty').value); const userRating = parseInt(userTeamRating.textContent); // Simulate match progress const interval = setInterval(() => { if (matchStats.gameTime >= gameLength) { clearInterval(interval); endMatch(); return; } // Increment game time matchStats.gameTime += 15; const minutes = Math.floor(matchStats.gameTime / 60); const seconds = matchStats.gameTime % 60; gameClock.textContent = `${minutes}:${seconds.toString().padStart(2, '0')}`; // Update momentum let momentumChange = 0; if (currentTactic === "defensive") { momentumChange = -5 + Math.random() * 10; } else if (currentTactic === "attacking") { momentumChange = -10 + Math.random() * 20; } else { momentumChange = -7 + Math.random() * 14; } matchStats.userPossession = Math.max(30, Math.min(70, matchStats.userPossession + momentumChange)); momentumBar.style.width = `${Math.abs(matchStats.userPossession - 50) * 2}%`; momentumBar.style.left = `${matchStats.userPossession < 50 ? 50 - (50 - matchStats.userPossession) * 2 : 50}%`; // Simulate events if (Math.random() * 100 < 10) { // Chance for a shot if (matchStats.userPossession > 50) { matchStats.userShots++; addCommentary(`${userSquad.LS ? userSquad.LS.name.split(' ')[0] : 'Striker'} shoots...`); if (Math.random() * 100 < (15 + (userRating - aiDifficulty) / 2)) { // Goal! matchStats.userScore++; userTeamScore.textContent = matchStats.userScore; showGoalCelebration(true); addCommentary(`GOAL!!! ${userSquad.LS ? userSquad.LS.name : 'Striker'} scores!`); } else { addCommentary("Saved by the keeper!"); } } else { matchStats.aiShots++; addCommentary("AI team attacks..."); if (Math.random() * 100 < (15 - (userRating - aiDifficulty) / 2)) { // Goal! matchStats.aiScore++; aiTeamScore.textContent = matchStats.aiScore; showGoalCelebration(false); addCommentary("GOAL!!! AI team scores!"); } else { addCommentary(`${userSquad.GK ? userSquad.GK.name.split(' ')[0] : 'Keeper'} makes a save!`); } } } else if (Math.random() * 100 < 5) { // Other match events const events = [ "Free kick awarded", "Corner kick", "Throw in", "Foul committed", "Offside call", "Great tackle!", "Counter attack opportunity", "Player down injured", "Substitution being prepared", "Spectacular save!" ]; addCommentary(events[Math.floor(Math.random() * events.length)]); } }, 200); }); function showGoalCelebration(isUserGoal) { goalCelebration.classList.remove('hidden'); const goalText = goalCelebration.querySelector('.goal-text'); goalText.textContent = isUserGoal ? "GOAL!" : "CONCEDED!"; goalText.className = isUserGoal ? "goal-text text-blue-400" : "goal-text text-red-400"; setTimeout(() => { goalCelebration.classList.add('hidden'); }, 2000); } function endMatch() { matchInProgress = false; matchSimulation.classList.add('hidden'); matchResult.classList.remove('hidden'); finalUserScore.textContent = matchStats.userScore; finalAiScore.textContent = matchStats.aiScore; // Calculate coins earned const baseCoins = 500; const winBonus = matchStats.userScore > matchStats.aiScore ? 500 : 0; const goalBonus = matchStats.userScore * 100; const ratingBonus = parseInt(userTeamRating.textContent) * 10; const totalCoins = baseCoins + winBonus + goalBonus + ratingBonus; coins += totalCoins; coinsDisplay.textContent = coins.toLocaleString(); // Set result message if (matchStats.userScore > matchStats.aiScore) { resultMessage.textContent = `Victory! Earned ${totalCoins} coins`; resultMessage.className = "text-xl mb-6 text-green-400"; } else if (matchStats.userScore < matchStats.aiScore) { resultMessage.textContent = `Defeat! Earned ${totalCoins} coins`; resultMessage.className = "text-xl mb-6 text-red-400"; } else { resultMessage.textContent = `Draw! Earned ${totalCoins} coins`; resultMessage.className = "text-xl mb-6 text-yellow-400"; } } playAgainBtn.addEventListener('click', () => { matchResult.classList.add('hidden'); document.getElementById('gameplay-screen').classList.remove('hidden'); }); backToSquadBtn.addEventListener('click', () => { matchResult.classList.add('hidden'); document.getElementById('squadTab').click(); }); function saveGameState() { localStorage.setItem('userClub', JSON.stringify(userClub)); localStorage.setItem('userSquad', JSON.stringify(userSquad)); localStorage.setItem('coins', coins.toString()); } // Reset Game Button document.getElementById('resetGameBtn').addEventListener('click', () => { if (confirm('Are you sure you want to reset your game progress?')) { localStorage.clear(); userClub = []; userSquad = { GK: null, LB: null, LCB: null, RCB: null, RB: null, LM: null, LCM: null, RCM: null, RM: null, LS: null, RS: null }; coins = 25000; updatePlayerList(); renderSquad(); calculateSquadStats(); coinsDisplay.textContent = coins.toLocaleString(); } }); // Initialize initTabIndicator(); updatePlayerList(); renderSquad(); calculateSquadStats(); <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=b85701/ok" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> </html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FC25 Ultimate Team</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
@keyframes cardReveal {
0% { transform: rotateY(0deg); opacity: 0; }
50% { transform: rotateY(90deg); opacity: 0.5; }
100% { transform: rotateY(0deg); opacity: 1; }
}
@keyframes packOpen {
0% { transform: scale(1); }
25% { transform: scale(1.2); }
50% { transform: scale(0.8); }
75% { transform: scale(1.1); }
100% { transform: scale(1); }
}
@keyframes glow {
0% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
}
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.05); }
100% { transform: scale(1); }
}
@keyframes float {
0% { transform: translateY(0px); }
50% { transform: translateY(-10px); }
100% { transform: translateY(0px); }
}
.card-reveal {
animation: cardReveal 0.8s ease-in-out;
}
.pack-open {
animation: packOpen 0.8s ease-in-out;
}
.glow {
animation: glow 2s infinite;
}
.pulse {
animation: pulse 2s infinite;
}
.float {
animation: float 3s ease-in-out infinite;
}
@keyframes shake {
0%, 100% { transform: translateX(0); }
10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
20%, 40%, 60%, 80% { transform: translateX(5px); }
}
.animate-shake {
animation: shake 0.5s ease-in-out;
}
.pitch-bg {
background: linear-gradient(135deg, #1a5e1a 0%, #0e3a0e 100%);
background-image:
linear-gradient(to right, rgba(255,255,255,0.1) 1px, transparent 1px),
linear-gradient(to bottom, rgba(255,255,255,0.1) 1px, transparent 1px);
background-size: 50px 50px;
}
.player-card {
transition: all 0.3s ease;
perspective: 1000px;
}
.player-card:hover {
transform: translateY(-5px) scale(1.03);
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}
.rating-gradient {
background: linear-gradient(135deg, #f5af19 0%, #f12711 100%);
}
.special-card {
background: linear-gradient(135deg, #12c2e9 0%, #c471ed 50%, #f64f59 100%);
position: relative;
overflow: hidden;
}
.special-card::before {