Files
Sdk_TV_app/templates/results_calculator.html
T
bl3kunja-FW 5c7f255a02 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.
2025-08-02 15:27:32 +02:00

1074 lines
30 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Results Calculator</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;
}
.navbar {
background: white;
color: black;
padding: 15px 25px;
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);
}
.navbar-title {
font-size: 1.8rem;
font-weight: bold;
color: #333;
}
.navbar-controls {
display: flex;
gap: 12px;
align-items: center;
}
.nav-btn {
background: #f8f9fa;
border: 2px solid #e9ecef;
cursor: pointer;
padding: 12px 20px;
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.9rem;
}
.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.primary {
background: #007bff;
border-color: #0056b3;
color: white;
}
.nav-btn.primary:hover {
background: #0056b3;
color: white;
}
.nav-btn.success {
background: #28a745;
border-color: #1e7e34;
color: white;
}
.nav-btn.success:hover {
background: #1e7e34;
color: white;
}
.nav-btn.danger {
background: #dc3545;
border-color: #c82333;
color: white;
}
.nav-btn.danger:hover {
background: #c82333;
color: white;
}
.container {
max-width: 1000px;
margin: 0 auto;
padding: 30px 20px;
}
.header-section {
background: white;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
padding: 25px;
margin-bottom: 30px;
text-align: center;
}
.header-title {
font-size: 2rem;
font-weight: bold;
color: #333;
margin-bottom: 10px;
}
.header-subtitle {
color: #666;
font-size: 1.1rem;
margin-bottom: 20px;
}
.progress-info {
display: flex;
justify-content: center;
gap: 30px;
flex-wrap: wrap;
}
.progress-item {
text-align: center;
}
.progress-number {
font-size: 1.5rem;
font-weight: bold;
color: #007bff;
}
.progress-label {
font-size: 0.9rem;
color: #666;
text-transform: uppercase;
}
.participants-list {
display: flex;
flex-direction: column;
gap: 20px;
margin-bottom: 30px;
}
.participant-card {
background: white;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
overflow: hidden;
transition: all 0.2s ease;
border-left: 5px solid #e9ecef;
}
.participant-card.completed {
border-left-color: #28a745;
}
.participant-card.in-progress {
border-left-color: #ffc107;
}
.participant-card.collapsed {
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.participant-header {
padding: 20px 25px;
background: #f8f9fa;
display: flex;
justify-content: space-between;
align-items: center;
cursor: pointer;
transition: all 0.2s ease;
}
.participant-card.completed .participant-header {
background: #f8fff9;
}
.participant-card.in-progress .participant-header {
background: #fffbf0;
}
.participant-header:hover {
background: #e9ecef;
}
.participant-card.completed .participant-header:hover {
background: #f0fff1;
}
.participant-card.in-progress .participant-header:hover {
background: #fff8e1;
}
.participant-info {
display: flex;
align-items: center;
gap: 15px;
}
.participant-name {
font-size: 1.4rem;
font-weight: bold;
color: #333;
}
.participant-id {
background: #007bff;
color: white;
padding: 6px 15px;
border-radius: 15px;
font-size: 0.9rem;
font-weight: bold;
}
.participant-status {
display: flex;
align-items: center;
gap: 15px;
}
.total-score {
text-align: right;
}
.score-number {
font-size: 1.8rem;
font-weight: bold;
color: #28a745;
}
.score-label {
font-size: 0.8rem;
color: #666;
text-transform: uppercase;
}
.completion-badge {
padding: 6px 15px;
border-radius: 15px;
font-size: 0.9rem;
font-weight: bold;
text-transform: uppercase;
}
.badge-completed {
background: #28a745;
color: white;
}
.badge-in-progress {
background: #ffc107;
color: #856404;
}
.badge-not-started {
background: #6c757d;
color: white;
}
.collapse-icon {
font-size: 1.2rem;
transition: transform 0.3s ease;
color: #666;
}
.participant-card.collapsed .collapse-icon {
transform: rotate(-90deg);
}
.participant-content {
max-height: 1000px;
overflow: hidden;
transition: max-height 0.3s ease;
}
.participant-card.collapsed .participant-content {
max-height: 0;
}
.targets-section {
padding: 25px;
}
.targets-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
gap: 10px;
margin-bottom: 20px;
max-width: 100%;
}
/* Responsive adjustments for 20 targets */
@media (max-width: 768px) {
.targets-grid {
grid-template-columns: repeat(5, 1fr);
gap: 8px;
}
}
@media (max-width: 480px) {
.targets-grid {
grid-template-columns: repeat(4, 1fr);
gap: 6px;
padding: 15px;
}
}
.target-group {
border: 2px solid #e9ecef;
border-radius: 8px;
padding: 10px;
background: #f8f9fa;
text-align: center;
}
.target-group.completed {
border-color: #28a745;
background: #f8fff9;
}
.target-number {
font-size: 0.8rem;
font-weight: bold;
color: #333;
margin-bottom: 5px;
}
.shots-container {
display: flex;
flex-direction: column;
gap: 3px;
}
.shot-input {
width: 100%;
padding: 6px;
border: 1px solid #ddd;
border-radius: 4px;
text-align: center;
font-size: 0.9rem;
font-weight: bold;
}
.shot-input:focus {
outline: none;
border-color: #007bff;
box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}
.shot-input.valid {
border-color: #28a745;
background: #f8fff9;
}
.participant-actions {
display: flex;
justify-content: space-between;
align-items: center;
gap: 10px;
margin-top: 20px;
padding-top: 20px;
border-top: 1px solid #f0f0f0;
}
.action-btn {
padding: 10px 18px;
border: none;
border-radius: 6px;
font-size: 0.9rem;
font-weight: bold;
cursor: pointer;
transition: all 0.2s ease;
}
.clear-btn {
background: #6c757d;
color: white;
}
.clear-btn:hover {
background: #5a6268;
}
.save-btn {
background: #007bff;
color: white;
}
.save-btn:hover {
background: #0056b3;
}
.auto-fill-btn {
background: #ffc107;
color: #856404;
}
.auto-fill-btn:hover {
background: #e0a800;
}
.finish-section {
background: white;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
padding: 25px;
text-align: center;
}
.finish-title {
font-size: 1.5rem;
font-weight: bold;
color: #333;
margin-bottom: 15px;
}
.finish-description {
color: #666;
margin-bottom: 20px;
}
.finish-btn {
background: #28a745;
border: none;
color: white;
padding: 15px 30px;
border-radius: 8px;
cursor: pointer;
font-size: 1.1rem;
font-weight: bold;
transition: all 0.2s ease;
}
.finish-btn:hover {
background: #1e7e34;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}
.finish-btn:disabled {
background: #6c757d;
cursor: not-allowed;
transform: none;
box-shadow: none;
}
.warning-message {
background: #fff3cd;
border: 1px solid #ffeaa7;
color: #856404;
padding: 12px 15px;
border-radius: 6px;
margin: 15px 0;
}
/* Responsive adjustments */
@media (max-width: 768px) {
.participant-header {
flex-direction: column;
align-items: flex-start;
gap: 15px;
}
.participant-status {
width: 100%;
justify-content: space-between;
}
.progress-info {
gap: 20px;
}
}
/* Loading and saving indicators */
.saving {
opacity: 0.7;
pointer-events: none;
}
.saving::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 20px;
height: 20px;
margin: -10px 0 0 -10px;
border: 2px solid #f3f3f3;
border-top: 2px solid #007bff;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
</head>
<body>
<div class="navbar">
<div class="navbar-title">🎯 Results Calculator</div>
<div class="navbar-controls">
<a href="/" class="nav-btn">← Dashboard</a>
<a href="/tournament/draft" class="nav-btn">📋 Draft</a>
</div>
</div>
<div class="container">
<div class="header-section">
<div class="header-title">🎯 Tournament Scoring</div>
<div class="header-subtitle">Enter scores for each participant (20 targets, 2 shots each). Score 0 = miss.</div>
<div class="progress-info">
<div class="progress-item">
<div class="progress-number" id="completedCount">0</div>
<div class="progress-label">Completed</div>
</div>
<div class="progress-item">
<div class="progress-number" id="totalParticipants">{{ results.participants|length }}</div>
<div class="progress-label">Total</div>
</div>
<div class="progress-item">
<div class="progress-number" id="totalShots">0</div>
<div class="progress-label">Total Shots</div>
</div>
</div>
</div>
<div class="participants-list">
{% for player_id, participant in results.participants.items() %}
<div class="participant-card" id="card-{{ player_id }}" data-player-id="{{ player_id }}">
<div class="participant-header" onclick="toggleParticipant({{ player_id }})">
<div class="participant-info">
<div class="participant-name">{{ participant.name }}</div>
<div class="participant-id">ID: {{ player_id }}</div>
</div>
<div class="participant-status">
<div class="total-score">
<div class="score-number" id="total-{{ player_id }}">{{ participant.total_score }}</div>
<div class="score-label">Points</div>
</div>
<div class="completion-badge" id="badge-{{ player_id }}">
{% if participant.completed %}
<span class="badge-completed">Completed</span>
{% else %}
<span class="badge-not-started">Not Started</span>
{% endif %}
</div>
<div class="collapse-icon"></div>
</div>
</div>
<div class="participant-content">
<div class="targets-section">
<div class="targets-grid" id="targets-{{ player_id }}">
{% for i in range(1, 21) %}
<div class="target-group" id="target-group-{{ player_id }}-{{ i }}">
<div class="target-number">{{ i }}</div>
<div class="shots-container">
<input type="number"
class="shot-input"
id="shot1-{{ player_id }}-{{ i }}"
data-player="{{ player_id }}"
data-target="{{ i }}"
data-shot="1"
min="0"
max="10"
value="{% if participant.targets[i|string].shot1 is not none %}{{ participant.targets[i|string].shot1 }}{% endif %}"
placeholder="S1"
oninput="updateScore({{ player_id }}, {{ i }}, 1, this.value)">
<input type="number"
class="shot-input"
id="shot2-{{ player_id }}-{{ i }}"
data-player="{{ player_id }}"
data-target="{{ i }}"
data-shot="2"
min="0"
max="10"
value="{% if participant.targets[i|string].shot2 is not none %}{{ participant.targets[i|string].shot2 }}{% endif %}"
placeholder="S2"
oninput="updateScore({{ player_id }}, {{ i }}, 2, this.value)">
</div>
</div>
{% endfor %}
</div>
<div class="participant-actions">
<button class="action-btn clear-btn" onclick="clearParticipant({{ player_id }})">
🗑️ Clear All
</button>
<button class="action-btn auto-fill-btn" onclick="autoFillDemo({{ player_id }})">
🎲 Demo Fill
</button>
<button class="action-btn save-btn" onclick="saveParticipant({{ player_id }})">
💾 Save Progress
</button>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
<div class="finish-section">
<div class="finish-title">🏁 Finish Tournament</div>
<div class="finish-description">
Complete scoring for all participants and finalize tournament results.
</div>
<div class="warning-message" id="finishWarning" style="display: none;">
<strong>Warning:</strong> Not all participants have completed scores. Please ensure all scoring is complete before finishing.
</div>
<button class="finish-btn" id="finishBtn" onclick="finishTournament()">
🏆 Finish Tournament & Show Results
</button>
</div>
</div>
<script>
let results = {{ results|tojson }};
let saveTimeout = {};
// Debounce function for auto-saving
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) func.apply(context, args);
};
}
function toggleParticipant(playerId) {
const card = document.getElementById(`card-${playerId}`);
card.classList.toggle('collapsed');
}
function updateScore(playerId, targetNum, shotNum, value) {
const playerIdStr = playerId.toString();
const targetStr = targetNum.toString();
// Parse input - allow empty string, treat as null/undefined for completion check
let numValue = null;
if (value !== '' && value !== null && value !== undefined) {
numValue = parseInt(value);
if (isNaN(numValue)) numValue = null;
else numValue = Math.max(0, Math.min(10, numValue)); // Clamp between 0-10
}
// Update the input field with clamped value
const input = document.getElementById(`shot${shotNum}-${playerId}-${targetNum}`);
if (input && numValue !== null && input.value !== numValue.toString()) {
input.value = numValue;
}
// Update local data
if (!results.participants[playerIdStr]) {
console.error('Player not found:', playerIdStr);
return;
}
if (!results.participants[playerIdStr].targets[targetStr]) {
results.participants[playerIdStr].targets[targetStr] = {shot1: null, shot2: null};
}
results.participants[playerIdStr].targets[targetStr][`shot${shotNum}`] = numValue;
// Update target group styling
updateTargetGroupStyling(playerId, targetNum);
// Recalculate total
updateParticipantTotal(playerId);
updateParticipantStatus(playerId);
updateOverallProgress();
// Visual feedback for input
if (numValue !== null) {
input.classList.add('valid');
} else {
input.classList.remove('valid');
}
// Auto-save with debounce
clearTimeout(saveTimeout[playerId]);
saveTimeout[playerId] = setTimeout(() => {
saveParticipant(playerId, true);
}, 1000);
}
function updateTargetGroupStyling(playerId, targetNum) {
const playerIdStr = playerId.toString();
const targetStr = targetNum.toString();
const targetGroup = document.getElementById(`target-group-${playerId}-${targetNum}`);
if (targetGroup && results.participants[playerIdStr].targets[targetStr]) {
const shot1 = results.participants[playerIdStr].targets[targetStr].shot1;
const shot2 = results.participants[playerIdStr].targets[targetStr].shot2;
// Target is completed if both shots have been entered (including 0)
const isCompleted = shot1 !== null && shot1 !== undefined && shot2 !== null && shot2 !== undefined;
if (isCompleted) {
targetGroup.classList.add('completed');
} else {
targetGroup.classList.remove('completed');
}
}
}
function updateParticipantTotal(playerId) {
const playerIdStr = playerId.toString();
const targets = results.participants[playerIdStr].targets;
let total = 0;
for (let target in targets) {
const shot1 = targets[target].shot1;
const shot2 = targets[target].shot2;
total += (shot1 !== null && shot1 !== undefined ? shot1 : 0);
total += (shot2 !== null && shot2 !== undefined ? shot2 : 0);
}
results.participants[playerIdStr].total_score = total;
// Update display
const totalElement = document.getElementById(`total-${playerId}`);
if (totalElement) {
totalElement.textContent = total;
// Add visual feedback
totalElement.style.color = '#28a745';
setTimeout(() => {
totalElement.style.color = '';
}, 300);
}
}
function updateParticipantStatus(playerId) {
const playerIdStr = playerId.toString();
const targets = results.participants[playerIdStr].targets;
const card = document.getElementById(`card-${playerId}`);
const badge = document.getElementById(`badge-${playerId}`);
let completedTargets = 0;
let totalShots = 0;
for (let target in targets) {
const shot1 = targets[target].shot1;
const shot2 = targets[target].shot2;
// Count shots that have been entered (including 0)
if (shot1 !== null && shot1 !== undefined) totalShots++;
if (shot2 !== null && shot2 !== undefined) totalShots++;
// Target is completed if both shots have been entered
if (shot1 !== null && shot1 !== undefined && shot2 !== null && shot2 !== undefined) {
completedTargets++;
}
}
const isCompleted = completedTargets === 20;
const isInProgress = totalShots > 0 && !isCompleted;
results.participants[playerIdStr].completed = isCompleted;
// Debug logging
console.log(`Player ${playerId} status:`, {
completedTargets,
totalShots,
isCompleted,
isInProgress,
sampleTarget: targets['1']
});
// Update card styling
card.classList.remove('completed', 'in-progress');
if (isCompleted) {
card.classList.add('completed');
badge.innerHTML = '<span class="badge-completed">Completed</span>';
} else if (isInProgress) {
card.classList.add('in-progress');
badge.innerHTML = '<span class="badge-in-progress">In Progress</span>';
} else {
badge.innerHTML = '<span class="badge-not-started">Not Started</span>';
}
}
function updateOverallProgress() {
let completedCount = 0;
let totalShots = 0;
for (let playerId in results.participants) {
const participant = results.participants[playerId];
if (participant.completed) {
completedCount++;
}
for (let target in participant.targets) {
const targetData = participant.targets[target];
if (targetData.shot1 !== null && targetData.shot1 !== undefined) totalShots++;
if (targetData.shot2 !== null && targetData.shot2 !== undefined) totalShots++;
}
}
document.getElementById('completedCount').textContent = completedCount;
document.getElementById('totalShots').textContent = totalShots;
// Update finish button state
const finishBtn = document.getElementById('finishBtn');
const finishWarning = document.getElementById('finishWarning');
const allCompleted = completedCount === Object.keys(results.participants).length;
if (allCompleted) {
finishBtn.disabled = false;
finishWarning.style.display = 'none';
} else {
finishBtn.disabled = true;
finishWarning.style.display = 'block';
}
}
async function saveParticipant(playerId, silent = false) {
const card = document.getElementById(`card-${playerId}`);
if (!silent) card.classList.add('saving');
try {
const playerIdStr = playerId.toString();
const participantData = results.participants[playerIdStr];
const response = await fetch(`/api/results/participant/${playerId}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
targets: participantData.targets
})
});
if (response.ok) {
const result = await response.json();
if (!silent) {
// Show success feedback
const saveBtn = card.querySelector('.save-btn');
const originalText = saveBtn.textContent;
saveBtn.textContent = '✅ Saved';
saveBtn.style.background = '#28a745';
setTimeout(() => {
saveBtn.textContent = originalText;
saveBtn.style.background = '';
}, 2000);
}
} else {
throw new Error('Failed to save');
}
} catch (error) {
console.error('Error saving participant:', error);
if (!silent) {
alert('Failed to save participant data. Please try again.');
}
} finally {
if (!silent) card.classList.remove('saving');
}
}
function clearParticipant(playerId) {
if (!confirm('Are you sure you want to clear all scores for this participant?')) {
return;
}
const playerIdStr = playerId.toString();
// Clear all inputs
for (let i = 1; i <= 20; i++) {
const shot1Input = document.getElementById(`shot1-${playerId}-${i}`);
const shot2Input = document.getElementById(`shot2-${playerId}-${i}`);
if (shot1Input) shot1Input.value = '';
if (shot2Input) shot2Input.value = '';
// Update data
results.participants[playerIdStr].targets[i.toString()] = {shot1: null, shot2: null};
// Update target group styling
updateTargetGroupStyling(playerId, i);
}
updateParticipantTotal(playerId);
updateParticipantStatus(playerId);
updateOverallProgress();
// Save changes
saveParticipant(playerId);
}
function autoFillDemo(playerId) {
if (!confirm('Fill with random demo scores? This will overwrite existing data.')) {
return;
}
const playerIdStr = playerId.toString();
// Fill with random scores (0-10) - all fields will be filled
for (let i = 1; i <= 20; i++) {
const shot1 = Math.floor(Math.random() * 11);
const shot2 = Math.floor(Math.random() * 11);
const shot1Input = document.getElementById(`shot1-${playerId}-${i}`);
const shot2Input = document.getElementById(`shot2-${playerId}-${i}`);
if (shot1Input) shot1Input.value = shot1;
if (shot2Input) shot2Input.value = shot2;
// Update data
results.participants[playerIdStr].targets[i.toString()] = {
shot1: shot1,
shot2: shot2
};
// Update target group styling
updateTargetGroupStyling(playerId, i);
}
updateParticipantTotal(playerId);
updateParticipantStatus(playerId);
updateOverallProgress();
// Save changes
saveParticipant(playerId);
}
async function finishTournament() {
const allCompleted = Object.values(results.participants).every(p => p.completed);
if (!allCompleted) {
alert('Please complete scoring for all participants before finishing the tournament.');
return;
}
if (!confirm('Are you sure you want to finish the tournament? This will finalize all results and make them viewable.')) {
return;
}
const finishBtn = document.getElementById('finishBtn');
finishBtn.disabled = true;
finishBtn.textContent = '🔄 Finishing Tournament...';
try {
const response = await fetch('/api/results/finish', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
}
});
if (response.ok) {
alert('Tournament finished successfully! Redirecting to results...');
// Small delay to ensure the alert is seen
setTimeout(() => {
window.location.href = '/results';
}, 1000);
} else {
const error = await response.json();
throw new Error(error.message || 'Failed to finish tournament');
}
} catch (error) {
console.error('Error finishing tournament:', error);
alert('Failed to finish tournament: ' + error.message);
finishBtn.disabled = false;
finishBtn.textContent = '🏆 Finish Tournament & Show Results';
}
}
// Keyboard shortcuts
document.addEventListener('keydown', function(event) {
if (event.ctrlKey && event.key === 's') {
event.preventDefault();
// Save all participants
Object.keys(results.participants).forEach(playerId => {
saveParticipant(parseInt(playerId), true);
});
// Show feedback
const feedback = document.createElement('div');
feedback.style.cssText = `
position: fixed;
top: 20px;
right: 20px;
background: #28a745;
color: white;
padding: 10px 20px;
border-radius: 6px;
z-index: 1000;
font-weight: bold;
`;
feedback.textContent = '💾 All progress saved!';
document.body.appendChild(feedback);
setTimeout(() => {
document.body.removeChild(feedback);
}, 3000);
}
});
// Initialize
document.addEventListener('DOMContentLoaded', function() {
// Debug: Log initial results structure
console.log('Initial results structure:', results);
console.log('Sample participant targets:', results.participants[Object.keys(results.participants)[0]]?.targets);
// Update initial states
Object.keys(results.participants).forEach(playerId => {
for (let i = 1; i <= 20; i++) {
updateTargetGroupStyling(parseInt(playerId), i);
}
updateParticipantStatus(parseInt(playerId));
});
updateOverallProgress();
// Add input validation
document.querySelectorAll('.shot-input').forEach(input => {
input.addEventListener('blur', function() {
if (this.value !== '') {
const value = parseInt(this.value);
const clampedValue = Math.max(0, Math.min(10, isNaN(value) ? 0 : value));
if (this.value !== clampedValue.toString()) {
this.value = clampedValue;
// Trigger update
const playerId = parseInt(this.dataset.player);
const targetNum = parseInt(this.dataset.target);
const shotNum = parseInt(this.dataset.shot);
updateScore(playerId, targetNum, shotNum, clampedValue);
}
}
});
// Handle Enter key to move to next input
input.addEventListener('keydown', function(e) {
if (e.key === 'Enter') {
const inputs = Array.from(document.querySelectorAll('.shot-input'));
const currentIndex = inputs.indexOf(this);
const nextInput = inputs[currentIndex + 1];
if (nextInput) {
nextInput.focus();
nextInput.select();
}
}
});
});
console.log('🎯 Results Calculator initialized');
console.log('📊 Participants:', Object.keys(results.participants).length);
});
</script>
</body>
</html>