Skip to content

Commit

Permalink
Cleaning up more dumb mistakes
Browse files Browse the repository at this point in the history
Swapping out pause circles for stop symbols.
  • Loading branch information
sabrina-aip committed Jan 23, 2024
1 parent af735d5 commit 764b363
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
10 changes: 4 additions & 6 deletions assets/scripts/practice.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ function updateWord(){
resetPlayer(playerLst);
activeWord = wordLst[wordCounter];
wordOnePlayer.src = `${path}/${wordLst[wordCounter]}.mp3`
console.log(`Word Counter: ${wordCounter}.\nActive Word: ${activeWord}`)

publicCount.textContent = `Words Spelled: ${wordCounter}`
}

Expand Down Expand Up @@ -172,7 +170,7 @@ function checkGuess() {
function updatePlayer(playerLst, activePlayer) {
if (activePlayer[0].classList.contains("clicked")) {
stopSound(activePlayer[1]);
activePlayer[0].classList.remove("clicked","fa-pause-circle");
activePlayer[0].classList.remove("clicked","fa-circle-stop");
activePlayer[0].classList.add("fa-play-circle");

lastActiveWord = activeWord;
Expand All @@ -185,10 +183,10 @@ function updatePlayer(playerLst, activePlayer) {

playerLst.forEach((player) => {
if ((!player[0].classList.contains("submitted")) & player[0] != activePlayer[0]) {
player[0].classList.remove("clicked", "fa-pause-circle");
player[0].classList.remove("clicked", "fa-circle-stop");
stopSound(player[1]);
} else if ((!player[0].classList.contains("submitted")) & player[0] == activePlayer[0]) {
activePlayer[0].classList.add("clicked","fa-pause-circle");
activePlayer[0].classList.add("clicked","fa-circle-stop");
activePlayer[1].play();
}
})
Expand All @@ -198,7 +196,7 @@ function updatePlayer(playerLst, activePlayer) {
function resetPlayer(playerLst) {
playerLst.forEach((player) => {
player[0].style.backgroundColor = null;
player[0].classList.remove("clicked", "fa-xmark","fa-check", "submitted")
player[0].classList.remove("clicked", "fa-xmark","fa-check", "fa-circle-stop", "submitted")
player[0].classList.add("fa-play-circle")
})
}
Expand Down
9 changes: 4 additions & 5 deletions assets/scripts/youtube.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function checkGuess() {
function updatePlayer(playerLst, activePlayer) {
if (activePlayer[0].classList.contains("clicked")) {
stopSound(activePlayer[1]);
activePlayer[0].classList.remove("clicked","fa-pause-circle");
activePlayer[0].classList.remove("clicked","fa-circle-stop");
activePlayer[0].classList.add("fa-play-circle");

lastActiveWord = activeWord;
Expand All @@ -180,10 +180,10 @@ function updatePlayer(playerLst, activePlayer) {

playerLst.forEach((player) => {
if ((!player[0].classList.contains("submitted")) & player[0] != activePlayer[0]) {
player[0].classList.remove("clicked", "fa-pause-circle");
player[0].classList.remove("clicked", "fa-circle-stop");
stopSound(player[1]);
} else if ((!player[0].classList.contains("submitted")) & player[0] == activePlayer[0]) {
activePlayer[0].classList.add("clicked","fa-pause-circle");
activePlayer[0].classList.add("clicked","fa-circle-stop");
activePlayer[1].play();
}
})
Expand All @@ -193,11 +193,10 @@ function updatePlayer(playerLst, activePlayer) {
function resetPlayer(playerLst) {
playerLst.forEach((player) => {
player[0].style.backgroundColor = null;
player[0].classList.remove("clicked", "fa-xmark","fa-check", "submitted")
player[0].classList.remove("clicked", "fa-xmark","fa-check", "fa-circle-stop", "submitted")
player[0].classList.add("fa-play-circle")
})
}

// PROMPT MANAGEMENT

wordOne.addEventListener("click", (e) => {
Expand Down

0 comments on commit 764b363

Please sign in to comment.