Skip to content

Commit

Permalink
Anti Clicker, UI Improve
Browse files Browse the repository at this point in the history
  • Loading branch information
Minemetero committed Jun 5, 2024
1 parent 8a5acf8 commit a8d3640
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,31 @@ function incrementCurrentMatchScore(playerName) {
totalScores[playerName]++;
document.getElementById('result').innerText = `${playerName} Wins this round!`;
matchHistory.push(`${players[currentMatch[0]]} vs ${players[currentMatch[1]]}: ${playerName} won`);
disableScoreButtons();
setTimeout(() => {
document.getElementById('result').innerText = '';
updatePlayerScoreList();
updateMatchOrder();
updateMatchOrderList();
updateHistoryList();
enableScoreButtons();
startNewMatch();
}, 2000);
}
}

function disableScoreButtons() {
document.querySelectorAll('.score-button').forEach(button => {
button.disabled = true;
});
}

function enableScoreButtons() {
document.querySelectorAll('.score-button').forEach(button => {
button.disabled = false;
});
}

function updateCurrentMatch() {
const match = document.getElementById('currentMatch');
const player1 = players[currentMatch[0]];
Expand Down
2 changes: 1 addition & 1 deletion styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

body {
font-family: Arial, sans-serif;
background: linear-gradient(to right, #2980b9, #3498db);
background: linear-gradient(to bottom right, #039afe, #4293c9);
color: var(--primary-text-color);
display: flex;
flex-direction: column;
Expand Down

0 comments on commit a8d3640

Please sign in to comment.