Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f998b1307 | ||
|
|
1d590eb942 |
101
assets/css/custom.css
Normal file
101
assets/css/custom.css
Normal file
@ -0,0 +1,101 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');
|
||||
|
||||
:root {
|
||||
--primary-color: #0d6efd;
|
||||
--secondary-color: #6c757d;
|
||||
--light-color: #f8f9fa;
|
||||
--dark-color: #212529;
|
||||
--body-gradient-start: #e0e5ff;
|
||||
--body-gradient-end: #d9e2f3;
|
||||
--card-bg-color: rgba(255, 255, 255, 0.75);
|
||||
--card-bg-color-odd: rgba(233, 236, 239, 0.75);
|
||||
--card-bg-color-even: rgba(204, 219, 255, 0.75);
|
||||
--card-border-color: rgba(255, 255, 255, 0.2);
|
||||
--shadow-color: rgba(0, 0, 0, 0.1);
|
||||
--font-family: 'Poppins', sans-serif;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: var(--font-family);
|
||||
background: linear-gradient(135deg, var(--body-gradient-start), var(--body-gradient-end));
|
||||
color: var(--dark-color);
|
||||
}
|
||||
|
||||
header.bg-primary {
|
||||
background: linear-gradient(135deg, #29375a 0%, #1a233f 100%) !important;
|
||||
border-bottom: 3px solid var(--primary-color);
|
||||
}
|
||||
|
||||
header h1 {
|
||||
font-weight: 700;
|
||||
text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
.card {
|
||||
border: 1px solid var(--card-border-color);
|
||||
border-radius: 1rem;
|
||||
box-shadow: 0 8px 32px 0 var(--shadow-color);
|
||||
backdrop-filter: blur(12px);
|
||||
-webkit-backdrop-filter: blur(12px);
|
||||
}
|
||||
|
||||
#odds-section .card:nth-child(odd) {
|
||||
background-color: var(--card-bg-color-odd);
|
||||
}
|
||||
|
||||
#odds-section .card:nth-child(even) {
|
||||
background-color: var(--card-bg-color-even);
|
||||
}
|
||||
|
||||
|
||||
.card-header {
|
||||
background-color: rgba(255, 255, 255, 0.5);
|
||||
border-bottom: 1px solid var(--card-border-color);
|
||||
font-weight: 600 !important;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background-color: var(--primary-color);
|
||||
border: none;
|
||||
border-radius: 0.5rem;
|
||||
font-weight: 600;
|
||||
transition: all 0.3s ease;
|
||||
box-shadow: 0 4px 15px 0 rgba(13, 110, 253, 0.4);
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 20px 0 rgba(13, 110, 253, 0.5);
|
||||
}
|
||||
|
||||
.table {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.table-striped > tbody > tr:nth-of-type(odd) > * {
|
||||
background-color: rgba(0, 0, 0, 0.03);
|
||||
}
|
||||
|
||||
.table-light > thead > tr > th {
|
||||
background-color: rgba(255,255,255,0.4);
|
||||
font-weight: 600;
|
||||
color: var(--dark-color);
|
||||
}
|
||||
|
||||
.badge.bg-secondary {
|
||||
background-color: #4a5568 !important;
|
||||
font-size: 0.9em;
|
||||
padding: 0.5em 0.8em;
|
||||
}
|
||||
|
||||
footer.bg-light {
|
||||
background-color: #29375a !important;
|
||||
color: var(--light-color);
|
||||
padding-top: 1.5rem !important;
|
||||
padding-bottom: 1.5rem !important;
|
||||
margin-top: 3rem;
|
||||
}
|
||||
|
||||
footer p {
|
||||
color: #a0aec0;
|
||||
}
|
||||
75
assets/js/main.js
Normal file
75
assets/js/main.js
Normal file
@ -0,0 +1,75 @@
|
||||
document.getElementById('analysis-form').addEventListener('submit', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
const homeTeam = document.getElementById('home-team').value;
|
||||
const awayTeam = document.getElementById('away-team').value;
|
||||
|
||||
if (!homeTeam || !awayTeam) {
|
||||
alert('Por favor, digite os nomes dos dois times.');
|
||||
return;
|
||||
}
|
||||
|
||||
const analysisResult = document.getElementById('analysis-result');
|
||||
analysisResult.style.display = 'block';
|
||||
analysisResult.innerHTML = `
|
||||
<div class="d-flex justify-content-center">
|
||||
<div class="spinner-border text-primary" role="status">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
setTimeout(() => {
|
||||
const homeWinProb = (Math.random() * 50 + 25).toFixed(2);
|
||||
const awayWinProb = (Math.random() * (75 - homeWinProb)).toFixed(2);
|
||||
const drawProb = (100 - homeWinProb - awayWinProb).toFixed(2);
|
||||
|
||||
const homeOdds = (1 / (homeWinProb / 100)).toFixed(2);
|
||||
const awayOdds = (1 / (awayWinProb / 100)).toFixed(2);
|
||||
const drawOdds = (1 / (drawProb / 100)).toFixed(2);
|
||||
|
||||
analysisResult.innerHTML = `
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title text-center">Análise da Partida: ${homeTeam} vs ${awayTeam}</h5>
|
||||
<div class="row text-center my-4">
|
||||
<div class="col-4">
|
||||
<h6>Vitória ${homeTeam}</h6>
|
||||
<p class="fs-4 text-primary">${homeWinProb}%</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<h6>Empate</h6>
|
||||
<p class="fs-4 text-secondary">${drawProb}%</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<h6>Vitória ${awayTeam}</h6>
|
||||
<p class="fs-4 text-primary">${awayWinProb}%</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<h6 class="card-subtitle mb-2 text-muted">Odds Estimadas</h6>
|
||||
<div class="row text-center">
|
||||
<div class="col-4"><strong>${homeTeam}:</strong> ${homeOdds}</div>
|
||||
<div class="col-4"><strong>Empate:</strong> ${drawOdds}</div>
|
||||
<div class="col-4"><strong>${awayTeam}:</strong> ${awayOdds}</div>
|
||||
</div>
|
||||
<hr>
|
||||
<h6 class="card-subtitle mb-2 text-muted">Recomendação da IA</h6>
|
||||
<p>Com base na análise, a recomendação pende para uma vitória do <strong>${homeWinProb > awayWinProb ? homeTeam : awayTeam}</strong>, mas um empate também é uma possibilidade a ser considerada.</p>
|
||||
<hr>
|
||||
<h6 class="card-subtitle mb-2 text-muted">Casas de Apostas (Exemplo)</h6>
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item d-flex justify-content-between">
|
||||
<span>Bet365</span>
|
||||
<span>${homeTeam}: ${(homeOdds * 1.05).toFixed(2)} | Empate: ${(drawOdds * 0.98).toFixed(2)} | ${awayTeam}: ${(awayOdds * 1.02).toFixed(2)}</span>
|
||||
</li>
|
||||
<li class="list-group-item d-flex justify-content-between">
|
||||
<span>Betano</span>
|
||||
<span>${homeTeam}: ${(homeOdds * 0.99).toFixed(2)} | Empate: ${(drawOdds * 1.01).toFixed(2)} | ${awayTeam}: ${(awayOdds * 1.04).toFixed(2)}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}, 2000);
|
||||
});
|
||||
14
includes/odds_api.php
Normal file
14
includes/odds_api.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
function get_odds($sport = 'soccer_epl', $regions = 'uk,eu', $markets = 'h2h') {
|
||||
$apiKey = '308deae256c9099c52e22bb4933a12b6';
|
||||
$url = "https://api.the-odds-api.com/v4/sports/{$sport}/odds/?regions={$regions}&markets={$markets}&apiKey={$apiKey}";
|
||||
|
||||
$response = @file_get_contents($url);
|
||||
|
||||
if ($response === FALSE) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return json_decode($response, true);
|
||||
}
|
||||
?>
|
||||
265
index.php
265
index.php
@ -1,150 +1,127 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
@ini_set('display_errors', '1');
|
||||
@error_reporting(E_ALL);
|
||||
@date_default_timezone_set('UTC');
|
||||
|
||||
$phpVersion = PHP_VERSION;
|
||||
$now = date('Y-m-d H:i:s');
|
||||
?>
|
||||
<!doctype html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>New Style</title>
|
||||
<?php
|
||||
// Read project preview data from environment
|
||||
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
|
||||
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
||||
?>
|
||||
<?php if ($projectDescription): ?>
|
||||
<!-- Meta description -->
|
||||
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
|
||||
<!-- Open Graph meta tags -->
|
||||
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<!-- Twitter meta tags -->
|
||||
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<?php endif; ?>
|
||||
<?php if ($projectImageUrl): ?>
|
||||
<!-- Open Graph image -->
|
||||
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||
<!-- Twitter image -->
|
||||
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||
<?php endif; ?>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
:root {
|
||||
--bg-color-start: #6a11cb;
|
||||
--bg-color-end: #2575fc;
|
||||
--text-color: #ffffff;
|
||||
--card-bg-color: rgba(255, 255, 255, 0.01);
|
||||
--card-border-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Inter', sans-serif;
|
||||
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
||||
color: var(--text-color);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
body::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
|
||||
animation: bg-pan 20s linear infinite;
|
||||
z-index: -1;
|
||||
}
|
||||
@keyframes bg-pan {
|
||||
0% { background-position: 0% 0%; }
|
||||
100% { background-position: 100% 100%; }
|
||||
}
|
||||
main {
|
||||
padding: 2rem;
|
||||
}
|
||||
.card {
|
||||
background: var(--card-bg-color);
|
||||
border: 1px solid var(--card-border-color);
|
||||
border-radius: 16px;
|
||||
padding: 2rem;
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.loader {
|
||||
margin: 1.25rem auto 1.25rem;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border: 3px solid rgba(255, 255, 255, 0.25);
|
||||
border-top-color: #fff;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
@keyframes spin {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
.hint {
|
||||
opacity: 0.9;
|
||||
}
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px; height: 1px;
|
||||
padding: 0; margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap; border: 0;
|
||||
}
|
||||
h1 {
|
||||
font-size: 3rem;
|
||||
font-weight: 700;
|
||||
margin: 0 0 1rem;
|
||||
letter-spacing: -1px;
|
||||
}
|
||||
p {
|
||||
margin: 0.5rem 0;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
code {
|
||||
background: rgba(0,0,0,0.2);
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
}
|
||||
footer {
|
||||
position: absolute;
|
||||
bottom: 1rem;
|
||||
font-size: 0.8rem;
|
||||
opacity: 0.7;
|
||||
}
|
||||
</style>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Football Match Analysis</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<div class="card">
|
||||
<h1>Analyzing your requirements and generating your website…</h1>
|
||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
||||
<span class="sr-only">Loading…</span>
|
||||
</div>
|
||||
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
|
||||
<p class="hint">This page will update automatically as the plan is implemented.</p>
|
||||
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
|
||||
</div>
|
||||
</main>
|
||||
<footer>
|
||||
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
||||
</footer>
|
||||
<header class="bg-primary text-white text-center py-3">
|
||||
<h1><i class="fas fa-futbol"></i> Football Match Analysis</h1>
|
||||
</header>
|
||||
|
||||
<main class="container my-5">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Análise de Partida</h5>
|
||||
<form id="analysis-form">
|
||||
<div class="mb-3">
|
||||
<label for="home-team" class="form-label">Time da Casa</label>
|
||||
<input type="text" class="form-control" id="home-team" placeholder="Digite o nome do time da casa" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="away-team" class="form-label">Time Visitante</label>
|
||||
<input type="text" class="form-control" id="away-team" placeholder="Digite o nome do time visitante" required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary w-100">Analisar Partida</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="analysis-result" class="mt-4" style="display: none;">
|
||||
<div class="d-flex justify-content-center">
|
||||
<div class="spinner-border text-primary" role="status">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card shadow-sm mt-4">
|
||||
<div class="card-body" id="odds-section">
|
||||
<h5 class="card-title">Próximas Partidas e Odds (Premier League)</h5>
|
||||
<?php
|
||||
require_once 'includes/odds_api.php';
|
||||
$odds_data = get_odds('soccer_epl', 'uk', 'h2h');
|
||||
|
||||
if ($odds_data && !empty($odds_data)) {
|
||||
// Set timezone to Brazil
|
||||
date_default_timezone_set('America/Sao_Paulo');
|
||||
|
||||
foreach ($odds_data as $match) {
|
||||
$match_time = strtotime($match['commence_time']);
|
||||
?>
|
||||
<div class="card mb-3">
|
||||
<div class="card-header fw-bold">
|
||||
<?php echo htmlspecialchars($match['home_team']) . ' vs ' . htmlspecialchars($match['away_team']); ?>
|
||||
<span class="float-end badge bg-secondary"><?php echo date('d/m/Y H:i', $match_time); ?></span>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<table class="table table-striped table-sm mb-0">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>Casa de Apostas</th>
|
||||
<th class="text-center">1 (Casa)</th>
|
||||
<th class="text-center">X (Empate)</th>
|
||||
<th class="text-center">2 (Fora)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if (!empty($match['bookmakers'])) {
|
||||
foreach ($match['bookmakers'] as $bookmaker) {
|
||||
$home_odd = 'N/A';
|
||||
$draw_odd = 'N/A';
|
||||
$away_odd = 'N/A';
|
||||
|
||||
foreach ($bookmaker['markets'] as $market) {
|
||||
if ($market['key'] === 'h2h') {
|
||||
foreach ($market['outcomes'] as $outcome) {
|
||||
if ($outcome['name'] === $match['home_team']) {
|
||||
$home_odd = htmlspecialchars($outcome['price']);
|
||||
} elseif ($outcome['name'] === $match['away_team']) {
|
||||
$away_odd = htmlspecialchars($outcome['price']);
|
||||
} elseif ($outcome['name'] === 'Draw') {
|
||||
$draw_odd = htmlspecialchars($outcome['price']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($bookmaker['title']); ?></td>
|
||||
<td class="text-center"><?php echo $home_odd; ?></td>
|
||||
<td class="text-center"><?php echo $draw_odd; ?></td>
|
||||
<td class="text-center"><?php echo $away_odd; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
echo '<tr><td colspan="4" class="text-center">Nenhuma casa de aposta disponível para esta partida.</td></tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
echo '<div class="alert alert-warning" role="alert">Não foi possível buscar as odds no momento. Verifique sua chave de API ou tente novamente mais tarde.</div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer class="text-center py-3 bg-light">
|
||||
<p class="mb-0">© 2025 Football Match Analysis. All Rights Reserved.</p>
|
||||
<p class="mb-0 fst-italic">Note: Odds and bookmakers are estimates. Always consult the betting sites for real-time values.</p>
|
||||
</footer>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user