Skip to content

Commit

Permalink
moved message3
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Smith committed Oct 6, 2023
1 parent 40c99b2 commit 66d6627
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
7 changes: 3 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,10 @@ <h3>Guess the word</h3>
</div>

</div>
<div class="alert alert-info my-2" role="alert">
<h5 id="requestedList">Guessing a wrong letter will deduct from your possible end score.</h5>

<div class="alert alert-info my-2" role="alert" id="requestedList">
<h4>Guessing a wrong letter will deduct from your possible end score.</h4>
</div>
<div class="alert hide" id="winLoseStatus" role="alert">
<div class="alert hide my-2" id="winLoseStatus" role="alert">

</div>

Expand Down
17 changes: 11 additions & 6 deletions js/functionality.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,16 @@ function showNum() {
document.getElementById("solveWordBt").focus();
document.querySelector("[name='userGuess']").classList.add("hide");
document.getElementById("verifyBt").classList.add("hide");
document.getElementById("requestedList").innerHTML = "Click \"Solve\" to move on.";
document.getElementById("requestedList").innerHTML = "<h4>Click \"Solve\" to move on.</h4>";
}

function verify() {
let statusList = "";
const userGuess = document.querySelector("[name='userGuess']").value;
if (userGuess === "") {
globalAlert("alert-warning", "Type a letter into the field to see if it is in the word.");
return false;
}
for (let i = 0; i < wordPrep.length; i++) {
if (userGuess.toLowerCase() === wordPrep[i].toLowerCase()) {
letterSolved[i] = userGuess.toLowerCase();
Expand All @@ -104,9 +108,9 @@ function verify() {
document.querySelector("[name='userGuess']").value = "";

if (requestFailedHTML.length === 0) {
document.querySelector("#requestedList").innerHTML = "So far, so good.";
document.querySelector("#requestedList").innerHTML = "<h4>So far, so good.<h4>";
} else {
document.querySelector("#requestedList").innerHTML = "<span class='mobileBlock'>$" + (100 - (10 * failedRequests.length)) + " possible: </span>" + requestFailedHTML;
document.querySelector("#requestedList").innerHTML = "<h4><span class='mobileBlock'>$" + (100 - (10 * failedRequests.length)) + " possible </span><br/> Failed letter attempts: " + requestFailedHTML + "</h4>";
}


Expand All @@ -129,9 +133,9 @@ function solve() {
}

document.querySelector("#winLoseStatus[role='alert']").classList.remove("hide");
document.getElementById("requestedList").innerHTML = ""
if (document.querySelector("input[name='solveWord']").value.toLowerCase().replaceAll(" ", "-") === wordPrep.toLowerCase().replaceAll(" ", "-")) {

if (document.querySelector("input[name='solveWord']").value.toLowerCase().replaceAll(" ", "-") === wordPrep.toLowerCase().replaceAll(" ", "-")) {
document.getElementById("requestedList").classList.add("hide");
document.querySelector("#winLoseStatus[role='alert']").classList.add("alert-success");
if (cheated === false) {
document.querySelector("#winLoseStatus[role='alert']").innerHTML = "<h3><span class='capitalize'>" + wordPrep + "</span>! YOU DID IT! +$" + percentage + "</h3>";
Expand All @@ -155,10 +159,11 @@ function solve() {
letterSolved = [];
document.querySelector("#listTarget").innerHTML = gameHTML;
document.querySelector("#winLoseStatus[role='alert']").classList.add("hide");
document.getElementById("requestedList").classList.remove("hide");
document.querySelector("#winLoseStatus[role='alert']").classList.remove("alert-success");
document.querySelector("#winLoseStatus[role='alert']").classList.remove("alert-danger");
failedRequests = [];
document.getElementById("requestedList").innerHTML = "Guessing a wrong letter will deduct from your possible end score.";
document.getElementById("requestedList").innerHTML = "<h4>Guessing a wrong letter will deduct from your possible end score.</h4>";
requestFailedHTML = "";
cheated = false;
startGame();
Expand Down

0 comments on commit 66d6627

Please sign in to comment.