fix broadcast

sync_v2
Razmig Sarkissian 5 months ago
parent f6186beefc
commit 01d574f012
  1. 2
      tournaments/static/tournaments/css/broadcast.css
  2. 1
      tournaments/static/tournaments/css/tournament_bracket.css
  3. 15
      tournaments/static/tournaments/js/tournament_bracket.js
  4. 2
      tournaments/templates/tournaments/broadcast/broadcasted_bracket.html

@ -134,7 +134,7 @@ body {
.left-content.bubble-header.screen-size-overlay { .left-content.bubble-header.screen-size-overlay {
display: flex; display: flex;
align-items: top; /* Vertically align items (logo and text) */ align-items: top; /* Vertically align items (logo and text) */
height: auto; /* Allow height to adjust based on content */ max-height: 14vh; /* Allow height to adjust based on content */
} }
.left-content.bubble-header.screen-size-overlay .left-margin h1.club, .left-content.bubble-header.screen-size-overlay .left-margin h1.club,

@ -311,7 +311,6 @@
#screen-size-overlay { #screen-size-overlay {
font-size: clamp(0.4em, 0.6em, 0.8em) !important; font-size: clamp(0.4em, 0.6em, 0.8em) !important;
max-height: 120px;
} }
} }

@ -36,10 +36,12 @@ function renderBracket(options) {
const screenWidth = window.innerWidth; const screenWidth = window.innerWidth;
let roundTotalCount = roundCount; let roundTotalCount = roundCount;
if (doubleButterflyMode == true && roundCount > 1) { let initialPadding = 40;
if (doubleButterflyMode == true && roundCount > 4) {
roundTotalCount = roundCount - 1; roundTotalCount = roundCount - 1;
initialPadding = 46;
} }
const padding = 46 * roundTotalCount; // Account for some padding/margin const padding = initialPadding * roundTotalCount; // Account for some padding/margin
const availableWidth = screenWidth - padding; const availableWidth = screenWidth - padding;
let responsiveMatchWidth = Math.min( let responsiveMatchWidth = Math.min(
365, 365,
@ -48,10 +50,7 @@ function renderBracket(options) {
let topMargin = 0; let topMargin = 0;
if (isBroadcast) { if (isBroadcast) {
responsiveMatchWidth = Math.min( responsiveMatchWidth = Math.floor(availableWidth / roundTotalCount);
600,
Math.floor(availableWidth / roundTotalCount),
);
let screenHeight = window.innerHeight; let screenHeight = window.innerHeight;
if (roundTotalCount <= 1) { if (roundTotalCount <= 1) {
topMargin = 240; topMargin = 240;
@ -428,8 +427,10 @@ function renderBracket(options) {
matchesContainer.appendChild(titleDiv); matchesContainer.appendChild(titleDiv);
} }
if (roundIndex == 0) { if (roundIndex == 0 && roundCount > 3) {
isIncomingLineIsDisabled = true; isIncomingLineIsDisabled = true;
} else if (roundIndex == 0 && roundCount < 4) {
isIncomingLineIsDisabled = false;
} }
matchDiv.innerHTML = ` matchDiv.innerHTML = `
<div class="incoming-line ${isIncomingLineIsDisabled ? "disabled" : ""}"></div> <div class="incoming-line ${isIncomingLineIsDisabled ? "disabled" : ""}"></div>

@ -42,8 +42,6 @@
color: white; color: white;
padding: 20px; padding: 20px;
max-width: 45%; max-width: 45%;
max-height: 300px;
z-index: 1000; /* Ensure it's on top of other elements */
} }
</style> </style>
</head> </head>

Loading…
Cancel
Save