Add time indication for matches in broadcast bracket

mailing
Razmig Sarkissian 2 months ago
parent 9717e71988
commit 7fec722362
  1. 17
      tournaments/static/tournaments/css/tournament_bracket.css
  2. 2
      tournaments/static/tournaments/js/tournament_bracket.js
  3. 7
      tournaments/templates/tournaments/broadcast/broadcasted_bracket.html

@ -61,6 +61,23 @@
justify-content: center; justify-content: center;
} }
.match-time-indication {
position: absolute;
color: #fff;
left: 50%; /* Center horizontally */
transform: translateX(-50%); /* Center it exactly */
text-align: center;
font-weight: bold;
width: 100%; /* Change from 100% to auto */
padding: 0px 0px;
white-space: nowrap; /* Prevent text from wrapping */
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.round-title.broadcast-mode { .round-title.broadcast-mode {
font-size: 0.8em; font-size: 0.8em;
width: auto; /* Change from 100% to auto */ width: auto; /* Change from 100% to auto */

@ -347,7 +347,7 @@ function renderBracket(options) {
} }
matchDiv.style.setProperty( matchDiv.style.setProperty(
"--semi-final-distance", "--semi-final-distance",
`${baseDistance / 2}px`, `${baseDistance / 2.3}px`,
); );
matchDiv.style.setProperty( matchDiv.style.setProperty(

@ -158,8 +158,15 @@
// Create the match content using our HTML generator // Create the match content using our HTML generator
template.innerHTML = `<div class="bubble broadcast-bracket-match ${(!match.ended && match.started) ? 'match-running' : ''}">${createMatchHTML(match)}</div>`; template.innerHTML = `<div class="bubble broadcast-bracket-match ${(!match.ended && match.started) ? 'match-running' : ''}">${createMatchHTML(match)}</div>`;
template_time = document.createElement('div');
template_time.className = 'match-time-indication';
template_time.style.textAlign = 'center';
template_time.innerHTML = `<div>${match.time_indication}</div>`;
template.appendChild(template_time);
tempContainer.appendChild(template); tempContainer.appendChild(template);
}); });
}); });

Loading…
Cancel
Save