|
|
|
@ -18,6 +18,8 @@ |
|
|
|
<div data-match-round="{{ forloop.parentloop.counter0 }}" |
|
|
|
<div data-match-round="{{ forloop.parentloop.counter0 }}" |
|
|
|
data-match-index="{{ forloop.counter0 }}" |
|
|
|
data-match-index="{{ forloop.counter0 }}" |
|
|
|
data-disabled="{{ match.disabled|lower }}" |
|
|
|
data-disabled="{{ match.disabled|lower }}" |
|
|
|
|
|
|
|
data-match-group-name="{{ match_group.name }}" |
|
|
|
|
|
|
|
data-match-format="{{ match.format }}" |
|
|
|
class="match-template"> |
|
|
|
class="match-template"> |
|
|
|
{% include 'tournaments/bracket_match_cell.html' %} |
|
|
|
{% include 'tournaments/bracket_match_cell.html' %} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -34,6 +36,7 @@ function renderBracket() { |
|
|
|
const rounds = []; |
|
|
|
const rounds = []; |
|
|
|
const matchPositions = []; |
|
|
|
const matchPositions = []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Group matches by round |
|
|
|
// Group matches by round |
|
|
|
Array.from(matchTemplates).forEach(template => { |
|
|
|
Array.from(matchTemplates).forEach(template => { |
|
|
|
const roundIndex = parseInt(template.dataset.matchRound); |
|
|
|
const roundIndex = parseInt(template.dataset.matchRound); |
|
|
|
@ -54,62 +57,123 @@ function renderBracket() { |
|
|
|
bracket.innerHTML = ''; |
|
|
|
bracket.innerHTML = ''; |
|
|
|
const roundCount = rounds.length; |
|
|
|
const roundCount = rounds.length; |
|
|
|
const finalRoundIndex = (roundCount - 1) / 2; |
|
|
|
const finalRoundIndex = (roundCount - 1) / 2; |
|
|
|
|
|
|
|
let nextMatchDistance = baseDistance; |
|
|
|
|
|
|
|
let minimumMatchDistance = 1; |
|
|
|
|
|
|
|
if (rounds[0].length <= 2) { |
|
|
|
|
|
|
|
minimumMatchDistance = 2 |
|
|
|
|
|
|
|
nextMatchDistance = baseDistance * 2; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
rounds.forEach((roundMatches, roundIndex) => { |
|
|
|
rounds.forEach((roundMatches, roundIndex) => { |
|
|
|
const roundDiv = document.createElement('div'); |
|
|
|
const roundDiv = document.createElement('div'); |
|
|
|
roundDiv.className = 'butterfly-round'; |
|
|
|
roundDiv.className = 'butterfly-round'; |
|
|
|
roundDiv.style.setProperty('--match-width', `${365}px`); |
|
|
|
roundDiv.style.setProperty('--match-width', `${365}px`); |
|
|
|
matchPositions[roundIndex] = []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Create title |
|
|
|
|
|
|
|
const titleDiv = document.createElement('div'); |
|
|
|
|
|
|
|
titleDiv.className = 'round-title'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Get the match group name and format |
|
|
|
|
|
|
|
const firstMatchTemplate = roundMatches[0].closest('.match-template'); |
|
|
|
|
|
|
|
const matchGroupName = firstMatchTemplate.dataset.matchGroupName; |
|
|
|
|
|
|
|
const matchFormat = firstMatchTemplate.dataset.matchFormat; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const nameSpan = document.createElement('div'); |
|
|
|
|
|
|
|
nameSpan.className = 'round-name'; |
|
|
|
|
|
|
|
nameSpan.textContent = matchGroupName; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const formatSpan = document.createElement('div'); |
|
|
|
|
|
|
|
formatSpan.className = 'round-format'; |
|
|
|
|
|
|
|
formatSpan.textContent = matchFormat; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
titleDiv.appendChild(nameSpan); |
|
|
|
|
|
|
|
titleDiv.appendChild(formatSpan); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Create matches container |
|
|
|
|
|
|
|
const matchesContainer = document.createElement('div'); |
|
|
|
|
|
|
|
matchesContainer.className = 'matches-container'; |
|
|
|
|
|
|
|
if (roundIndex >= finalRoundIndex - 1) { |
|
|
|
|
|
|
|
if (roundCount > 5) { |
|
|
|
|
|
|
|
matchesContainer.style.transform = `translateX(-50%)`; |
|
|
|
|
|
|
|
if (roundIndex >= finalRoundIndex + 2) { |
|
|
|
|
|
|
|
matchesContainer.style.transform = `translateX(-100%)`; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
roundDiv.appendChild(matchesContainer); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
matchPositions[roundIndex] = []; |
|
|
|
roundMatches.forEach((matchTemplate, matchIndex) => { |
|
|
|
roundMatches.forEach((matchTemplate, matchIndex) => { |
|
|
|
const matchDiv = document.createElement('div'); |
|
|
|
const matchDiv = document.createElement('div'); |
|
|
|
matchDiv.className = 'butterfly-match'; |
|
|
|
matchDiv.className = 'butterfly-match'; |
|
|
|
|
|
|
|
|
|
|
|
matchDiv.style.position = 'absolute'; |
|
|
|
matchDiv.style.position = 'absolute'; |
|
|
|
const isDisabled = matchTemplate.dataset.disabled === 'true'; |
|
|
|
const isDisabled = matchTemplate.dataset.disabled === 'true'; |
|
|
|
let top; |
|
|
|
let top; |
|
|
|
let left; |
|
|
|
let left; |
|
|
|
let right; |
|
|
|
let right; |
|
|
|
let nextMatchDistance = baseDistance; |
|
|
|
const currentMatchesCount = roundMatches.length; |
|
|
|
|
|
|
|
|
|
|
|
// Check if this round has only one match |
|
|
|
|
|
|
|
const isSingleMatchRound = roundMatches.length === 1; |
|
|
|
|
|
|
|
if (isSingleMatchRound) { |
|
|
|
|
|
|
|
matchDiv.classList.add('single-match-round'); |
|
|
|
|
|
|
|
nextMatchDistance = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (roundIndex > finalRoundIndex) { |
|
|
|
if (roundIndex > finalRoundIndex) { |
|
|
|
matchDiv.classList.add('reverse-bracket'); |
|
|
|
matchDiv.classList.add('reverse-bracket'); |
|
|
|
top = matchPositions[roundCount - roundIndex - 1][matchIndex]; |
|
|
|
top = matchPositions[roundCount - roundIndex - 1][matchIndex]; |
|
|
|
nextMatchDistance = baseDistance * Math.pow(2, rounds.length - roundIndex - 1); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
nextMatchDistance = baseDistance * Math.pow(2, roundIndex); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (roundIndex === 0) { |
|
|
|
if (roundIndex === 0) { |
|
|
|
top = matchIndex * (matchHeight + matchSpacing); |
|
|
|
const nextMatchesCount = rounds[roundIndex + 1].length; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (currentMatchesCount == nextMatchesCount) { |
|
|
|
|
|
|
|
nextMatchDistance = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
top = matchIndex * (matchHeight + matchSpacing) * minimumMatchDistance; |
|
|
|
|
|
|
|
} else if (roundIndex === roundCount - 1) { |
|
|
|
|
|
|
|
const nextMatchesCount = rounds[roundIndex - 1].length; |
|
|
|
|
|
|
|
if (currentMatchesCount == nextMatchesCount) { |
|
|
|
|
|
|
|
nextMatchDistance = 0; |
|
|
|
|
|
|
|
} |
|
|
|
} else if (roundIndex == finalRoundIndex) { |
|
|
|
} else if (roundIndex == finalRoundIndex) { |
|
|
|
let lgth = matchPositions[0].length / 2; |
|
|
|
let lgth = matchPositions[0].length / 2; |
|
|
|
let index = lgth + matchIndex - 1; |
|
|
|
let index = lgth + matchIndex - 1; |
|
|
|
// If index goes negative, use 0 instead |
|
|
|
// If index goes negative, use 0 instead |
|
|
|
top = matchPositions[0][index < 0 ? 0 : index]; |
|
|
|
if (matchIndex == 0) { |
|
|
|
|
|
|
|
top = matchPositions[roundIndex - 1][0] - baseDistance / 2; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
top = matchPositions[roundIndex - 1][0] + baseDistance / 2; |
|
|
|
|
|
|
|
} |
|
|
|
nextMatchDistance = baseDistance; |
|
|
|
nextMatchDistance = baseDistance; |
|
|
|
} else if (roundIndex < finalRoundIndex) { |
|
|
|
} else if (roundIndex < finalRoundIndex) { |
|
|
|
|
|
|
|
const previousMatchesCount = rounds[roundIndex - 1].length; |
|
|
|
|
|
|
|
const nextMatchesCount = rounds[roundIndex + 1].length; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (currentMatchesCount == nextMatchesCount) { |
|
|
|
|
|
|
|
nextMatchDistance = 0; |
|
|
|
|
|
|
|
} else if (matchPositions.length > roundIndex - 1) { |
|
|
|
|
|
|
|
nextMatchDistance = (matchPositions[roundIndex - 1][1] - matchPositions[roundIndex - 1][0]); |
|
|
|
|
|
|
|
nextMatchDistance = nextMatchDistance * (previousMatchesCount / currentMatchesCount); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (currentMatchesCount == previousMatchesCount) { |
|
|
|
|
|
|
|
top = matchPositions[roundIndex - 1][matchIndex]; |
|
|
|
|
|
|
|
} else { |
|
|
|
const parentIndex1 = matchIndex * 2; |
|
|
|
const parentIndex1 = matchIndex * 2; |
|
|
|
const parentIndex2 = parentIndex1 + 1; |
|
|
|
const parentIndex2 = parentIndex1 + 1; |
|
|
|
const parentPos1 = matchPositions[roundIndex - 1][parentIndex1]; |
|
|
|
const parentPos1 = matchPositions[roundIndex - 1][parentIndex1]; |
|
|
|
const parentPos2 = matchPositions[roundIndex - 1][parentIndex2]; |
|
|
|
const parentPos2 = matchPositions[roundIndex - 1][parentIndex2]; |
|
|
|
top = (parentPos1 + parentPos2) / 2; |
|
|
|
top = (parentPos1 + parentPos2) / 2; |
|
|
|
nextMatchDistance = baseDistance * Math.pow(2, roundIndex); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else if (roundIndex < roundCount) { |
|
|
|
|
|
|
|
const nextMatchesCount = rounds[roundIndex - 1].length; |
|
|
|
|
|
|
|
const previousMatchesCount = rounds[roundIndex + 1].length; |
|
|
|
|
|
|
|
|
|
|
|
if (roundIndex >= finalRoundIndex - 1) { |
|
|
|
if (currentMatchesCount == nextMatchesCount) { |
|
|
|
if (roundCount > 5) { |
|
|
|
nextMatchDistance = 0; |
|
|
|
matchDiv.style.transform = `translateX(-50%)`; |
|
|
|
} else if (matchPositions.length > roundCount - roundIndex - 1 - 1) { |
|
|
|
if (roundIndex >= finalRoundIndex + 2) { |
|
|
|
nextMatchDistance = (matchPositions[roundCount - roundIndex - 1 - 1][1] - matchPositions[roundCount - roundIndex - 1 - 1][0]); |
|
|
|
matchDiv.style.transform = `translateX(-100%)`; |
|
|
|
nextMatchDistance = nextMatchDistance * (previousMatchesCount / currentMatchesCount); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (roundIndex >= finalRoundIndex - 1) { |
|
|
|
|
|
|
|
if (roundCount > 5) { |
|
|
|
if (roundIndex == finalRoundIndex - 1) { |
|
|
|
if (roundIndex == finalRoundIndex - 1) { |
|
|
|
matchDiv.classList.add('inward'); |
|
|
|
matchDiv.classList.add('inward'); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -121,7 +185,7 @@ function renderBracket() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (roundIndex === finalRoundIndex - 2 || roundIndex === finalRoundIndex + 2) { |
|
|
|
if (roundIndex === finalRoundIndex - 2 || roundIndex === finalRoundIndex + 2) { |
|
|
|
nextMatchDistance = (nextMatchDistance - baseDistance); |
|
|
|
nextMatchDistance = nextMatchDistance - baseDistance; |
|
|
|
} |
|
|
|
} |
|
|
|
else if (roundIndex == finalRoundIndex - 1 || roundIndex == finalRoundIndex + 1) { |
|
|
|
else if (roundIndex == finalRoundIndex - 1 || roundIndex == finalRoundIndex + 1) { |
|
|
|
nextMatchDistance = baseDistance; |
|
|
|
nextMatchDistance = baseDistance; |
|
|
|
@ -130,6 +194,32 @@ function renderBracket() { |
|
|
|
matchDiv.style.setProperty('--next-match-distance', `${nextMatchDistance}px`); |
|
|
|
matchDiv.style.setProperty('--next-match-distance', `${nextMatchDistance}px`); |
|
|
|
matchDiv.style.top = `${top}px`; |
|
|
|
matchDiv.style.top = `${top}px`; |
|
|
|
matchPositions[roundIndex][matchIndex] = top; |
|
|
|
matchPositions[roundIndex][matchIndex] = top; |
|
|
|
|
|
|
|
if (matchIndex === 0) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // Add logo for final round |
|
|
|
|
|
|
|
// if (roundIndex == finalRoundIndex) { |
|
|
|
|
|
|
|
// const logoDiv = document.createElement('div'); |
|
|
|
|
|
|
|
// logoDiv.className = 'round-logo'; |
|
|
|
|
|
|
|
// const logoImg = document.createElement('img'); |
|
|
|
|
|
|
|
// logoImg.src = '/static/tournaments/images/PadelClub_logo_512.png'; |
|
|
|
|
|
|
|
// logoImg.alt = 'PadelClub Logo'; |
|
|
|
|
|
|
|
// logoDiv.appendChild(logoImg); |
|
|
|
|
|
|
|
// logoDiv.style.transform = `translateX(-50%)`; |
|
|
|
|
|
|
|
// matchesContainer.appendChild(logoDiv); |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Position title above the first match |
|
|
|
|
|
|
|
titleDiv.style.top = `${top - 80}px`; // Adjust the 60px offset as needed |
|
|
|
|
|
|
|
titleDiv.style.position = 'absolute'; |
|
|
|
|
|
|
|
if (roundIndex == finalRoundIndex - 1) { |
|
|
|
|
|
|
|
titleDiv.style.marginLeft = '50px'; |
|
|
|
|
|
|
|
} else if (roundIndex == finalRoundIndex + 1) { |
|
|
|
|
|
|
|
titleDiv.style.marginLeft = '-50px'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
matchesContainer.appendChild(titleDiv); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
matchDiv.innerHTML = ` |
|
|
|
matchDiv.innerHTML = ` |
|
|
|
<div class="incoming-line ${isDisabled ? 'disabled' : ''}"></div> |
|
|
|
<div class="incoming-line ${isDisabled ? 'disabled' : ''}"></div> |
|
|
|
@ -139,19 +229,14 @@ function renderBracket() { |
|
|
|
if (roundIndex == finalRoundIndex - 1) { |
|
|
|
if (roundIndex == finalRoundIndex - 1) { |
|
|
|
const matchDiv2 = document.createElement('div'); |
|
|
|
const matchDiv2 = document.createElement('div'); |
|
|
|
matchDiv2.className = 'butterfly-match'; |
|
|
|
matchDiv2.className = 'butterfly-match'; |
|
|
|
matchDiv2.style.position = 'absolute'; |
|
|
|
|
|
|
|
if (roundCount > 5) { |
|
|
|
|
|
|
|
matchDiv2.style.transform = `translateX(-50%)`; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
matchDiv2.classList.add('inward'); |
|
|
|
matchDiv2.classList.add('inward'); |
|
|
|
matchDiv2.classList.add('semi-final'); |
|
|
|
matchDiv2.classList.add('semi-final'); |
|
|
|
matchDiv2.style.setProperty('--next-match-distance', `${baseDistance}px`); |
|
|
|
matchDiv2.style.setProperty('--next-match-distance', `${baseDistance}px`); |
|
|
|
matchDiv2.style.top = `${top}px`; |
|
|
|
matchDiv2.style.top = `${top}px`; |
|
|
|
matchDiv2.innerHTML = ` |
|
|
|
matchDiv2.innerHTML = `<div class="match-content">${rounds[0][0].innerHTML}</div>`; |
|
|
|
`; |
|
|
|
matchesContainer.appendChild(matchDiv2); // Append to matchesContainer instead of roundDiv |
|
|
|
roundDiv.appendChild(matchDiv2); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
roundDiv.appendChild(matchDiv); |
|
|
|
matchesContainer.appendChild(matchDiv); // Append to matchesContainer instead of roundDiv |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
bracket.appendChild(roundDiv); |
|
|
|
bracket.appendChild(roundDiv); |
|
|
|
@ -162,8 +247,21 @@ function renderBracket() { |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style> |
|
|
|
<style> |
|
|
|
|
|
|
|
.round-logo img { |
|
|
|
|
|
|
|
width: 50px; |
|
|
|
|
|
|
|
height: auto; |
|
|
|
|
|
|
|
display: block; |
|
|
|
|
|
|
|
margin: 0 auto; |
|
|
|
|
|
|
|
position: relative; |
|
|
|
|
|
|
|
top: -100px; /* Increased negative value to move it higher up */ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.round-logo img { |
|
|
|
|
|
|
|
width: 100px; /* Adjust size as needed */ |
|
|
|
|
|
|
|
height: auto; |
|
|
|
|
|
|
|
display: block; |
|
|
|
|
|
|
|
margin: 0 auto; |
|
|
|
|
|
|
|
} |
|
|
|
.butterfly-match.same-level::before { |
|
|
|
.butterfly-match.same-level::before { |
|
|
|
display: none; |
|
|
|
display: none; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -183,12 +281,44 @@ function renderBracket() { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
gap: 40px; /* Increased to account for horizontal lines (20px on each side) */ |
|
|
|
gap: 40px; /* Increased to account for horizontal lines (20px on each side) */ |
|
|
|
position: relative; |
|
|
|
position: relative; |
|
|
|
|
|
|
|
margin-bottom: 80px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.round-title { |
|
|
|
|
|
|
|
position: absolute; |
|
|
|
|
|
|
|
top: 0px; /* Adjust this value to position the title where you want it */ |
|
|
|
|
|
|
|
padding: 5px 10px; |
|
|
|
|
|
|
|
text-align: center; |
|
|
|
|
|
|
|
font-weight: bold; |
|
|
|
|
|
|
|
width: 100%; /* Change from 100% to auto */ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.round-name { |
|
|
|
|
|
|
|
font-size: 1.5em; /* Make the round name bigger */ |
|
|
|
|
|
|
|
margin-bottom: 5px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.round-format { |
|
|
|
|
|
|
|
font-size: 0.9em; |
|
|
|
|
|
|
|
color: #666; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.matches-container { |
|
|
|
|
|
|
|
position: relative; |
|
|
|
|
|
|
|
width: 100%; |
|
|
|
|
|
|
|
flex-grow: 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.butterfly-round { |
|
|
|
.butterfly-round { |
|
|
|
|
|
|
|
display: flex; |
|
|
|
|
|
|
|
flex-direction: column; |
|
|
|
|
|
|
|
align-items: center; |
|
|
|
|
|
|
|
gap: 20px; /* Space between title and matches */ |
|
|
|
position: relative; |
|
|
|
position: relative; |
|
|
|
width: var(--match-width); /* 300px for match + 20px on each side for lines */ |
|
|
|
width: var(--match-width); |
|
|
|
flex-shrink: 0; /* Prevents rounds from shrinking */ |
|
|
|
flex-shrink: 0; |
|
|
|
|
|
|
|
margin-top: 100px; /* Add padding to account for absolute positioned title */ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.butterfly-match { |
|
|
|
.butterfly-match { |
|
|
|
@ -211,14 +341,13 @@ function renderBracket() { |
|
|
|
content: ""; |
|
|
|
content: ""; |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
|
left: calc(100% + 20px); /* After horizontal line */ |
|
|
|
left: calc(100% + 20px); /* After horizontal line */ |
|
|
|
top: -4px; |
|
|
|
|
|
|
|
width: 2px; |
|
|
|
width: 2px; |
|
|
|
height: calc(var(--next-match-distance)); |
|
|
|
height: calc((var(--next-match-distance)) / 2); |
|
|
|
background: #666; |
|
|
|
background: #666; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* Vertical line connecting pair of matches */ |
|
|
|
/* Vertical line connecting pair of matches */ |
|
|
|
.butterfly-match:nth-child(2n+1)::before { |
|
|
|
.butterfly-match:nth-child(2n)::before { |
|
|
|
content: ""; |
|
|
|
content: ""; |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
|
left: calc(100% + 20px); /* After horizontal line */ |
|
|
|
left: calc(100% + 20px); /* After horizontal line */ |
|
|
|
@ -228,7 +357,7 @@ function renderBracket() { |
|
|
|
background: #666; |
|
|
|
background: #666; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.butterfly-match:nth-child(2n)::before { |
|
|
|
.butterfly-match:nth-child(2n+1)::before { |
|
|
|
content: ""; |
|
|
|
content: ""; |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
|
left: calc(100% + 20px); |
|
|
|
left: calc(100% + 20px); |
|
|
|
@ -239,17 +368,17 @@ function renderBracket() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* Vertical line connecting pair of matches */ |
|
|
|
/* Vertical line connecting pair of matches */ |
|
|
|
.butterfly-match.reverse-bracket:nth-child(2n+1)::before { |
|
|
|
.butterfly-match.reverse-bracket:nth-child(2n)::before { |
|
|
|
content: ""; |
|
|
|
content: ""; |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
|
left: calc(0% - 20px); /* After horizontal line */ |
|
|
|
left: calc(0% - 20px); /* After horizontal line */ |
|
|
|
top: calc(50% + 2px); |
|
|
|
top: 50%; |
|
|
|
width: 2px; |
|
|
|
width: 2px; |
|
|
|
height: calc((var(--next-match-distance)) / 2); |
|
|
|
height: calc((var(--next-match-distance)) / 2); |
|
|
|
background: #666; |
|
|
|
background: #666; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.butterfly-match.reverse-bracket:nth-child(2n)::before { |
|
|
|
.butterfly-match.reverse-bracket:nth-child(2n+1)::before { |
|
|
|
content: ""; |
|
|
|
content: ""; |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
|
left: calc(0% - 20px); |
|
|
|
left: calc(0% - 20px); |
|
|
|
|