diff --git a/src/main/resources/index.html b/src/main/resources/index.html index cb01ff6..429f4d0 100644 --- a/src/main/resources/index.html +++ b/src/main/resources/index.html @@ -109,7 +109,8 @@ button.active { background: #2a2a2a; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.5); - overflow: hidden; + overflow-x: auto; + overflow-y: hidden; margin: 0 auto; max-width: 1400px; width: 100%; @@ -235,10 +236,6 @@ tbody tr:last-child td { h1 { font-size: 1.5rem; } - - th:nth-child(4), td:nth-child(4) { - display: none; - } } @@ -328,7 +325,8 @@ function populateSports() { // Tlačítka pro jednotlivé sporty for (const s of sports) { const btn = document.createElement('button'); - btn.textContent = s; + const icon = getSportIcon(s); + btn.textContent = `${icon} ${s}`; btn.className = selectedSport === s ? 'active' : ''; btn.addEventListener('click', () => { selectedSport = s; @@ -340,7 +338,7 @@ function populateSports() { // Tlačítko "Všechny sporty" jako poslední const allBtn = document.createElement('button'); - allBtn.textContent = 'Všechny sporty'; + allBtn.textContent = '🏆 Všechny sporty'; allBtn.className = selectedSport === '' ? 'active' : ''; allBtn.addEventListener('click', () => { selectedSport = ''; @@ -354,10 +352,12 @@ function populateSports() { function updateSportButtons() { const buttons = sportButtonsEl.querySelectorAll('button'); buttons.forEach(btn => { - if (btn.textContent === 'Všechny sporty') { + if (btn.textContent.includes('Všechny sporty')) { btn.className = selectedSport === '' ? 'active' : ''; } else { - btn.className = selectedSport === btn.textContent ? 'active' : ''; + // Extrahuj jméno sportu z textu tlačítka (odstraň ikonu) + const sportName = btn.textContent.split(' ').slice(1).join(' '); + btn.className = selectedSport === sportName ? 'active' : ''; } }); } @@ -374,19 +374,16 @@ function applyFilters() { // === formátování data a času === function formatDateTime(dateStr, timeStr) { - if (!dateStr || !timeStr) return '—'; + if (!timeStr) return '—'; try { // Normalizuj čas na formát HH:MM (přidej vedoucí nulu, pokud chybí) const timeParts = timeStr.split(':'); if (timeParts.length === 2) { const hours = timeParts[0].padStart(2, '0'); const minutes = timeParts[1].padStart(2, '0'); - timeStr = `${hours}:${minutes}`; + return `${hours}:${minutes}`; } - - const dt = new Date(dateStr + 'T' + timeStr); - if (isNaN(dt.getTime())) return '—'; - return dt.toLocaleString('cs-CZ', { dateStyle: 'short', timeStyle: 'short' }); + return timeStr; } catch (e) { return '—'; } @@ -422,9 +419,8 @@ function renderList(items) { - - + @@ -437,13 +433,11 @@ function renderList(items) { const league = t.league || ''; const leaguePart = t.leaguePart || ''; const fullLeague = `${league} ${leaguePart}`.trim(); - const sportIcon = getSportIcon(t.sport); tableHTML += ` - - +
Název ČasNázev Sport Liga
${sportIcon}${t.title} ${dateTimeStr}${t.title} ${t.sport || ''} ${fullLeague}