Download index.html from andreziba/teste: direct link, hf CLI and curl.
- Browser
- Download file 71.8 kB
-
https://huggingface.co/spaces/andreziba/teste/resolve/main/index.html
- Command line
-
hf download hf://spaces/andreziba/teste/index.html
-
curl -L -o index.html https://huggingface.co/spaces/andreziba/teste/resolve/main/index.html
71.8 kB
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Brassfoot Brasil - Gestão de Clubes</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>
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');
body {
font-family: 'Montserrat', sans-serif;
background-color: #f5f5f5;
color: #333;
}
.club-badge {
transition: transform 0.3s ease;
}
.club-badge:hover {
transform: scale(1.1);
}
.player-card {
transition: all 0.3s ease;
}
.player-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.progress-bar {
height: 8px;
border-radius: 4px;
background-color: #e5e7eb;
}
.progress-fill {
height: 100%;
border-radius: 4px;
transition: width 0.5s ease;
}
.match-result {
animation: fadeIn 0.5s ease;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
animation: fadeIn 0.3s ease;
}
</style>
</head>
<body class="min-h-screen bg-gray-100">
<!-- Main Container -->
<div class="container mx-auto px-4 py-8 max-w-6xl">
<!-- Header -->
<header class="mb-12 text-center">
<h1 class="text-4xl font-bold text-blue-800 mb-2">BRASSFOOT BRASIL</h1>
<p class="text-lg text-gray-600">O simulador de gestão de clubes brasileiros</p>
</header>
<!-- Game Container -->
<div id="game-container">
<!-- Main Menu Screen -->
<div id="main-menu" class="bg-white rounded-xl shadow-lg p-8 text-center">
<div class="mb-10">
<img src="https://via.placeholder.com/150x150" alt="Brassfoot Logo" class="mx-auto mb-6 rounded-full border-4 border-blue-500">
<h2 class="text-2xl font-bold mb-4">Bem-vindo ao Brassfoot Brasil</h2>
<p class="text-gray-600 mb-8">Gerencie seu clube favorito e leve-o ao topo do futebol brasileiro!</p>
</div>
<div class="flex flex-col space-y-4 max-w-md mx-auto">
<button id="new-career-btn" class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-6 rounded-lg transition duration-300">
<i class="fas fa-plus-circle mr-2"></i> Nova Carreira
</button>
<button id="load-career-btn" class="bg-gray-200 hover:bg-gray-300 text-gray-800 font-bold py-3 px-6 rounded-lg transition duration-300">
<i class="fas fa-folder-open mr-2"></i> Carregar Jogo
</button>
<button id="settings-btn" class="bg-gray-200 hover:bg-gray-300 text-gray-800 font-bold py-3 px-6 rounded-lg transition duration-300">
<i class="fas fa-cog mr-2"></i> Configurações
</button>
</div>
</div>
<!-- Club Selection Screen -->
<div id="club-selection" class="hidden bg-white rounded-xl shadow-lg p-8">
<div class="flex justify-between items-center mb-8">
<h2 class="text-2xl font-bold">Escolha seu clube</h2>
<button id="back-to-menu" class="text-blue-600 hover:text-blue-800">
<i class="fas fa-arrow-left mr-1"></i> Voltar
</button>
</div>
<div class="mb-6">
<div class="relative">
<input type="text" id="club-search" placeholder="Pesquisar clube..." class="w-full p-3 pl-10 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
<i class="fas fa-search absolute left-3 top-3.5 text-gray-400"></i>
</div>
</div>
<div id="club-grid" class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4">
<!-- Clubs will be populated here by JavaScript -->
</div>
</div>
<!-- Main Game Screen -->
<div id="main-game" class="hidden">
<!-- Club Header -->
<div class="bg-white rounded-xl shadow-lg p-6 mb-6 flex items-center justify-between">
<div class="flex items-center">
<img id="club-logo" src="https://via.placeholder.com/80x80" alt="Club Logo" class="w-16 h-16 mr-4">
<div>
<h2 id="club-name" class="text-2xl font-bold">Clube</h2>
<div class="flex items-center text-sm text-gray-600">
<span id="club-finances" class="mr-4"><i class="fas fa-coins mr-1"></i> R$ 10.000.000</span>
<span id="club-reputation"><i class="fas fa-star mr-1"></i> 3.5/5</span>
</div>
</div>
</div>
<div class="text-right">
<div class="text-sm text-gray-500 mb-1">Temporada</div>
<div id="season" class="text-xl font-bold">2025</div>
</div>
</div>
<!-- Navigation Tabs -->
<div class="mb-6">
<div class="flex overflow-x-auto border-b border-gray-200">
<button class="tab-btn active px-6 py-3 font-medium text-sm border-b-2 border-blue-500 text-blue-600" data-tab="dashboard">
<i class="fas fa-home mr-2"></i> Início
</button>
<button class="tab-btn px-6 py-3 font-medium text-sm text-gray-500 hover:text-gray-700" data-tab="squad">
<i class="fas fa-users mr-2"></i> Elenco
</button>
<button class="tab-btn px-6 py-3 font-medium text-sm text-gray-500 hover:text-gray-700" data-tab="transfers">
<i class="fas fa-exchange-alt mr-2"></i> Transferências
</button>
<button class="tab-btn px-6 py-3 font-medium text-sm text-gray-500 hover:text-gray-700" data-tab="fixtures">
<i class="fas fa-calendar-alt mr-2"></i> Jogos
</button>
<button class="tab-btn px-6 py-3 font-medium text-sm text-gray-500 hover:text-gray-700" data-tab="league">
<i class="fas fa-trophy mr-2"></i> Campeonatos
</button>
</div>
</div>
<!-- Tab Contents -->
<div class="bg-white rounded-xl shadow-lg p-6">
<!-- Dashboard Tab -->
<div id="dashboard" class="tab-content active">
<h3 class="text-xl font-bold mb-4">Visão Geral</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
<!-- Next Match -->
<div class="bg-blue-50 rounded-lg p-4">
<h4 class="font-bold text-blue-800 mb-3">Próximo Jogo</h4>
<div class="flex items-center justify-between">
<div class="text-center">
<div id="next-match-home" class="font-bold">SEU TIME</div>
<img id="next-match-home-logo" src="https://via.placeholder.com/60x60" alt="Home Team" class="mx-auto my-2">
</div>
<div class="text-center mx-4">
<div id="next-match-date" class="text-sm text-gray-500">Sábado, 15/03</div>
<div id="next-match-time" class="text-2xl font-bold my-1">20:00</div>
<div id="next-match-venue" class="text-sm">Maracanã</div>
</div>
<div class="text-center">
<div id="next-match-away" class="font-bold">ADVERSÁRIO</div>
<img id="next-match-away-logo" src="https://via.placeholder.com/60x60" alt="Away Team" class="mx-auto my-2">
</div>
</div>
<button id="play-next-match" class="mt-3 w-full bg-blue-600 hover:bg-blue-700 text-white py-2 rounded-lg">
<i class="fas fa-play mr-2"></i> Jogar Partida
</button>
</div>
<!-- Recent Form -->
<div class="bg-gray-50 rounded-lg p-4">
<h4 class="font-bold text-gray-800 mb-3">Últimos Resultados</h4>
<div id="recent-results" class="space-y-2">
<div class="flex justify-between items-center p-2 bg-white rounded">
<div class="flex items-center">
<span class="w-6 text-center font-bold">V</span>
<span class="ml-2">3-1</span>
</div>
<span class="text-sm text-gray-600">vs Flamengo</span>
</div>
<div class="flex justify-between items-center p-2 bg-white rounded">
<div class="flex items-center">
<span class="w-6 text-center font-bold">E</span>
<span class="ml-2">1-1</span>
</div>
<span class="text-sm text-gray-600">vs Palmeiras</span>
</div>
<div class="flex justify-between items-center p-2 bg-white rounded">
<div class="flex items-center">
<span class="w-6 text-center font-bold">D</span>
<span class="ml-2">0-2</span>
</div>
<span class="text-sm text-gray-600">vs Atlético-MG</span>
</div>
</div>
</div>
</div>
<!-- Competitions -->
<h4 class="font-bold text-lg mb-3">Competições</h4>
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-6">
<div class="bg-white border border-gray-200 rounded-lg p-4 shadow-sm">
<div class="flex items-center mb-2">
<img src="https://via.placeholder.com/40x40" alt="Brasileirão" class="w-8 h-8 mr-2">
<h5 class="font-bold">Brasileirão Série A</h5>
</div>
<div id="league-position" class="text-sm text-gray-600 mb-2">5ª posição - 12 pontos</div>
<div class="progress-bar">
<div id="league-progress" class="progress-fill bg-green-500" style="width: 60%"></div>
</div>
</div>
<div class="bg-white border border-gray-200 rounded-lg p-4 shadow-sm">
<div class="flex items-center mb-2">
<img src="https://via.placeholder.com/40x40" alt="Copa do Brasil" class="w-8 h-8 mr-2">
<h5 class="font-bold">Copa do Brasil</h5>
</div>
<div id="cup-stage" class="text-sm text-gray-600 mb-2">Oitavas de final</div>
<div class="progress-bar">
<div id="cup-progress" class="progress-fill bg-blue-500" style="width: 30%"></div>
</div>
</div>
<div class="bg-white border border-gray-200 rounded-lg p-4 shadow-sm">
<div class="flex items-center mb-2">
<img src="https://via.placeholder.com/40x40" alt="Libertadores" class="w-8 h-8 mr-2">
<h5 class="font-bold">Libertadores</h5>
</div>
<div id="libertadores-stage" class="text-sm text-gray-600 mb-2">Fase de grupos</div>
<div class="progress-bar">
<div id="libertadores-progress" class="progress-fill bg-yellow-500" style="width: 20%"></div>
</div>
</div>
</div>
<!-- News -->
<h4 class="font-bold text-lg mb-3">Notícias do Clube</h4>
<div id="club-news" class="bg-gray-50 rounded-lg p-4">
<div class="mb-4 pb-4 border-b border-gray-200">
<h5 class="font-bold text-blue-600">Jogador se destaca</h5>
<p class="text-sm">Pedro Henrique marcou 3 gols nos últimos 2 jogos e está na artilharia do campeonato.</p>
</div>
<div class="mb-4 pb-4 border-b border-gray-200">
<h5 class="font-bold text-blue-600">Torcida lota estádio</h5>
<p class="text-sm">Último jogo teve público recorde da temporada com 45.000 presentes.</p>
</div>
<div>
<h5 class="font-bold text-blue-600">Contratação em vista</h5>
<p class="text-sm">Diretoria negocia com volante do Internacional para reforçar o meio-campo.</p>
</div>
</div>
</div>
<!-- Squad Tab -->
<div id="squad" class="tab-content">
<div class="flex justify-between items-center mb-6">
<h3 class="text-xl font-bold">Elenco</h3>
<div class="flex space-x-2">
<button class="bg-blue-100 text-blue-600 px-3 py-1 rounded-lg text-sm">
<i class="fas fa-plus mr-1"></i> Promover da Base
</button>
<button class="bg-gray-100 text-gray-600 px-3 py-1 rounded-lg text-sm">
<i class="fas fa-filter mr-1"></i> Filtrar
</button>
</div>
</div>
<!-- Position Tabs -->
<div class="mb-6">
<div class="flex overflow-x-auto">
<button class="position-tab active px-4 py-2 font-medium text-sm border-b-2 border-blue-500 text-blue-600" data-position="all">
Todos
</button>
<button class="position-tab px-4 py-2 font-medium text-sm text-gray-500 hover:text-gray-700" data-position="gk">
Goleiros
</button>
<button class="position-tab px-4 py-2 font-medium text-sm text-gray-500 hover:text-gray-700" data-position="df">
Defensores
</button>
<button class="position-tab px-4 py-2 font-medium text-sm text-gray-500 hover:text-gray-700" data-position="mf">
Meio-campistas
</button>
<button class="position-tab px-4 py-2 font-medium text-sm text-gray-500 hover:text-gray-700" data-position="fw">
Atacantes
</button>
</div>
</div>
<!-- Players Grid -->
<div id="players-grid" class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
<!-- Player cards will be populated here by JavaScript -->
</div>
</div>
<!-- Transfers Tab -->
<div id="transfers" class="tab-content">
<h3 class="text-xl font-bold mb-6">Mercado da Bola</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<!-- Transfer List -->
<div>
<h4 class="font-bold mb-4">Jogadores Disponíveis</h4>
<div id="transfer-list" class="bg-gray-50 rounded-lg p-4 max-h-96 overflow-y-auto">
<!-- Transfer players will be populated here by JavaScript -->
</div>
</div>
<!-- Transfer Offers -->
<div>
<h4 class="font-bold mb-4">Ofertas Recebidas</h4>
<div id="transfer-offers" class="bg-gray-50 rounded-lg p-4 max-h-96 overflow-y-auto">
<div class="mb-4 pb-4 border-b border-gray-200">
<div class="flex justify-between items-center mb-2">
<div class="font-bold">Gabriel Barbosa</div>
<div class="text-sm text-gray-600">Flamengo</div>
</div>
<div class="flex justify-between items-center text-sm">
<span>Oferta: R$ 15.000.000</span>
<div class="flex space-x-2">
<button class="bg-green-100 text-green-600 px-2 py-1 rounded text-xs">
Aceitar
</button>
<button class="bg-red-100 text-red-600 px-2 py-1 rounded text-xs">
Recusar
</button>
</div>
</div>
</div>
<div class="mb-4 pb-4 border-b border-gray-200">
<div class="flex justify-between items-center mb-2">
<div class="font-bold">Pedro Henrique</div>
<div class="text-sm text-gray-600">Atlético-MG</div>
</div>
<div class="flex justify-between items-center text-sm">
<span>Oferta: R$ 8.000.000</span>
<div class="flex space-x-2">
<button class="bg-green-100 text-green-600 px-2 py-1 rounded text-xs">
Aceitar
</button>
<button class="bg-red-100 text-red-600 px-2 py-1 rounded text-xs">
Recusar
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Fixtures Tab -->
<div id="fixtures" class="tab-content">
<h3 class="text-xl font-bold mb-6">Calendário de Jogos</h3>
<div class="mb-6">
<div class="flex overflow-x-auto">
<button class="competition-tab active px-4 py-2 font-medium text-sm border-b-2 border-blue-500 text-blue-600" data-competition="all">
Todos
</button>
<button class="competition-tab px-4 py-2 font-medium text-sm text-gray-500 hover:text-gray-700" data-competition="league">
Brasileirão
</button>
<button class="competition-tab px-4 py-2 font-medium text-sm text-gray-500 hover:text-gray-700" data-competition="cup">
Copa do Brasil
</button>
<button class="competition-tab px-4 py-2 font-medium text-sm text-gray-500 hover:text-gray-700" data-competition="libertadores">
Libertadores
</button>
</div>
</div>
<div id="fixtures-list" class="space-y-4">
<!-- Fixtures will be populated here by JavaScript -->
</div>
</div>
<!-- League Tab -->
<div id="league" class="tab-content">
<h3 class="text-xl font-bold mb-6">Campeonatos</h3>
<div class="mb-6">
<div class="flex overflow-x-auto">
<button class="league-tab active px-4 py-2 font-medium text-sm border-b-2 border-blue-500 text-blue-600" data-league="brasileirao">
Brasileirão
</button>
<button class="league-tab px-4 py-2 font-medium text-sm text-gray-500 hover:text-gray-700" data-league="copa">
Copa do Brasil
</button>
<button class="league-tab px-4 py-2 font-medium text-sm text-gray-500 hover:text-gray-700" data-league="libertadores">
Libertadores
</button>
<button class="league-tab px-4 py-2 font-medium text-sm text-gray-500 hover:text-gray-700" data-league="sulamericana">
Sul-Americana
</button>
</div>
</div>
<!-- League Table -->
<div class="mb-8">
<h4 class="font-bold mb-4">Classificação - Brasileirão Série A</h4>
<div class="bg-white border border-gray-200 rounded-lg overflow-hidden">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase">#</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase">Time</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase">P</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase">J</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase">V</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase">E</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase">D</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase">SG</th>
</tr>
</thead>
<tbody id="league-table-body" class="bg-white divide-y divide-gray-200">
<!-- League table will be populated here by JavaScript -->
</tbody>
</table>
</div>
</div>
<!-- Top Scorers -->
<div>
<h4 class="font-bold mb-4">Artilharia</h4>
<div class="bg-white border border-gray-200 rounded-lg overflow-hidden">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase">#</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase">Jogador</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase">Time</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase">Gols</th>
</tr>
</thead>
<tbody id="top-scorers-body" class="bg-white divide-y divide-gray-200">
<!-- Top scorers will be populated here by JavaScript -->
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- Match Simulation Screen -->
<div id="match-simulation" class="hidden bg-white rounded-xl shadow-lg p-8">
<div class="flex justify-between items-center mb-8">
<h2 class="text-2xl font-bold">Simulação de Partida</h2>
<button id="back-to-dashboard" class="text-blue-600 hover:text-blue-800">
<i class="fas fa-arrow-left mr-1"></i> Voltar
</button>
</div>
<div class="bg-gray-100 rounded-lg p-6 mb-6">
<div class="flex items-center justify-between mb-6">
<div class="text-center w-1/3">
<div class="font-bold text-lg" id="home-team-name">SEU TIME</div>
<img id="home-team-logo" src="https://via.placeholder.com/80x80" alt="Home Team" class="mx-auto my-3 club-badge">
</div>
<div class="text-center w-1/3">
<div class="text-sm text-gray-600 mb-1" id="match-date">Sábado, 15/03</div>
<div class="text-4xl font-bold my-2" id="match-score">0 - 0</div>
<div class="text-sm" id="match-venue">Maracanã</div>
</div>
<div class="text-center w-1/3">
<div class="font-bold text-lg" id="away-team-name">ADVERSÁRIO</div>
<img id="away-team-logo" src="https://via.placeholder.com/80x80" alt="Away Team" class="mx-auto my-3 club-badge">
</div>
</div>
<div class="text-center mb-6">
<div class="inline-block bg-blue-600 text-white px-4 py-2 rounded-full text-sm font-bold">
<span id="match-minute">0'</span> | <span id="match-status">1º Tempo</span>
</div>
</div>
<div class="bg-white rounded-lg p-4 mb-4">
<div class="font-bold text-sm mb-2">Últimos Acontecimentos</div>
<div id="match-events" class="text-sm space-y-1">
<div class="p-2 bg-gray-50 rounded">A partida começou!</div>
</div>
</div>
<div class="flex justify-center space-x-4">
<button id="play-match-btn" class="bg-green-600 hover:bg-green-700 text-white font-bold py-2 px-6 rounded-lg">
<i class="fas fa-play mr-2"></i> Simular Partida
</button>
<button id="fast-simulate-btn" class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-6 rounded-lg">
<i class="fas fa-forward mr-2"></i> Simular Rápido
</button>
</div>
</div>
<div id="match-result" class="hidden match-result bg-white border border-gray-200 rounded-lg p-6">
<h3 class="text-xl font-bold mb-4 text-center">Resultado Final</h3>
<div class="flex items-center justify-center mb-6">
<div class="text-center w-1/3">
<div class="font-bold text-xl" id="result-home-name">SEU TIME</div>
<div class="text-5xl font-bold my-3" id="result-home-score">0</div>
</div>
<div class="text-center w-1/3 text-2xl font-bold">
x
</div>
<div class="text-center w-1/3">
<div class="font-bold text-xl" id="result-away-name">ADVERSÁRIO</div>
<div class="text-5xl font-bold my-3" id="result-away-score">0</div>
</div>
</div>
<div class="bg-gray-50 rounded-lg p-4 mb-4">
<div class="font-bold text-sm mb-2">Resumo da Partida</div>
<div id="match-summary" class="text-sm space-y-1">
<!-- Match summary will be populated here by JavaScript -->
</div>
</div>
<div class="text-center">
<button id="continue-after-match" class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-6 rounded-lg">
Continuar <i class="fas fa-arrow-right ml-2"></i>
</button>
</div>
</div>
</div>
</div>
</div>
<script>
// Game Data
const clubs = [
{ id: 1, name: "Flamengo", shortName: "FLA", reputation: 5, finances: 50000000, stadium: "Maracanã" },
{ id: 2, name: "Palmeiras", shortName: "PAL", reputation: 5, finances: 45000000, stadium: "Allianz Parque" },
{ id: 3, name: "Atlético-MG", shortName: "CAM", reputation: 4.5, finances: 40000000, stadium: "Mineirão" },
{ id: 4, name: "Grêmio", shortName: "GRE", reputation: 4.5, finances: 38000000, stadium: "Arena do Grêmio" },
{ id: 5, name: "Fluminense", shortName: "FLU", reputation: 4, finances: 35000000, stadium: "Maracanã" },
{ id: 6, name: "São Paulo", shortName: "SAO", reputation: 4, finances: 35000000, stadium: "Morumbi" },
{ id: 7, name: "Internacional", shortName: "INT", reputation: 4, finances: 34000000, stadium: "Beira-Rio" },
{ id: 8, name: "Corinthians", shortName: "COR", reputation: 4, finances: 33000000, stadium: "Neo Química Arena" },
{ id: 9, name: "Santos", shortName: "SAN", reputation: 3.5, finances: 30000000, stadium: "Vila Belmiro" },
{ id: 10, name: "Botafogo", shortName: "BOT", reputation: 3.5, finances: 28000000, stadium: "Nilton Santos" },
{ id: 11, name: "Athletico-PR", shortName: "CAP", reputation: 3.5, finances: 27000000, stadium: "Arena da Baixada" },
{ id: 12, name: "Bahia", shortName: "BAH", reputation: 3, finances: 25000000, stadium: "Arena Fonte Nova" },
{ id: 13, name: "Vasco", shortName: "VAS", reputation: 3, finances: 24000000, stadium: "São Januário" },
{ id: 14, name: "Cruzeiro", shortName: "CRU", reputation: 3, finances: 23000000, stadium: "Mineirão" },
{ id: 15, name: "Ceará", shortName: "CEA", reputation: 2.5, finances: 20000000, stadium: "Castelão" },
{ id: 16, name: "Fortaleza", shortName: "FOR", reputation: 2.5, finances: 19000000, stadium: "Castelão" },
{ id: 17, name: "Goiás", shortName: "GOI", reputation: 2, finances: 18000000, stadium: "Serra Dourada" },
{ id: 18, name: "América-MG", shortName: "AME", reputation: 2, finances: 17000000, stadium: "Independência" },
{ id: 19, name: "Coritiba", shortName: "CFC", reputation: 1.5, finances: 16000000, stadium: "Couto Pereira" },
{ id: 20, name: "Bragantino", shortName: "RBB", reputation: 1.5, finances: 15000000, stadium: "Nabi Abi Chedid" }
];
const players = [
{ id: 1, name: "Pedro Henrique", age: 28, position: "fw", overall: 84, value: 15000000, team: 1 },
{ id: 2, name: "Gabriel Barbosa", age: 26, position: "fw", overall: 83, value: 14000000, team: 1 },
{ id: 3, name: "Giorgian de Arrascaeta", age: 28, position: "mf", overall: 85, value: 18000000, team: 1 },
{ id: 4, name: "Everton Ribeiro", age: 33, position: "mf", overall: 82, value: 10000000, team: 1 },
{ id: 5, name: "Filipe Luís", age: 37, position: "df", overall: 80, value: 5000000, team: 1 },
{ id: 6, name: "David Luiz", age: 36, position: "df", overall: 81, value: 6000000, team: 1 },
{ id: 7, name: "Hugo Souza", age: 23, position: "gk", overall: 78, value: 4000000, team: 1 },
{ id: 8, name: "Dudu", age: 30, position: "fw", overall: 84, value: 16000000, team: 2 },
{ id: 9, name: "Raphael Veiga", age: 27, position: "mf", overall: 83, value: 15000000, team: 2 },
{ id: 10, name: "Weverton", age: 34, position: "gk", overall: 85, value: 12000000, team: 2 },
{ id: 11, name: "Hulk", age: 36, position: "fw", overall: 86, value: 20000000, team: 3 },
{ id: 12, name: "Nacho Fernández", age: 32, position: "mf", overall: 83, value: 14000000, team: 3 },
{ id: 13, name: "Suárez", age: 35, position: "fw", overall: 85, value: 18000000, team: 4 },
{ id: 14, name: "Germán Cano", age: 34, position: "fw", overall: 84, value: 15000000, team: 5 },
{ id: 15, name: "Luciano", age: 29, position: "fw", overall: 82, value: 12000000, team: 6 },
{ id: 16, name: "Yuri Alberto", age: 22, position: "fw", overall: 81, value: 10000000, team: 8 },
{ id: 17, name: "Marcos Leonardo", age: 20, position: "fw", overall: 80, value: 8000000, team: 9 },
{ id: 18, name: "Tiquinho Soares", age: 31, position: "fw", overall: 82, value: 11000000, team: 10 },
{ id: 19, name: "Vitor Roque", age: 18, position: "fw", overall: 79, value: 7000000, team: 11 },
{ id: 20, name: "Everaldo", age: 27, position: "fw", overall: 78, value: 5000000, team: 12 },
// More players for transfer market
{ id: 21, name: "Gustavo Scarpa", age: 29, position: "mf", overall: 82, value: 12000000, team: null },
{ id: 22, name: "Gabriel Menino", age: 23, position: "df", overall: 80, value: 10000000, team: null },
{ id: 23, name: "Pedro", age: 26, position: "fw", overall: 83, value: 15000000, team: null },
{ id: 24, name: "Bruno Henrique", age: 32, position: "fw", overall: 82, value: 10000000, team: null },
{ id: 25, name: "Gerson", age: 26, position: "mf", overall: 84, value: 16000000, team: null }
];
const leagueTable = [
{ position: 1, team: "Palmeiras", played: 10, won: 8, drawn: 1, lost: 1, goalsFor: 22, goalsAgainst: 7, points: 25 },
{ position: 2, team: "Flamengo", played: 10, won: 7, drawn: 2, lost: 1, goalsFor: 20, goalsAgainst: 9, points: 23 },
{ position: 3, team: "Atlético-MG", played: 10, won: 6, drawn: 3, lost: 1, goalsFor: 18, goalsAgainst: 8, points: 21 },
{ position: 4, team: "Grêmio", played: 10, won: 6, drawn: 2, lost: 2, goalsFor: 17, goalsAgainst: 10, points: 20 },
{ position: 5, team: "Fluminense", played: 10, won: 5, drawn: 3, lost: 2, goalsFor: 15, goalsAgainst: 11, points: 18 },
{ position: 6, team: "São Paulo", played: 10, won: 5, drawn: 2, lost: 3, goalsFor: 14, goalsAgainst: 12, points: 17 },
{ position: 7, team: "Internacional", played: 10, won: 4, drawn: 4, lost: 2, goalsFor: 13, goalsAgainst: 10, points: 16 },
{ position: 8, team: "Corinthians", played: 10, won: 4, drawn: 3, lost: 3, goalsFor: 12, goalsAgainst: 11, points: 15 },
{ position: 9, team: "Santos", played: 10, won: 4, drawn: 2, lost: 4, goalsFor: 11, goalsAgainst: 12, points: 14 },
{ position: 10, team: "Botafogo", played: 10, won: 3, drawn: 4, lost: 3, goalsFor: 10, goalsAgainst: 11, points: 13 },
{ position: 11, team: "Athletico-PR", played: 10, won: 3, drawn: 3, lost: 4, goalsFor: 9, goalsAgainst: 12, points: 12 },
{ position: 12, team: "Bahia", played: 10, won: 3, drawn: 2, lost: 5, goalsFor: 8, goalsAgainst: 13, points: 11 },
{ position: 13, team: "Vasco", played: 10, won: 2, drawn: 4, lost: 4, goalsFor: 7, goalsAgainst: 14, points: 10 },
{ position: 14, team: "Cruzeiro", played: 10, won: 2, drawn: 3, lost: 5, goalsFor: 6, goalsAgainst: 15, points: 9 },
{ position: 15, team: "Ceará", played: 10, won: 1, drawn: 5, lost: 4, goalsFor: 5, goalsAgainst: 16, points: 8 },
{ position: 16, team: "Fortaleza", played: 10, won: 1, drawn: 4, lost: 5, goalsFor: 4, goalsAgainst: 17, points: 7 },
{ position: 17, team: "Goiás", played: 10, won: 1, drawn: 3, lost: 6, goalsFor: 3, goalsAgainst: 18, points: 6 },
{ position: 18, team: "América-MG", played: 10, won: 0, drawn: 5, lost: 5, goalsFor: 2, goalsAgainst: 19, points: 5 },
{ position: 19, team: "Coritiba", played: 10, won: 0, drawn: 3, lost: 7, goalsFor: 1, goalsAgainst: 20, points: 3 },
{ position: 20, team: "Bragantino", played: 10, won: 0, drawn: 2, lost: 8, goalsFor: 0, goalsAgainst: 21, points: 2 }
];
const topScorers = [
{ position: 1, name: "Hulk", team: "Atlético-MG", goals: 8 },
{ position: 2, name: "Germán Cano", team: "Fluminense", goals: 7 },
{ position: 3, name: "Gabriel Barbosa", team: "Flamengo", goals: 6 },
{ position: 4, name: "Dudu", team: "Palmeiras", goals: 5 },
{ position: 5, name: "Suárez", team: "Grêmio", goals: 5 },
{ position: 6, name: "Pedro Henrique", team: "Flamengo", goals: 4 },
{ position: 7, name: "Raphael Veiga", team: "Palmeiras", goals: 4 },
{ position: 8, name: "Luciano", team: "São Paulo", goals: 4 },
{ position: 9, name: "Tiquinho Soares", team: "Botafogo", goals: 3 },
{ position: 10, name: "Yuri Alberto", team: "Corinthians", goals: 3 }
];
const fixtures = [
{ id: 1, competition: "league", home: "Flamengo", away: "Palmeiras", date: "15/03/2025", time: "20:00", venue: "Maracanã", played: false, homeScore: null, awayScore: null },
{ id: 2, competition: "cup", home: "Flamengo", away: "Bahia", date: "20/03/2025", time: "19:30", venue: "Maracanã", played: false, homeScore: null, awayScore: null },
{ id: 3, competition: "libertadores", home: "Flamengo", away: "River Plate", date: "05/04/2025", time: "21:00", venue: "Maracanã", played: false, homeScore: null, awayScore: null },
{ id: 4, competition: "league", home: "Atlético-MG", away: "Flamengo", date: "12/04/2025", time: "16:00", venue: "Mineirão", played: false, homeScore: null, awayScore: null },
{ id: 5, competition: "league", home: "Flamengo", away: "São Paulo", date: "19/04/2025", time: "18:00", venue: "Maracanã", played: false, homeScore: null, awayScore: null },
{ id: 6, competition: "cup", home: "Athletico-PR", away: "Flamengo", date: "25/04/2025", time: "21:45", venue: "Arena da Baixada", played: false, homeScore: null, awayScore: null },
{ id: 7, competition: "league", home: "Flamengo", away: "Grêmio", date: "03/05/2025", time: "20:00", venue: "Maracanã", played: false, homeScore: null, awayScore: null },
{ id: 8, competition: "libertadores", home: "Boca Juniors", away: "Flamengo", date: "08/05/2025", time: "21:30", venue: "La Bombonera", played: false, homeScore: null, awayScore: null }
];
// Game State
let currentClub = null;
let currentView = "main-menu";
let matchInProgress = false;
let matchResult = null;
let currentFixture = null;
let matchInterval = null;
// DOM Elements
const gameContainer = document.getElementById('game-container');
const mainMenu = document.getElementById('main-menu');
const clubSelection = document.getElementById('club-selection');
const mainGame = document.getElementById('main-game');
const matchSimulation = document.getElementById('match-simulation');
const clubGrid = document.getElementById('club-grid');
const clubSearch = document.getElementById('club-search');
// Buttons
const newCareerBtn = document.getElementById('new-career-btn');
const loadCareerBtn = document.getElementById('load-career-btn');
const settingsBtn = document.getElementById('settings-btn');
const backToMenuBtn = document.getElementById('back-to-menu');
const backToDashboardBtn = document.getElementById('back-to-dashboard');
const playMatchBtn = document.getElementById('play-match-btn');
const fastSimulateBtn = document.getElementById('fast-simulate-btn');
const continueAfterMatchBtn = document.getElementById('continue-after-match');
const playNextMatchBtn = document.getElementById('play-next-match');
// Initialize the game
function initGame() {
// Render club selection
renderClubSelection();
// Set up event listeners
setupEventListeners();
}
// Render club selection screen
function renderClubSelection() {
clubGrid.innerHTML = '';
clubs.forEach(club => {
const clubElement = document.createElement('div');
clubElement.className = 'bg-white rounded-lg p-4 shadow-sm cursor-pointer club-badge hover:bg-blue-50 transition';
clubElement.innerHTML = `
<div class="text-center">
<img src="https://via.placeholder.com/80x80?text=${club.shortName}" alt="${club.name}" class="w-16 h-16 mx-auto mb-2">
<h3 class="font-bold">${club.shortName}</h3>
<div class="text-xs text-gray-600">${club.name}</div>
<div class="mt-2 flex justify-center items-center">
<span class="text-yellow-500 mr-1"><i class="fas fa-star"></i></span>
<span class="text-xs">${club.reputation}/5</span>
</div>
</div>
`;
clubElement.addEventListener('click', () => selectClub(club));
clubGrid.appendChild(clubElement);
});
}
// Set up event listeners
function setupEventListeners() {
// Main menu buttons
newCareerBtn.addEventListener('click', () => {
showView('club-selection');
});
loadCareerBtn.addEventListener('click', () => {
alert('Funcionalidade de carregar jogo será implementada em breve!');
});
settingsBtn.addEventListener('click', () => {
alert('Configurações serão implementadas em breve!');
});
// Back buttons
backToMenuBtn.addEventListener('click', () => {
showView('main-menu');
});
backToDashboardBtn.addEventListener('click', () => {
if (matchInterval) {
clearInterval(matchInterval);
matchInterval = null;
}
showView('main-game');
});
// Club search
clubSearch.addEventListener('input', (e) => {
const searchTerm = e.target.value.toLowerCase();
const clubElements = document.querySelectorAll('.club-badge');
clubElements.forEach(element => {
const clubName = element.querySelector('h3').textContent.toLowerCase();
const clubFullName = element.querySelector('.text-xs').textContent.toLowerCase();
if (clubName.includes(searchTerm) || clubFullName.includes(searchTerm)) {
element.style.display = 'block';
} else {
element.style.display = 'none';
}
});
});
// Tab navigation
document.querySelectorAll('.tab-btn').forEach(btn => {
btn.addEventListener('click', () => {
const tabId = btn.getAttribute('data-tab');
switchTab(tabId);
});
});
// Position tabs
document.querySelectorAll('.position-tab').forEach(btn => {
btn.addEventListener('click', () => {
document.querySelectorAll('.position-tab').forEach(t => t.classList.remove('active', 'border-blue-500', 'text-blue-600'));
btn.classList.add('active', 'border-blue-500', 'text-blue-600');
const position = btn.getAttribute('data-position');
filterPlayersByPosition(position);
});
});
// Competition tabs
document.querySelectorAll('.competition-tab').forEach(btn => {
btn.addEventListener('click', () => {
document.querySelectorAll('.competition-tab').forEach(t => t.classList.remove('active', 'border-blue-500', 'text-blue-600'));
btn.classList.add('active', 'border-blue-500', 'text-blue-600');
const competition = btn.getAttribute('data-competition');
filterFixturesByCompetition(competition);
});
});
// League tabs
document.querySelectorAll('.league-tab').forEach(btn => {
btn.addEventListener('click', () => {
document.querySelectorAll('.league-tab').forEach(t => t.classList.remove('active', 'border-blue-500', 'text-blue-600'));
btn.classList.add('active', 'border-blue-500', 'text-blue-600');
const league = btn.getAttribute('data-league');
// In a full implementation, this would switch between different league views
});
});
// Match simulation buttons
playMatchBtn.addEventListener('click', simulateMatch);
fastSimulateBtn.addEventListener('click', fastSimulateMatch);
continueAfterMatchBtn.addEventListener('click', () => {
if (matchInterval) {
clearInterval(matchInterval);
matchInterval = null;
}
showView('main-game');
});
// Play next match button
playNextMatchBtn.addEventListener('click', () => {
currentFixture = fixtures[0];
setupMatchSimulation();
showView('match-simulation');
});
}
// Show a specific view
function showView(view) {
currentView = view;
// Hide all views
mainMenu.classList.add('hidden');
clubSelection.classList.add('hidden');
mainGame.classList.add('hidden');
matchSimulation.classList.add('hidden');
// Show the selected view
if (view === 'main-menu') {
mainMenu.classList.remove('hidden');
} else if (view === 'club-selection') {
clubSelection.classList.remove('hidden');
} else if (view === 'main-game') {
mainGame.classList.remove('hidden');
updateMainGame();
} else if (view === 'match-simulation') {
matchSimulation.classList.remove('hidden');
document.getElementById('match-result').classList.add('hidden');
setupMatchSimulation();
}
}
// Select a club to manage
function selectClub(club) {
currentClub = club;
showView('main-game');
}
// Update the main game screen with current club data
function updateMainGame() {
if (!currentClub) return;
// Update club info
document.getElementById('club-name').textContent = currentClub.name;
document.getElementById('club-logo').src = `https://via.placeholder.com/80x80?text=${currentClub.shortName}`;
document.getElementById('club-finances').innerHTML = `<i class="fas fa-coins mr-1"></i> R$ ${currentClub.finances.toLocaleString()}`;
document.getElementById('club-reputation').innerHTML = `<i class="fas fa-star mr-1"></i> ${currentClub.reputation}/5`;
// Update next match
updateNextMatch();
// Update squad
updateSquad();
// Update transfers
updateTransfers();
// Update fixtures
updateFixtures();
// Update league table
updateLeagueTable();
// Update top scorers
updateTopScorers();
}
// Update next match info
function updateNextMatch() {
const nextMatch = fixtures[0];
const isHome = nextMatch.home === currentClub.name;
document.getElementById('next-match-home').textContent = isHome ? currentClub.shortName : nextMatch.home;
document.getElementById('next-match-home-logo').src = `https://via.placeholder.com/60x60?text=${isHome ? currentClub.shortName : nextMatch.home.substring(0, 3)}`;
document.getElementById('next-match-away').textContent = isHome ? nextMatch.away : currentClub.shortName;
document.getElementById('next-match-away-logo').src = `https://via.placeholder.com/60x60?text=${isHome ? nextMatch.away.substring(0, 3) : currentClub.shortName}`;
document.getElementById('next-match-date').textContent = nextMatch.date;
document.getElementById('next-match-time').textContent = nextMatch.time;
document.getElementById('next-match-venue').textContent = nextMatch.venue;
}
// Update squad view
function updateSquad() {
const squadContainer = document.getElementById('players-grid');
squadContainer.innerHTML = '';
const clubPlayers = players.filter(p => p.team === currentClub.id);
clubPlayers.forEach(player => {
const positionClass = getPositionClass(player.position);
const positionName = getPositionName(player.position);
const playerCard = document.createElement('div');
playerCard.className = 'bg-white border border-gray-200 rounded-lg p-4 player-card';
playerCard.innerHTML = `
<div class="flex justify-between items-start mb-2">
<div>
<h4 class="font-bold">${player.name}</h4>
<div class="text-sm text-gray-600">${positionName} • ${player.age} anos</div>
</div>
<div class="bg-${positionClass}-100 text-${positionClass}-800 text-xs font-bold px-2 py-1 rounded">
${player.overall}
</div>
</div>
<div class="flex justify-between items-center text-sm">
<span class="text-gray-500">Valor: R$ ${(player.value / 1000000).toFixed(1)}M</span>
<div class="flex space-x-1">
<button class="bg-blue-100 text-blue-600 p-1 rounded">
<i class="fas fa-chart-line text-xs"></i>
</button>
<button class="bg-gray-100 text-gray-600 p-1 rounded">
<i class="fas fa-ellipsis-v text-xs"></i>
</button>
</div>
</div>
`;
squadContainer.appendChild(playerCard);
});
}
// Update transfers view
function updateTransfers() {
const transfersContainer = document.getElementById('transfer-list');
transfersContainer.innerHTML = '';
// Get players not in current club
const availablePlayers = players.filter(p => p.team !== currentClub.id && (!p.team || p.team === null)).slice(0, 5);
availablePlayers.forEach(player => {
const positionName = getPositionName(player.position);
const transferItem = document.createElement('div');
transferItem.className = 'mb-4 pb-4 border-b border-gray-200';
transferItem.innerHTML = `
<div class="flex justify-between items-center mb-2">
<div class="font-bold">${player.name}</div>
<div class="text-sm text-gray-600">${positionName} • ${player.age} anos</div>
</div>
<div class="flex justify-between items-center text-sm">
<span>Valor: R$ ${(player.value / 1000000).toFixed(1)}M</span>
<div class="flex space-x-2">
<button class="bg-blue-100 text-blue-600 px-2 py-1 rounded text-xs">
<i class="fas fa-euro-sign mr-1"></i> Ofertar
</button>
<button class="bg-gray-100 text-gray-600 px-2 py-1 rounded text-xs">
<i class="fas fa-eye mr-1"></i> Ver
</button>
</div>
</div>
`;
transfersContainer.appendChild(transferItem);
});
}
// Update fixtures view
function updateFixtures() {
const fixturesContainer = document.getElementById('fixtures-list');
fixturesContainer.innerHTML = '';
fixtures.forEach(fixture => {
const isHome = fixture.home === currentClub.name;
const opponent = isHome ? fixture.away : fixture.home;
const fixtureElement = document.createElement('div');
fixtureElement.className = 'bg-white border border-gray-200 rounded-lg p-4';
fixtureElement.innerHTML = `
<div class="flex justify-between items-center mb-2">
<div class="font-bold">${getCompetitionName(fixture.competition)}</div>
<div class="text-sm text-gray-600">${fixture.date} • ${fixture.time}</div>
</div>
<div class="flex items-center justify-between">
<div class="flex items-center ${isHome ? 'font-bold' : ''}">
<img src="https://via.placeholder.com/40x40?text=${fixture.home.substring(0, 3)}" alt="${fixture.home}" class="w-8 h-8 mr-2">
${fixture.home}
</div>
<div class="text-xl font-bold mx-4">vs</div>
<div class="flex items-center ${!isHome ? 'font-bold' : ''}">
<img src="https://via.placeholder.com/40x40?text=${fixture.away.substring(0, 3)}" alt="${fixture.away}" class="w-8 h-8 mr-2">
${fixture.away}
</div>
</div>
<div class="mt-3 flex justify-between items-center">
<span class="text-sm text-gray-600">${fixture.venue}</span>
<button class="bg-blue-600 hover:bg-blue-700 text-white text-sm font-bold py-1 px-3 rounded" data-fixture-id="${fixture.id}">
<i class="fas fa-play mr-1"></i> Jogar
</button>
</div>
`;
// Add event listener to play button
fixtureElement.querySelector('button').addEventListener('click', () => {
currentFixture = fixture;
showView('match-simulation');
});
fixturesContainer.appendChild(fixtureElement);
});
}
// Update league table
function updateLeagueTable() {
const tableBody = document.getElementById('league-table-body');
tableBody.innerHTML = '';
leagueTable.forEach(team => {
const isCurrentClub = team.team === currentClub.name;
const rowClass = isCurrentClub ? 'bg-blue-50 font-bold' : '';
const row = document.createElement('tr');
row.className = rowClass;
row.innerHTML = `
<td class="px-4 py-3 whitespace-nowrap text-sm font-medium ${isCurrentClub ? 'text-blue-800' : 'text-gray-900'}">${team.position}</td>
<td class="px-4 py-3 whitespace-nowrap text-sm ${isCurrentClub ? 'font-bold' : ''}">${team.team}</td>
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-500">${team.points}</td>
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-500">${team.played}</td>
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-500">${team.won}</td>
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-500">${team.drawn}</td>
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-500">${team.lost}</td>
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-500">${team.goalsFor - team.goalsAgainst}</td>
`;
tableBody.appendChild(row);
});
}
// Update top scorers
function updateTopScorers() {
const scorersBody = document.getElementById('top-scorers-body');
scorersBody.innerHTML = '';
topScorers.forEach(scorer => {
const isCurrentClubPlayer = players.some(p => p.name === scorer.name && p.team === currentClub.id);
const rowClass = isCurrentClubPlayer ? 'bg-blue-50 font-bold' : '';
const row = document.createElement('tr');
row.className = rowClass;
row.innerHTML = `
<td class="px-4 py-3 whitespace-nowrap text-sm font-medium ${isCurrentClubPlayer ? 'text-blue-800' : 'text-gray-900'}">${scorer.position}</td>
<td class="px-4 py-3 whitespace-nowrap text-sm ${isCurrentClubPlayer ? 'font-bold' : ''}">${scorer.name}</td>
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-500">${scorer.team}</td>
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-500">${scorer.goals}</td>
`;
scorersBody.appendChild(row);
});
}
// Switch between tabs
function switchTab(tabId) {
// Update active tab button
document.querySelectorAll('.tab-btn').forEach(btn => {
btn.classList.remove('active', 'border-blue-500', 'text-blue-600');
btn.classList.add('text-gray-500', 'hover:text-gray-700');
});
const activeBtn = document.querySelector(`.tab-btn[data-tab="${tabId}"]`);
activeBtn.classList.add('active', 'border-blue-500', 'text-blue-600');
activeBtn.classList.remove('text-gray-500', 'hover:text-gray-700');
// Update active tab content
document.querySelectorAll('.tab-content').forEach(tab => {
tab.classList.remove('active');
});
document.getElementById(tabId).classList.add('active');
}
// Filter players by position
function filterPlayersByPosition(position) {
const squadContainer = document.getElementById('players-grid');
const playerCards = squadContainer.querySelectorAll('.player-card');
playerCards.forEach(card => {
if (position === 'all') {
card.style.display = 'block';
} else {
const playerName = card.querySelector('h4').textContent;
const player = players.find(p => p.name === playerName && p.team === currentClub.id);
if (player && (player.position === position || position === 'all')) {
card.style.display = 'block';
} else {
card.style.display = 'none';
}
}
});
}
// Filter fixtures by competition
function filterFixturesByCompetition(competition) {
const fixturesContainer = document.getElementById('fixtures-list');
const fixtureElements = fixturesContainer.querySelectorAll('div.bg-white');
fixtureElements.forEach((element, index) => {
const fixture = fixtures[index];
if (competition === 'all' || fixture.competition === competition) {
element.style.display = 'block';
} else {
element.style.display = 'none';
}
});
}
// Setup match simulation
function setupMatchSimulation() {
if (!currentFixture) {
currentFixture = fixtures[0];
}
document.getElementById('home-team-name').textContent = currentFixture.home;
document.getElementById('home-team-logo').src = `https://via.placeholder.com/80x80?text=${currentFixture.home.substring(0, 3)}`;
document.getElementById('away-team-name').textContent = currentFixture.away;
document.getElementById('away-team-logo').src = `https://via.placeholder.com/80x80?text=${currentFixture.away.substring(0, 3)}`;
document.getElementById('match-date').textContent = currentFixture.date;
document.getElementById('match-venue').textContent = currentFixture.venue;
// Reset match state
document.getElementById('match-score').textContent = '0 - 0';
document.getElementById('match-minute').textContent = "0'";
document.getElementById('match-status').textContent = "1º Tempo";
document.getElementById('match-events').innerHTML = '<div class="p-2 bg-gray-50 rounded">A partida começou!</div>';
matchInProgress = false;
matchResult = null;
}
// Simulate match with animation
function simulateMatch() {
if (matchInProgress) return;
matchInProgress = true;
const homeTeam = clubs.find(c => c.name === currentFixture.home);
const awayTeam = clubs.find(c => c.name === currentFixture.away);
// Simple match simulation logic
const homeStrength = homeTeam.reputation * 20 + Math.random() * 10;
const awayStrength = awayTeam.reputation * 20 + Math.random() * 10;
// Calculate goals (very simplified)
const homeGoals = Math.floor(Math.random() * 4 * (homeStrength / (homeStrength + awayStrength)));
const awayGoals = Math.floor(Math.random() * 4 * (awayStrength / (homeStrength + awayStrength)));
// Simulate match events
const eventsContainer = document.getElementById('match-events');
eventsContainer.innerHTML = '<div class="p-2 bg-gray-50 rounded">A partida começou!</div>';
let minute = 0;
let homeScore = 0;
let awayScore = 0;
if (matchInterval) {
clearInterval(matchInterval);
}
matchInterval = setInterval(() => {
minute += 1;
// Update minute and check for half/full time
if (minute === 45) {
document.getElementById('match-status').textContent = "Intervalo";
eventsContainer.innerHTML += '<div class="p-2 bg-gray-50 rounded">Fim do primeiro tempo!</div>';
} else if (minute === 90) {
document.getElementById('match-status').textContent = "Fim de Jogo";
eventsContainer.innerHTML += '<div class="p-2 bg-gray-50 rounded">Fim de jogo!</div>';
clearInterval(matchInterval);
matchInterval = null;
matchInProgress = false;
showMatchResult(homeScore, awayScore);
return;
} else {
document.getElementById('match-minute').textContent = `${minute}'`;
// Random match events
if (minute > 45 && minute < 90) {
document.getElementById('match-status').textContent = "2º Tempo";
}
// Random goal events (very simplified)
if (Math.random() < 0.05) {
const isHomeGoal = Math.random() < (homeStrength / (homeStrength + awayStrength));
if (isHomeGoal) {
homeScore += 1;
const scorer = getRandomPlayer(homeTeam.id);
eventsContainer.innerHTML += `<div class="p-2 bg-green-50 rounded text-green-800"><span class="font-bold">${minute}'</span> GOL DO ${homeTeam.shortName}! ${scorer.name} marca!</div>`;
} else {
awayScore += 1;
const scorer = getRandomPlayer(awayTeam.id);
eventsContainer.innerHTML += `<div class="p-2 bg-red-50 rounded text-red-800"><span class="font-bold">${minute}'</span> GOL DO ${awayTeam.shortName}! ${scorer.name} marca!</div>`;
}
document.getElementById('match-score').textContent = `${homeScore} - ${awayScore}`;
}
// Other random events
if (Math.random() < 0.03) {
const eventTypes = ["Falta cometida", "Cartão amarelo", "Escanteio", "Impedimento"];
const randomEvent = eventTypes[Math.floor(Math.random() * eventTypes.length)];
eventsContainer.innerHTML += `<div class="p-2 bg-gray-50 rounded"><span class="font-bold">${minute}'</span> ${randomEvent}</div>`;
}
}
// Scroll to bottom of events
eventsContainer.scrollTop = eventsContainer.scrollHeight;
}, 300);
</html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Brassfoot Brasil - Gestão de Clubes</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>
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');
body {
font-family: 'Montserrat', sans-serif;
background-color: #f5f5f5;
color: #333;
}
.club-badge {
transition: transform 0.3s ease;
}
.club-badge:hover {
transform: scale(1.1);
}
.player-card {
transition: all 0.3s ease;
}
.player-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.progress-bar {
height: 8px;
border-radius: 4px;
background-color: #e5e7eb;
}
.progress-fill {
height: 100%;
border-radius: 4px;
transition: width 0.5s ease;
}
.match-result {
animation: fadeIn 0.5s ease;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
animation: fadeIn 0.3s ease;
}
</style>
</head>
<body class="min-h-screen bg-gray-100">
<!-- Main Container -->
<div class="container mx-auto px-4 py-8 max-w-6xl">
<!-- Header -->
<header class="mb-12 text-center">
<h1 class="text-4xl font-bold text-blue-800 mb-2">BRASSFOOT BRASIL</h1>
<p class="text-lg text-gray-600">O simulador de gestão de clubes brasileiros</p>
</header>
<!-- Game Container -->
<div id="game-container">
<!-- Main Menu Screen -->
<div id="main-menu" class="bg-white rounded-xl shadow-lg p-8 text-center">
<div class="mb-10">
<img src="https://via.placeholder.com/150x150" alt="Brassfoot Logo" class="mx-auto mb-6 rounded-full border-4 border-blue-500">
<h2 class="text-2xl font-bold mb-4">Bem-vindo ao Brassfoot Brasil</h2>
<p class="text-gray-600 mb-8">Gerencie seu clube favorito e leve-o ao topo do futebol brasileiro!</p>
</div>
<div class="flex flex-col space-y-4 max-w-md mx-auto">
<button id="new-career-btn" class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-6 rounded-lg transition duration-300">
<i class="fas fa-plus-circle mr-2"></i> Nova Carreira
</button>
<button id="load-career-btn" class="bg-gray-200 hover:bg-gray-300 text-gray-800 font-bold py-3 px-6 rounded-lg transition duration-300">
<i class="fas fa-folder-open mr-2"></i> Carregar Jogo
</button>
<button id="settings-btn" class="bg-gray-200 hover:bg-gray-300 text-gray-800 font-bold py-3 px-6 rounded-lg transition duration-300">
<i class="fas fa-cog mr-2"></i> Configurações
</button>
</div>
</div>
<!-- Club Selection Screen -->
<div id="club-selection" class="hidden bg-white rounded-xl shadow-lg p-8">
<div class="flex justify-between items-center mb-8">