Add tournament archives and results for multiple events
- Created JSON files for tournament archives on 2025-07-28 and 2025-07-29, including detailed player scores and shot results. - Added a new tournament results file summarizing the outcomes of the tournament held on 2025-07-29, including participant scores and completion status.
This commit is contained in:
@@ -0,0 +1,769 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>📱 Tournament Draft</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimal-ui, viewport-fit=cover">
|
||||
<style>
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: #f5f5f5;
|
||||
font-family: Arial, sans-serif;
|
||||
min-height: 100vh;
|
||||
min-height: 100dvh;
|
||||
overflow-x: hidden;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.mobile-navbar {
|
||||
background: white;
|
||||
color: black;
|
||||
padding: 15px 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-bottom: 2px solid #ccc;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.navbar-title {
|
||||
font-size: 1.4rem;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.navbar-controls {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.nav-btn {
|
||||
background: #f8f9fa;
|
||||
border: 2px solid #e9ecef;
|
||||
cursor: pointer;
|
||||
padding: 8px 12px;
|
||||
border-radius: 8px;
|
||||
transition: all 0.2s ease;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
font-size: 0.8rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
min-width: 44px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.nav-btn:hover {
|
||||
background: #e9ecef;
|
||||
border-color: #007bff;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
||||
transform: translateY(-1px);
|
||||
color: #007bff;
|
||||
}
|
||||
|
||||
.nav-btn.active {
|
||||
background: #007bff;
|
||||
border-color: #0056b3;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.nav-btn.active:hover {
|
||||
background: #0056b3;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.nav-btn.disabled {
|
||||
opacity: 0.5;
|
||||
pointer-events: none;
|
||||
background: #f1f3f4;
|
||||
border-color: #dadce0;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 20px;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.tournament-header {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
padding: 25px 20px;
|
||||
margin-bottom: 25px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.tournament-title {
|
||||
font-size: 1.8rem;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.tournament-stats {
|
||||
color: #666;
|
||||
font-size: 1rem;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.view-only-badge {
|
||||
background: #e3f2fd;
|
||||
border: 2px solid #2196f3;
|
||||
color: #1976d2;
|
||||
padding: 8px 16px;
|
||||
border-radius: 20px;
|
||||
font-size: 0.9rem;
|
||||
font-weight: bold;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.rounds-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.round-card {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
overflow: hidden;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.round-card.current {
|
||||
border-left: 5px solid #007bff;
|
||||
box-shadow: 0 6px 20px rgba(0, 123, 255, 0.2);
|
||||
}
|
||||
|
||||
.round-card.completed {
|
||||
border-left: 5px solid #28a745;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.round-card.waiting {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.round-header {
|
||||
padding: 20px 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: #f8f9fa;
|
||||
}
|
||||
|
||||
.round-card.current .round-header {
|
||||
background: #f0f8ff;
|
||||
}
|
||||
|
||||
.round-card.completed .round-header {
|
||||
background: #f8fff9;
|
||||
}
|
||||
|
||||
.round-title {
|
||||
font-size: 1.3rem;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.round-badge {
|
||||
padding: 8px 15px;
|
||||
border-radius: 15px;
|
||||
font-size: 0.8rem;
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.current-badge {
|
||||
background: #007bff;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.completed-badge {
|
||||
background: #28a745;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.waiting-badge {
|
||||
background: #6c757d;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.players-grid {
|
||||
padding: 20px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.position-card {
|
||||
background: #f8f9fa;
|
||||
border: 2px solid #e9ecef;
|
||||
border-radius: 12px;
|
||||
padding: 18px 15px;
|
||||
text-align: center;
|
||||
min-height: 90px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.position-card.filled {
|
||||
border-color: #28a745;
|
||||
background: #f8fff9;
|
||||
}
|
||||
|
||||
.position-card.empty {
|
||||
border-color: #6c757d;
|
||||
background: #f1f3f4;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.position-number {
|
||||
font-size: 1.3rem;
|
||||
font-weight: bold;
|
||||
color: #007bff;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.position-card.empty .position-number {
|
||||
color: #6c757d;
|
||||
}
|
||||
|
||||
.player-name {
|
||||
font-size: 1.1rem;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
line-height: 1.2;
|
||||
word-break: keep-all;
|
||||
overflow-wrap: break-word;
|
||||
hyphens: none;
|
||||
}
|
||||
|
||||
.position-card.empty .player-name {
|
||||
color: #6c757d;
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.player-id {
|
||||
background: #28a745;
|
||||
color: white;
|
||||
padding: 4px 10px;
|
||||
border-radius: 12px;
|
||||
font-size: 0.8rem;
|
||||
font-weight: bold;
|
||||
margin-top: 8px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* Mobile landscape optimization */
|
||||
@media (orientation: landscape) and (max-height: 500px) {
|
||||
.mobile-navbar {
|
||||
padding: 10px 15px;
|
||||
}
|
||||
|
||||
.navbar-title {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.tournament-header {
|
||||
padding: 20px 15px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.tournament-title {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.tournament-stats {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.players-grid {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 12px;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.position-card {
|
||||
padding: 12px 10px;
|
||||
min-height: 70px;
|
||||
}
|
||||
|
||||
.position-number {
|
||||
font-size: 1.1rem;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.player-name {
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.player-id {
|
||||
font-size: 0.7rem;
|
||||
padding: 3px 8px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.navbar-controls {
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.nav-btn {
|
||||
padding: 6px 10px;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 400px) {
|
||||
.container {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.tournament-header {
|
||||
padding: 20px 15px;
|
||||
}
|
||||
|
||||
.tournament-title {
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
|
||||
.tournament-stats {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.round-header {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.round-title {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.players-grid {
|
||||
padding: 15px;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.position-card {
|
||||
padding: 15px 12px;
|
||||
min-height: 85px;
|
||||
}
|
||||
|
||||
.position-number {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.player-name {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.player-id {
|
||||
font-size: 0.75rem;
|
||||
padding: 3px 8px;
|
||||
}
|
||||
|
||||
.navbar-controls {
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.nav-btn {
|
||||
padding: 6px 8px;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
.round-change-indicator {
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
background: rgba(40, 167, 69, 0.9);
|
||||
color: white;
|
||||
padding: 10px 15px;
|
||||
border-radius: 20px;
|
||||
font-size: 0.8rem;
|
||||
font-weight: bold;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
z-index: 999;
|
||||
box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
|
||||
}
|
||||
|
||||
.round-change-indicator.show {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.tournament-summary {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
padding: 20px;
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
.summary-title {
|
||||
font-size: 1.2rem;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
margin-bottom: 15px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.summary-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: 10px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.summary-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 8px 0;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.summary-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.summary-label {
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.summary-value {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.smart-refresh-badge {
|
||||
background: #28a745;
|
||||
color: white;
|
||||
padding: 4px 8px;
|
||||
border-radius: 10px;
|
||||
font-size: 0.7rem;
|
||||
font-weight: bold;
|
||||
margin-left: 10px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* Tournament status indicator */
|
||||
.tournament-indicator {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
background: #007bff;
|
||||
color: white;
|
||||
padding: 2px 6px;
|
||||
border-radius: 8px;
|
||||
font-size: 0.7rem;
|
||||
font-weight: bold;
|
||||
margin-left: 5px;
|
||||
animation: pulse 2s infinite;
|
||||
}
|
||||
|
||||
/* Results available indicator */
|
||||
.results-indicator {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
background: #28a745;
|
||||
color: white;
|
||||
padding: 2px 6px;
|
||||
border-radius: 8px;
|
||||
font-size: 0.7rem;
|
||||
font-weight: bold;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0% { opacity: 1; }
|
||||
50% { opacity: 0.7; }
|
||||
100% { opacity: 1; }
|
||||
}
|
||||
|
||||
/* No tournament message */
|
||||
.no-tournament-message {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
padding: 40px 20px;
|
||||
text-align: center;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.no-tournament-message h2 {
|
||||
color: #333;
|
||||
margin-bottom: 15px;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.no-tournament-message p {
|
||||
margin-bottom: 20px;
|
||||
font-size: 1rem;
|
||||
line-height: 1.4;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="mobile-navbar">
|
||||
<div class="navbar-title">
|
||||
📋 Draft
|
||||
{% if tournament %}
|
||||
{% if tournament.current_round %}
|
||||
<span class="tournament-indicator">R{{ tournament.current_round }}</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="navbar-controls">
|
||||
<!-- Always show all 3 navigation buttons -->
|
||||
<a href="/mobile/streams" class="nav-btn">📷</a>
|
||||
<a href="/mobile/draft" class="nav-btn active">📋</a>
|
||||
<a href="/mobile/results" class="nav-btn">🏆</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
{% if tournament %}
|
||||
<div class="tournament-header">
|
||||
<div class="tournament-title">🎯 Shooting Tournament</div>
|
||||
<div class="tournament-stats">
|
||||
{{ tournament.total_players }} players • {{ tournament.total_rounds }} rounds
|
||||
{% if tournament.current_round %}
|
||||
• Currently on Round {{ tournament.current_round }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="rounds-container">
|
||||
{% for round in tournament.rounds %}
|
||||
{% set is_current = tournament.current_round == round.round_number %}
|
||||
{% set is_completed = tournament.current_round > round.round_number %}
|
||||
<div class="round-card {{ 'current' if is_current else ('completed' if is_completed else 'waiting') }}">
|
||||
<div class="round-header">
|
||||
<div class="round-title">Round {{ round.round_number }}</div>
|
||||
{% if is_current %}
|
||||
<div class="round-badge current-badge">Current</div>
|
||||
{% elif is_completed %}
|
||||
<div class="round-badge completed-badge">Completed</div>
|
||||
{% else %}
|
||||
<div class="round-badge waiting-badge">Waiting</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="players-grid">
|
||||
{% for position in range(1, 7) %}
|
||||
{% set player = round.players[position-1] if position <= round.players|length else none %}
|
||||
<div class="position-card {{ 'filled' if player else 'empty' }}">
|
||||
<div class="position-number">{{ position }}</div>
|
||||
{% if player %}
|
||||
<div class="player-name">{{ player.name }}</div>
|
||||
<div class="player-id">ID: {{ player.id }}</div>
|
||||
{% else %}
|
||||
<div class="player-name">Empty</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<!-- Tournament Summary -->
|
||||
<div class="tournament-summary">
|
||||
<div class="summary-title">📊 Tournament Summary</div>
|
||||
<div class="summary-grid">
|
||||
<div class="summary-item">
|
||||
<span class="summary-label">Total Players:</span>
|
||||
<span class="summary-value">{{ tournament.total_players }}</span>
|
||||
</div>
|
||||
<div class="summary-item">
|
||||
<span class="summary-label">Total Rounds:</span>
|
||||
<span class="summary-value">{{ tournament.total_rounds }}</span>
|
||||
</div>
|
||||
<div class="summary-item">
|
||||
<span class="summary-label">Current Round:</span>
|
||||
<span class="summary-value">{{ tournament.current_round or 'Not set' }}</span>
|
||||
</div>
|
||||
<div class="summary-item">
|
||||
<span class="summary-label">Updates:</span>
|
||||
<span class="summary-value" style="color: #28a745; font-weight: bold;">On Round Change</span>
|
||||
</div>
|
||||
<div class="summary-item">
|
||||
<span class="summary-label">Created:</span>
|
||||
<span class="summary-value">{{ tournament.created_at[:10] if tournament.created_at else 'Unknown' }}</span>
|
||||
</div>
|
||||
<div class="summary-item">
|
||||
<span class="summary-label">Status:</span>
|
||||
<span class="summary-value" style="color: #28a745; font-weight: bold;">Active</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<!-- No tournament available -->
|
||||
<div class="no-tournament-message">
|
||||
<h2>📋 No Active Tournament</h2>
|
||||
<p>No tournament is currently running. Check the Results tab for completed tournaments or use the dashboard to start a new tournament.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Round change indicator -->
|
||||
<div class="round-change-indicator" id="roundChangeIndicator">
|
||||
🆕 New Round Starting...
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Tournament state
|
||||
const tournamentActive = {{ 'true' if tournament else 'false' }};
|
||||
let currentRound = {{ tournament.current_round if tournament else 1 }};
|
||||
const totalRounds = {{ tournament.total_rounds if tournament else 1 }};
|
||||
|
||||
// Manual refresh function
|
||||
function manualRefresh() {
|
||||
const indicator = document.getElementById('roundChangeIndicator');
|
||||
indicator.textContent = '🔄 Refreshing...';
|
||||
indicator.classList.add('show');
|
||||
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 500);
|
||||
}
|
||||
|
||||
function scrollToCurrentRound() {
|
||||
const currentRound = document.querySelector('.round-card.current');
|
||||
if (currentRound) {
|
||||
setTimeout(() => {
|
||||
currentRound.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'center'
|
||||
});
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
|
||||
function addMobileTouchFeedback() {
|
||||
const touchElements = document.querySelectorAll('.nav-btn:not(.disabled), .round-card');
|
||||
|
||||
touchElements.forEach(element => {
|
||||
element.addEventListener('touchstart', function(e) {
|
||||
if (!this.disabled) {
|
||||
this.style.transform = 'scale(0.98)';
|
||||
this.style.transition = 'transform 0.1s ease';
|
||||
}
|
||||
});
|
||||
|
||||
element.addEventListener('touchend', function(e) {
|
||||
if (!this.disabled) {
|
||||
setTimeout(() => {
|
||||
this.style.transform = '';
|
||||
this.style.transition = 'transform 0.2s ease';
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
|
||||
element.addEventListener('touchcancel', function(e) {
|
||||
if (!this.disabled) {
|
||||
this.style.transform = '';
|
||||
this.style.transition = 'transform 0.2s ease';
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function setupRoundChangeDetection() {
|
||||
if (!tournamentActive) return;
|
||||
|
||||
setInterval(async () => {
|
||||
if (document.visibilityState !== 'visible') return;
|
||||
|
||||
try {
|
||||
const response = await fetch(window.location.pathname + '?check=1');
|
||||
if (response.ok) {
|
||||
const pageContent = await response.text();
|
||||
|
||||
const roundMatch = pageContent.match(/Currently on Round\s*(\d+)/);
|
||||
if (roundMatch) {
|
||||
const serverCurrentRound = parseInt(roundMatch[1]);
|
||||
|
||||
if (serverCurrentRound !== currentRound) {
|
||||
console.log(`📱 Round changed from ${currentRound} to ${serverCurrentRound}`);
|
||||
|
||||
const indicator = document.getElementById('roundChangeIndicator');
|
||||
indicator.textContent = '🆕 New Round Starting...';
|
||||
indicator.classList.add('show');
|
||||
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 1500);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('Round check failed:', error);
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
document.addEventListener('keydown', function(event) {
|
||||
if (event.key === 'r' || event.key === 'R') {
|
||||
event.preventDefault();
|
||||
manualRefresh();
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
addMobileTouchFeedback();
|
||||
scrollToCurrentRound();
|
||||
setupRoundChangeDetection();
|
||||
|
||||
console.log('📱 Mobile Draft with Fixed Navigation loaded');
|
||||
console.log('🏆 Tournament active:', tournamentActive);
|
||||
console.log('🔍 Round change detection active');
|
||||
});
|
||||
|
||||
window.addEventListener('focus', function() {
|
||||
console.log('📱 App regained focus - checking for round changes');
|
||||
setTimeout(async () => {
|
||||
try {
|
||||
const response = await fetch(window.location.pathname + '?check=1');
|
||||
if (response.ok) {
|
||||
const pageContent = await response.text();
|
||||
const roundMatch = pageContent.match(/Currently on Round\s*(\d+)/);
|
||||
if (roundMatch) {
|
||||
const serverCurrentRound = parseInt(roundMatch[1]);
|
||||
if (serverCurrentRound !== currentRound) {
|
||||
manualRefresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('Focus round check failed:', error);
|
||||
}
|
||||
}, 500);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user