diff --git a/templates/calculator.html b/templates/calculator.html index db087ae..1d3fd79 100644 --- a/templates/calculator.html +++ b/templates/calculator.html @@ -2,7 +2,7 @@ - Kalkulator + Nabijanje @@ -71,7 +71,7 @@ font-size: 0.95rem; font-weight: 700; cursor: pointer; transition: background 0.2s, transform 0.1s; width: 100%; } - .gen-btn:hover:not(:disabled) { background: #1e7e34; transform: translateY(-1px); } + .gen-btn:hover:not(:disabled) { background: #1e7e34; } .gen-btn:disabled { background: #ced4da; cursor: not-allowed; } .left-utils { padding: 0 20px 18px; display: none; flex-direction: column; gap: 7px; flex-shrink: 0; } @@ -80,12 +80,12 @@ padding: 9px 12px; border-radius: 8px; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.15s; width: 100%; text-align: center; } - .btn-zeros { background: white; border: 2px solid #6c757d; color: #6c757d; } - .btn-zeros:hover { background: #6c757d; color: white; } - .btn-reset { background: white; border: 2px solid #dc3545; color: #dc3545; } - .btn-reset:hover { background: #dc3545; color: white; } - .btn-print { background: white; border: 2px solid #6f42c1; color: #6f42c1; } - .btn-print:hover { background: #6f42c1; color: white; } + .btn-zeros { background: #6c757d; border: 2px solid #6c757d; color: white; } + .btn-zeros:hover { background: #545b62; border-color: #545b62; } + .btn-reset { background: #dc3545; border: 2px solid #dc3545; color: white; } + .btn-reset:hover { background: #b02a37; border-color: #b02a37; } + .btn-print { background: #6f42c1; border: 2px solid #6f42c1; color: white; } + .btn-print:hover { background: #59359a; border-color: #59359a; } @media print { /* hide everything except the print layout */ @@ -401,7 +401,9 @@ flex: 1; min-width: 0; font-size: 0.88rem; font-weight: 600; color: #2c3e50; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + cursor: pointer; } + .score-name:hover { color: #f97316; } .score-tens { font-size: 0.7rem; font-weight: 700; color: #ffc107; flex-shrink: 0; white-space: nowrap; } .score-pts { font-size: 1.05rem; font-weight: 800; color: #28a745; flex-shrink: 0; } .score-del { @@ -416,24 +418,24 @@ .score-print-footer { padding: 8px 10px 10px; flex-shrink: 0; } .btn-print { width: 100%; padding: 9px; border-radius: 8px; - border: 2px solid #6f42c1; background: white; - color: #6f42c1; font-size: 0.82rem; font-weight: 600; + border: 2px solid #6f42c1; background: #6f42c1; + color: white; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.15s; } - .btn-print:hover { background: #6f42c1; color: white; } + .btn-print:hover { background: #59359a; border-color: #59359a; } .btn-clear-board { width: 100%; padding: 9px; border-radius: 8px; - border: 2px solid #dc3545; background: white; - color: #dc3545; font-size: 0.82rem; font-weight: 600; + border: 2px solid #dc3545; background: #dc3545; + color: white; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.15s; } - .btn-clear-board:hover { background: #dc3545; color: white; } + .btn-clear-board:hover { background: #b02a37; border-color: #b02a37; } @@ -778,13 +780,13 @@ footer.style.display = ''; list.innerHTML = scoreboard.map((entry, idx) => { - const rank = idx + 1; + const rank = computeRank(idx); const rankClass = rank <= 3 ? `rank-${rank}` : ''; const medal = rank === 1 ? '🥇' : rank === 2 ? '🥈' : rank === 3 ? '🥉' : rank; return `
${medal}
-
${entry.name}
+
${entry.name}
${entry.tens}×10
${entry.score}
@@ -826,10 +828,17 @@ resetScoresQuiet(); } + function computeRank(idx) { + const e = scoreboard[idx]; + return scoreboard.filter(o => + o.score > e.score || (o.score === e.score && o.tens > e.tens) + ).length + 1; + } + function printLeaderboard() { const medals = ['🥇','🥈','🥉']; const rows = scoreboard.map((e, idx) => { - const rank = idx + 1; + const rank = computeRank(idx); const rc = rank <= 3 ? `r${rank}` : ''; const med = rank <= 3 ? medals[rank - 1] : rank; return ` diff --git a/templates/index.html b/templates/index.html index ec8e2f8..282ec71 100644 --- a/templates/index.html +++ b/templates/index.html @@ -878,7 +878,7 @@

Turnirji

🏆 Način Turnirja - 🎯 Kalkulator + 👤 Analiza Igralcev 📚 Arhiv
@@ -1863,7 +1863,9 @@ list.style.display = ''; list.innerHTML = data.map((e, idx) => { - const rank = idx + 1; + const rank = data.filter(o => + o.score > e.score || (o.score === e.score && o.tens > e.tens) + ).length + 1; const rc = rank <= 3 ? `r${rank}` : ''; const med = rank === 1 ? '🥇' : rank === 2 ? '🥈' : rank === 3 ? '🥉' : rank; return `
diff --git a/templates/tournament.html b/templates/tournament.html index 3c5fffc..f24e65d 100644 --- a/templates/tournament.html +++ b/templates/tournament.html @@ -776,6 +776,26 @@ background: linear-gradient(90deg, #667eea 0%, #764ba2 100%); } + /* Nabijanje - Orange theme */ + .type-option[data-type="nabijanje"] { + border-color: #f97316; + } + + .type-option[data-type="nabijanje"]:hover { + border-color: #ea580c; + box-shadow: 0 4px 15px rgba(249, 115, 22, 0.25); + transform: translateY(-2px); + } + + .type-option[data-type="nabijanje"].selected { + border-color: #ea580c; + background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%); + } + + .type-option[data-type="nabijanje"]::before { + background: linear-gradient(90deg, #f97316 0%, #fbbf24 100%); + } + .type-option input[type="radio"] { margin-right: 10px; width: 18px; @@ -1833,6 +1853,13 @@
Razširjeni format s 40 tarčami, 2 strela na tarčo (80 strelov skupaj)
+
+ +
+
💥 Nabijanje
+
Prosti format z nastavljivo konfiguracijo tarč in strelov
+
+
@@ -1944,6 +1971,11 @@ const radio = event.currentTarget.querySelector('input[type="radio"]'); if (radio) radio.checked = true; + const isNabijanje = type === 'nabijanje'; + document.getElementById('startLeagueBtn').style.display = isNabijanje ? 'none' : ''; + document.getElementById('startSingleBtn').textContent = isNabijanje + ? '💥 Odpri Nabijanje' + : '🏅 ' + (window._i18n?.['league.start_single_tournament'] || 'Začni Posamezen Turnir'); } // Filter and search functions @@ -2451,8 +2483,13 @@ // Start single tournament async function startSingleTournament() { + if (selectedTournamentType === 'nabijanje') { + window.location.href = '/calculator'; + return; + } + const enabledPlayers = players.filter(p => p.enabled); - + if (enabledPlayers.length < 1) { alert('Need at least 1 enabled player to start tournament'); return;