@@ -159,11 +159,6 @@ function updateStartButton() {
159159 randomizeBtn . disabled = count < 2 ;
160160 startBtn . disabled = count < 2 ;
161161 // Update Buttons
162- // if (count >= 2) {
163- // startBtn.textContent = `Tournament starten (${count} Teilnehmer)`;
164- // } else {
165- // startBtn.textContent = `Mindestens 2 Bilder benötigt bzw. falsche Teilnehmerzahl \n (${i} Teilnehmer.)`;
166- // }
167162 for ( var i = 1 ; i <= count ; i ++ ) {
168163 if ( count >= 2 && count == 2 ** i ) {
169164 startBtn . textContent = `Tournament starten (${ count } Teilnehmer)` ;
@@ -417,153 +412,6 @@ function drawConnectors() {
417412 }
418413}
419414
420- //function renderBracket() {
421- // bracket.innerHTML = '';
422- //
423- // const numRounds = bracketData.length;
424- //
425- // for (let round = 0; round < numRounds; round++) {
426- // const column = document.createElement('div');
427- // column.className = round === numRounds - 1 ? 'bracket-column winner-column' : 'bracket-column';
428- // column.dataset.round = round;
429- //
430- // const header = document.createElement('div');
431- // header.className = 'round-header';
432- // header.textContent = getRoundName(round, numRounds);
433- // column.appendChild(header);
434- //
435- // const roundMatches = bracketData[round];
436- // const matchPairsCount = Math.ceil(roundMatches.length / 2);
437- //
438- // for (let i = 0; i < matchPairsCount; i++) {
439- // const matchPair = document.createElement('div');
440- // matchPair.className = 'match-pair';
441- // matchPair.dataset.index = i;
442- //
443- // const idx1 = i * 2;
444- // const idx2 = i * 2 + 1;
445- //
446- // if (roundMatches[idx1]) {
447- // matchPair.appendChild(createBracketItem(roundMatches[idx1], round, idx1));
448- // }
449- //
450- // if (roundMatches[idx2]) {
451- // matchPair.appendChild(createBracketItem(roundMatches[idx2], round, idx2));
452- // }
453- //
454- // column.appendChild(matchPair);
455- //
456- // // Füge Verbindungen zur nächsten Runde hinzu, wenn nicht die letzte Runde
457- // if (round < numRounds - 1) {
458- // const nextRoundMatches = bracketData[round + 1];
459- // const nextRoundIndex = Math.floor(i / 2);
460- //
461- // if (nextRoundMatches[nextRoundIndex]) {
462- // const connector = document.createElement('div');
463- // connector.className = `match-connector round-${round}-to-${round + 1}`;
464- // matchPair.appendChild(connector);
465- // }
466- // }
467- // }
468- //
469- // bracket.appendChild(column);
470- // }
471- //
472- // // Füge Verbindungen zwischen den Runden hinzu
473- // for (let round = 0; round < numRounds - 1; round++) {
474- // const currentColumn = document.querySelector(`.bracket-column[data-round="${round}"]`);
475- // const nextColumn = document.querySelector(`.bracket-column[data-round="${round + 1}"]`);
476- //
477- // if (currentColumn && nextColumn) {
478- // const currentMatches = currentColumn.querySelectorAll('.match-pair');
479- // const nextMatches = nextColumn.querySelectorAll('.match-pair');
480- //
481- //
482- // const roundConnectorDiv = document.createElement('div');
483- // roundConnectorDiv.className = `round-connector-div`;
484- // currentMatches.forEach((match, index) => {
485- // const nextMatchIndex = Math.floor(index / 2);
486- // if (nextMatches[nextMatchIndex]) {
487- // // Horizontale Linie (obere Hälfte)
488- // const horizontalLine = document.createElement('div');
489- // horizontalLine.className = `round-connector round-${round}-to-${round + 1}`;
490- // currentColumn.appendChild(horizontalLine);
491- //
492- // // Positioniere die horizontale Linie
493- // horizontalLine.style.top = `${match.offsetTop + match.offsetHeight / 2}px`;
494- // horizontalLine.style.height = '2px';
495- // horizontalLine.style.left = `${(currentColumn.offsetLeft + currentColumn.offsetWidth)*0.737}px`;
496- // horizontalLine.style.width = `${(nextColumn.offsetLeft - (currentColumn.offsetLeft + currentColumn.offsetWidth))/2}px`;
497- //
498- // //if (index < 1) {
499- // // Vertikale Linie (linke Hälfte)
500- // const verticalLineLeft = document.createElement('div');
501- // verticalLineLeft.className = `round-connector round-${round}-to-${round + 1}`;
502- // currentColumn.appendChild(verticalLineLeft);
503- //
504- // // Positioniere die vertikale Linie links
505- // verticalLineLeft.style.top = `${match.offsetTop + match.offsetHeight / 2}px`;
506- // verticalLineLeft.style.height = `${((nextColumn.offsetTop + nextMatches[nextMatchIndex].offsetTop + nextMatches[nextMatchIndex].offsetHeight) - (match.offsetTop + match.offsetHeight / 2))*1}px`;
507- // verticalLineLeft.style.left = `${currentColumn.offsetLeft + currentColumn.offsetWidth}px`;
508- // verticalLineLeft.style.width = '2px';
509- // // }
510- //
511- // // Vertikale Linie (rechte Hälfte)
512- // const verticalLineRight = document.createElement('div');
513- // verticalLineRight.className = `round-connector round-${round}-to-${round + 1}`;
514- // currentColumn.appendChild(verticalLineRight);
515- //
516- // // Positioniere die vertikale Linie rechts
517- // verticalLineRight.style.top = `${nextColumn.offsetTop + nextMatches[nextMatchIndex].offsetTop + nextMatches[nextMatchIndex].offsetHeight / 2}px`;
518- // verticalLineRight.style.height = '2px';
519- // verticalLineRight.style.left = `${((currentColumn.offsetLeft + currentColumn.offsetWidth)*0.737)*1.75}px`;
520- // verticalLineRight.style.width = `${(nextColumn.offsetLeft - (currentColumn.offsetLeft + currentColumn.offsetWidth))/1.85}px`;
521- // }
522- // });
523- // }
524- // }
525- //}
526-
527-
528- //function renderBracket() {
529- // bracket.innerHTML = '';
530- //
531- // const numRounds = bracketData.length;
532- //
533- // for (let round = 0; round < numRounds; round++) {
534- // const column = document.createElement('div');
535- // column.className = round === numRounds - 1 ? 'bracket-column winner-column' : 'bracket-column';
536- //
537- // const header = document.createElement('div');
538- // header.className = 'round-header';
539- // header.textContent = getRoundName(round, numRounds);
540- // column.appendChild(header);
541- //
542- // const roundMatches = bracketData[round];
543- // const matchPairsCount = Math.ceil(roundMatches.length / 2);
544- //
545- // for (let i = 0; i < matchPairsCount; i++) {
546- // const matchPair = document.createElement('div');
547- // matchPair.className = 'match-pair';
548- //
549- // const idx1 = i * 2;
550- // const idx2 = i * 2 + 1;
551- //
552- // if (roundMatches[idx1]) {
553- // matchPair.appendChild(createBracketItem(roundMatches[idx1], round, idx1));
554- // }
555- //
556- // if (roundMatches[idx2]) {
557- // matchPair.appendChild(createBracketItem(roundMatches[idx2], round, idx2));
558- // }
559- //
560- // column.appendChild(matchPair);
561- // }
562- //
563- // bracket.appendChild(column);
564- // }
565- //}
566-
567415function createBracketItem ( data , round , index ) {
568416 const item = document . createElement ( 'div' ) ;
569417 item . className = 'bracket-item' ;
@@ -671,7 +519,7 @@ function showMatchOverlay() {
671519
672520 const roundName = getRoundName ( round , bracketData . length ) ;
673521 matchRoundTitle . textContent = roundName ;
674- matchInfo . textContent = 'Klicke auf den Gewinner (Du Streamer )' ;
522+ matchInfo . textContent = 'Klicke auf den Gewinner (Senpai hat entschieden! )' ;
675523
676524 matchContent . innerHTML = `
677525 <div class="match-competitor" onclick="selectWinnerFromOverlay(${ round } , ${ index1 } )">
0 commit comments