|
|
|
@ -105,7 +105,7 @@ function renderBracket(options) { |
|
|
|
// Create matches container
|
|
|
|
// Create matches container
|
|
|
|
const matchesContainer = document.createElement("div"); |
|
|
|
const matchesContainer = document.createElement("div"); |
|
|
|
matchesContainer.className = "matches-container"; |
|
|
|
matchesContainer.className = "matches-container"; |
|
|
|
if (doubleButterflyMode == true) { |
|
|
|
if (doubleButterflyMode == true && roundCount > 3) { |
|
|
|
if (roundIndex >= finalRoundIndex - 1) { |
|
|
|
if (roundIndex >= finalRoundIndex - 1) { |
|
|
|
matchesContainer.style.transform = `translateX(-50%)`; |
|
|
|
matchesContainer.style.transform = `translateX(-50%)`; |
|
|
|
if (roundIndex >= finalRoundIndex + 2) { |
|
|
|
if (roundIndex >= finalRoundIndex + 2) { |
|
|
|
@ -146,15 +146,19 @@ function renderBracket(options) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (roundIndex === 0) { |
|
|
|
if (roundIndex === 0) { |
|
|
|
|
|
|
|
if (doubleButterflyMode == false) { |
|
|
|
|
|
|
|
nextMatchDistance = 0; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (realRoundIndex > 1) { |
|
|
|
nextMatchDistance = 0; |
|
|
|
nextMatchDistance = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if (roundCount > 1) { |
|
|
|
if (roundCount > 1) { |
|
|
|
const nextMatchesCount = rounds[roundIndex + 1].length; |
|
|
|
const nextMatchesCount = rounds[roundIndex + 1].length; |
|
|
|
|
|
|
|
|
|
|
|
if (currentMatchesCount == nextMatchesCount && roundCount > 2) { |
|
|
|
if (currentMatchesCount == nextMatchesCount && roundCount > 2) { |
|
|
|
nextMatchDistance = 0; |
|
|
|
nextMatchDistance = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
|
|
|
|
nextMatchDistance = 0; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
top = matchIndex * (matchHeight + matchSpacing) * minimumMatchDistance; |
|
|
|
top = matchIndex * (matchHeight + matchSpacing) * minimumMatchDistance; |
|
|
|
@ -163,7 +167,11 @@ function renderBracket(options) { |
|
|
|
top = top + (matchHeight + matchSpacing) / 2; |
|
|
|
top = top + (matchHeight + matchSpacing) / 2; |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (roundIndex === roundCount - 1 && doubleButterflyMode == true) { |
|
|
|
} else if (roundIndex === roundCount - 1 && doubleButterflyMode == true) { |
|
|
|
|
|
|
|
if (roundCount > 3) { |
|
|
|
nextMatchDistance = 0; |
|
|
|
nextMatchDistance = 0; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
nextMatchDistance = nextMatchDistance / 2; |
|
|
|
|
|
|
|
} |
|
|
|
} else if (roundIndex == finalRoundIndex && realRoundIndex == 0) { |
|
|
|
} else if (roundIndex == finalRoundIndex && realRoundIndex == 0) { |
|
|
|
//realRoundIndex 0 means final's round
|
|
|
|
//realRoundIndex 0 means final's round
|
|
|
|
const values = Object.values(matchPositions[roundIndex - 1]); |
|
|
|
const values = Object.values(matchPositions[roundIndex - 1]); |
|
|
|
|