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:
bl3kunja-FW
2025-08-02 15:27:32 +02:00
parent 75ac46c23c
commit 5c7f255a02
45 changed files with 6840 additions and 1534 deletions
+934
View File
@@ -0,0 +1,934 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>📱 League Results</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
* {
box-sizing: border-box;
}
html, body {
margin: 0;
padding: 0;
background: #f5f5f5;
font-family: Arial, sans-serif;
min-height: 100vh;
overflow-x: hidden;
}
.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;
}
.container {
padding: 20px;
max-width: 100%;
}
.league-header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
padding: 25px 20px;
margin-bottom: 25px;
text-align: center;
color: white;
}
.league-title {
font-size: 1.8rem;
font-weight: bold;
margin-bottom: 10px;
}
.league-subtitle {
font-size: 1.1rem;
opacity: 0.9;
margin-bottom: 15px;
}
.league-badge {
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.3);
color: white;
padding: 8px 16px;
border-radius: 20px;
font-size: 0.9rem;
font-weight: bold;
display: inline-block;
}
.league-stats {
background: white;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
padding: 20px;
margin-bottom: 25px;
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 15px;
}
.stat-item {
text-align: center;
padding: 15px;
background: #f8f9fa;
border-radius: 8px;
}
.stat-value {
font-size: 1.5rem;
font-weight: bold;
color: #007bff;
margin-bottom: 5px;
}
.stat-label {
font-size: 0.9rem;
color: #666;
text-transform: uppercase;
font-weight: bold;
}
.explanation-title {
font-size: 1.2rem;
font-weight: bold;
color: #856404;
margin-bottom: 10px;
}
.explanation-text {
color: #856404;
line-height: 1.4;
}
.results-list {
display: flex;
flex-direction: column;
gap: 15px;
margin-bottom: 25px;
}
.result-card {
background: white;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
padding: 20px;
display: flex;
align-items: center;
gap: 20px;
transition: all 0.2s ease;
position: relative;
overflow: hidden;
}
.result-card.podium {
border-left: 5px solid;
}
.result-card.rank-1 {
border-left-color: #ffd700;
background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
}
.result-card.rank-2 {
border-left-color: #c0c0c0;
background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
}
.result-card.rank-3 {
border-left-color: #cd7f32;
background: linear-gradient(135deg, #fdf6f0 0%, #ffffff 100%);
}
.result-card:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
.rank-display {
display: flex;
flex-direction: column;
align-items: center;
min-width: 60px;
}
.rank-number {
font-size: 1.8rem;
font-weight: bold;
color: #333;
line-height: 1;
}
.result-card.rank-1 .rank-number { color: #b8860b; }
.result-card.rank-2 .rank-number { color: #696969; }
.result-card.rank-3 .rank-number { color: #8b4513; }
.rank-suffix {
font-size: 0.7rem;
color: #666;
text-transform: uppercase;
font-weight: bold;
}
.medal {
font-size: 1.5rem;
margin-top: 3px;
}
.participant-info {
flex: 1;
min-width: 0;
}
.participant-name {
font-size: 1.3rem;
font-weight: bold;
color: #333;
margin-bottom: 8px;
word-wrap: break-word;
}
.participant-details {
display: flex;
gap: 8px;
flex-wrap: wrap;
align-items: center;
margin-bottom: 5px;
}
.participant-id {
background: #007bff;
color: white;
padding: 3px 10px;
border-radius: 12px;
font-size: 0.8rem;
font-weight: bold;
display: inline-block;
}
.score-display {
text-align: right;
min-width: 90px;
}
.final-score {
font-size: 2rem;
font-weight: bold;
color: #28a745;
line-height: 1;
}
.total-score {
font-size: 0.9rem;
color: #666;
margin-top: 2px;
}
.score-label {
font-size: 0.8rem;
color: #666;
text-transform: uppercase;
font-weight: bold;
}
.tournament-breakdown {
background: white;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
padding: 20px;
margin-bottom: 20px;
}
.breakdown-title {
font-size: 1.2rem;
font-weight: bold;
color: #333;
margin-bottom: 10px;
text-align: center;
}
.breakdown-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
}
.tournament-item {
background: #f8f9fa;
border: 1px solid #dee2e6;
border-radius: 8px;
padding: 12px;
text-align: center;
}
.tournament-number {
font-size: 0.8rem;
font-weight: bold;
color: #007bff;
margin-bottom: 5px;
}
.tournament-score {
font-size: 1rem;
font-weight: bold;
color: #333;
}
.tournament-item.joker {
background: #fff3cd;
border-color: #ffc107;
}
.tournament-item.joker .tournament-score {
color: #856404;
}
.tournament-item.excluded {
background: #f8d7da;
border-color: #dc3545;
}
.tournament-item.excluded .tournament-score {
color: #721c24;
}
.tournament-item.counted {
background: #d1edf1;
border-color: #28a745;
}
.tournament-item.counted .tournament-score {
color: #155724;
}
.scoring-legend {
background: white;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
padding: 20px;
margin-bottom: 25px;
}
.legend-title {
font-size: 1.2rem;
font-weight: bold;
color: #333;
margin-bottom: 15px;
text-align: center;
}
.legend-content {
display: flex;
flex-direction: column;
gap: 15px;
}
.legend-rule {
background: #f8f9fa;
border-left: 4px solid #007bff;
padding: 12px;
border-radius: 4px;
font-size: 0.9rem;
line-height: 1.4;
}
.legend-items-mobile {
display: flex;
flex-direction: column;
gap: 8px;
}
.legend-item-mobile {
display: flex;
align-items: center;
gap: 10px;
font-size: 0.9rem;
color: #495057;
}
.legend-dot {
font-size: 1.2rem;
width: 24px;
text-align: center;
}
.congratulations {
background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
padding: 25px 20px;
margin-bottom: 25px;
text-align: center;
color: white;
}
.congrats-title {
font-size: 1.5rem;
font-weight: bold;
margin-bottom: 10px;
}
.congrats-message {
font-size: 1.1rem;
opacity: 0.9;
}
/* Mobile landscape optimization */
@media (orientation: landscape) and (max-height: 500px) {
.mobile-navbar {
padding: 10px 15px;
}
.navbar-title {
font-size: 1.2rem;
}
.container {
padding: 15px;
}
.league-header {
padding: 20px 15px;
margin-bottom: 20px;
}
.league-title {
font-size: 1.5rem;
}
.league-subtitle {
font-size: 1rem;
}
.result-card {
padding: 15px;
gap: 15px;
}
.rank-number {
font-size: 1.5rem;
}
.participant-name {
font-size: 1.1rem;
}
.final-score {
font-size: 1.7rem;
}
.navbar-controls {
gap: 6px;
}
.nav-btn {
padding: 6px 10px;
font-size: 0.75rem;
}
}
@media (max-width: 400px) {
.container {
padding: 15px;
}
.league-header {
padding: 20px 15px;
}
.league-title {
font-size: 1.6rem;
}
.league-subtitle {
font-size: 1rem;
}
.result-card {
padding: 15px;
gap: 15px;
}
.rank-display {
min-width: 50px;
}
.rank-number {
font-size: 1.6rem;
}
.participant-name {
font-size: 1.2rem;
}
.score-display {
min-width: 80px;
}
.final-score {
font-size: 1.8rem;
}
.congratulations {
padding: 20px 15px;
}
.congrats-title {
font-size: 1.3rem;
}
.congrats-message {
font-size: 1rem;
}
.breakdown-grid {
grid-template-columns: repeat(2, 1fr);
gap: 8px;
}
.tournament-item {
padding: 10px 8px;
}
.tournament-score {
font-size: 0.9rem;
}
.legend-rule {
padding: 10px;
font-size: 0.85rem;
}
.legend-item-mobile {
font-size: 0.85rem;
}
.league-stats {
grid-template-columns: 1fr;
gap: 10px;
}
.navbar-controls {
gap: 6px;
}
.nav-btn {
padding: 6px 8px;
font-size: 0.75rem;
}
}
/* Animation for results appearance */
.result-card {
animation: slideInUp 0.5s ease forwards;
opacity: 0;
transform: translateY(20px);
}
.result-card:nth-child(1) { animation-delay: 0.1s; }
.result-card:nth-child(2) { animation-delay: 0.2s; }
.result-card:nth-child(3) { animation-delay: 0.3s; }
.result-card:nth-child(4) { animation-delay: 0.4s; }
.result-card:nth-child(5) { animation-delay: 0.5s; }
.result-card:nth-child(6) { animation-delay: 0.6s; }
@keyframes slideInUp {
to {
opacity: 1;
transform: translateY(0);
}
}
/* Celebration confetti effect */
.confetti {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 999;
}
.confetti-piece {
position: absolute;
width: 10px;
height: 10px;
background: #ffd700;
animation: confetti-fall 3s linear infinite;
}
@keyframes confetti-fall {
0% {
transform: translateY(-100vh) rotate(0deg);
opacity: 1;
}
100% {
transform: translateY(100vh) rotate(720deg);
opacity: 0;
}
}
/* League status indicator */
.league-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;
}
</style>
</head>
<body>
<div class="mobile-navbar">
<div class="navbar-title">
🏆 League
<span class="league-indicator">FINAL</span>
</div>
<div class="navbar-controls">
<a href="/mobile/streams" class="nav-btn">📷</a>
<a href="/mobile/results" class="nav-btn active">🏆</a>
</div>
</div>
<div class="container">
<div class="league-header">
<div class="league-title">🏆 League Championship</div>
<div class="league-subtitle">
Final Results - Best 5 of 6 Tournaments
</div>
<div class="league-badge">
{% if league.tournament_type == '40_targets' %}
40 Targets Format
{% else %}
20 Targets Format
{% endif %}
</div>
</div>
<div class="league-stats">
<div class="stat-item">
<div class="stat-value">{{ participants|length if participants else 0 }}</div>
<div class="stat-label">Participants</div>
</div>
<div class="stat-item">
<div class="stat-value">{{ league.total_tournaments }}</div>
<div class="stat-label">Tournaments</div>
</div>
<div class="stat-item">
<div class="stat-value">{% if participants and participants|length > 0 %}{{ participants[0].final_score }}{% else %}0{% endif %}</div>
<div class="stat-label">Highest Score</div>
</div>
<div class="stat-item">
<div class="stat-value">{{ league.finished_at[:10] if league.finished_at else 'Today' }}</div>
<div class="stat-label">Completed</div>
</div>
</div>
{% if participants and participants|length > 0 %}
<div class="congratulations">
<div class="congrats-title">🎉 League Complete!</div>
<div class="congrats-message">
Congratulations to {{ participants[0].name }} for winning the league!
</div>
</div>
<div class="results-list">
{% for participant in participants %}
<div class="result-card {{ 'podium rank-' + participant.rank|string if participant.rank <= 3 else '' }}">
<div class="rank-display">
<div class="rank-number">{{ participant.rank }}</div>
<div class="rank-suffix">
{% if participant.rank == 1 %}st
{% elif participant.rank == 2 %}nd
{% elif participant.rank == 3 %}rd
{% else %}th
{% endif %}
</div>
{% if participant.rank == 1 %}
<div class="medal">🥇</div>
{% elif participant.rank == 2 %}
<div class="medal">🥈</div>
{% elif participant.rank == 3 %}
<div class="medal">🥉</div>
{% endif %}
</div>
<div class="participant-info">
<div class="participant-name">{{ participant.name }}</div>
<div class="participant-details">
<div class="participant-id">ID: {{ participant.id }}</div>
</div>
</div>
<div class="score-display">
<div class="final-score">{{ participant.final_score }}</div>
<div class="total-score">Total: {{ participant.total_score }}</div>
<div class="score-label">Final Score</div>
</div>
</div>
{% endfor %}
</div>
<!-- Tournament Breakdown for Top Players -->
<!-- Fixed: Replace min(3, participants|length) with proper Jinja2 logic -->
{% set max_breakdowns = 3 %}
{% if participants|length < 3 %}
{% set max_breakdowns = participants|length %}
{% endif %}
{% for i in range(max_breakdowns) %}
{% set participant = participants[i] %}
<div class="tournament-breakdown">
<div class="breakdown-title">
{% if participant.rank == 1 %}🥇{% elif participant.rank == 2 %}🥈{% elif participant.rank == 3 %}🥉{% endif %}
{{ participant.name }}'s Tournament History
</div>
<div class="breakdown-grid">
{% for tournament_num in range(1, 7) %}
{% set result = participant.tournament_results
| selectattr("tournament", "equalto", tournament_num)
| list
| first %}
{% if result %}
{% if (result.joker is defined and result.joker) or (result.participated is defined and not result.participated) %}
<div class="tournament-item joker">
<div class="tournament-number">T{{ tournament_num }}</div>
<div class="tournament-score">🃏 Joker</div>
</div>
{% else %}
{% set all_participated_scores = participant.tournament_results
| selectattr("participated", "defined")
| selectattr("participated")
| selectattr("score", "defined")
| map(attribute="score")
| list %}
{% set sorted_scores = all_participated_scores | sort(reverse=true) %}
{% set is_excluded = sorted_scores | length > 5 and result.score == sorted_scores[-1] %}
{% if is_excluded %}
<div class="tournament-item excluded">
<div class="tournament-number">T{{ tournament_num }}</div>
<div class="tournament-score">{{ result.score }} ❌</div>
</div>
{% else %}
<div class="tournament-item counted">
<div class="tournament-number">T{{ tournament_num }}</div>
<div class="tournament-score">{{ result.score }} ✅</div>
</div>
{% endif %}
{% endif %}
{% else %}
<div class="tournament-item">
<div class="tournament-number">T{{ tournament_num }}</div>
<div class="tournament-score">-</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
{% endfor %}
<!-- Scoring Legend -->
<div class="scoring-legend">
<div class="legend-title">📖 How Final Scores Are Calculated</div>
<div class="legend-content">
<div class="legend-rule">
<strong>🏆 League Rule:</strong> Best 5 out of 6 tournaments count toward final ranking
</div>
<div class="legend-rule">
<strong>🃏 Joker System:</strong> Each player can skip 1 tournament without penalty
</div>
<div class="legend-items-mobile">
<div class="legend-item-mobile">
<span class="legend-dot counted"></span>
<span>Counted toward final score</span>
</div>
<div class="legend-item-mobile">
<span class="legend-dot excluded"></span>
<span>Excluded (worst score)</span>
</div>
<div class="legend-item-mobile">
<span class="legend-dot joker">🃏</span>
<span>Joker used (skipped)</span>
</div>
</div>
</div>
</div>
{% else %}
<div class="result-card">
<div style="text-align: center; width: 100%; color: #666;">
<h3>No League Results Available</h3>
<p>League results will appear here when the league is complete.</p>
</div>
</div>
{% endif %}
</div>
<!-- Confetti container -->
<div class="confetti" id="confetti"></div>
<script>
function createConfetti() {
const confettiContainer = document.getElementById('confetti');
const colors = ['#ffd700', '#ff6b6b', '#4ecdc4', '#45b7d1', '#96ceb4', '#ffeaa7'];
for (let i = 0; i < 50; i++) {
const confettiPiece = document.createElement('div');
confettiPiece.className = 'confetti-piece';
confettiPiece.style.left = Math.random() * 100 + '%';
confettiPiece.style.backgroundColor = colors[Math.floor(Math.random() * colors.length)];
confettiPiece.style.animationDelay = Math.random() * 3 + 's';
confettiPiece.style.animationDuration = (Math.random() * 2 + 2) + 's';
confettiContainer.appendChild(confettiPiece);
}
setTimeout(() => {
confettiContainer.innerHTML = '';
}, 5000);
}
function addMobileTouchFeedback() {
const touchElements = document.querySelectorAll('.nav-btn:not(.disabled), .result-card');
touchElements.forEach(element => {
element.addEventListener('touchstart', function(e) {
if (!this.disabled) {
this.style.transform = 'scale(0.98) translateY(0)';
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 showChampionCelebration() {
{% if participants and participants|length > 0 %}
createConfetti();
setTimeout(() => {
const firstCard = document.querySelector('.result-card.rank-1');
if (firstCard) {
firstCard.style.boxShadow = '0 0 30px rgba(255, 215, 0, 0.5)';
setTimeout(() => {
firstCard.style.boxShadow = '';
}, 2000);
}
}, 1000);
{% endif %}
}
document.addEventListener('keydown', function(event) {
if (event.key === 'r' || event.key === 'R') {
event.preventDefault();
window.location.reload();
}
});
document.addEventListener('DOMContentLoaded', function() {
addMobileTouchFeedback();
setTimeout(() => {
showChampionCelebration();
}, 1500);
console.log('📱 Mobile League Results loaded');
console.log('🏆 League participants:', {{ participants|length if participants else 0 }});
console.log('🎯 Tournament type:', '{{ league.tournament_type }}');
{% if participants and participants|length > 0 %}
console.log('🏆 League Champion:', '{{ participants[0].name }}');
console.log('🏆 Winning score:', {{ participants[0].final_score }});
{% endif %}
});
</script>
</body>
</html>