From 74193acc7d35de06214f62785f62e5c7a0b8c593 Mon Sep 17 00:00:00 2001 From: gocivici Date: Sun, 11 Sep 2022 12:00:27 +0300 Subject: [PATCH] result share page --- main.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index 3969d63..168298a 100644 --- a/main.js +++ b/main.js @@ -14,6 +14,7 @@ for (var i = 0; i < localStorage.length; i++){ var pix = []; autocomplete(document.getElementById("guess"), movies); var gameBeginning = new Date('September 8, 2022 00:00:00'); + // gameBeginning = new Date(gameBeginning.getTime() + 0 * 60 * 1000); console.log(gameBeginning.getTimezoneOffset()); var present_date = new Date(); @@ -88,6 +89,8 @@ function clearGuess() { localStorage.removeItem('result'); document.getElementById("firstGuess").style.display = "none"; document.getElementById("secondGuess").style.display = "none"; + document.getElementById("shareResult").style.display = "none"; + document.getElementById("guessForm").style.display = "block"; textResult = "Horrordle #"+dayCount+"\nšŸ”Ŗ"; } function checkingGuess() { @@ -107,7 +110,7 @@ streakNumber.textContent = localStorage.getItem('streak'); if(localStorage.getItem('result')) {localStorage.setItem('result', textResult);} if(localStorage.getItem('firstGuess')){firstGuess.textContent = "āŒ" + localStorage.getItem('firstGuess');document.getElementById("firstGuess").style.display = "block";} if(localStorage.getItem('secondGuess')){secondGuess.textContent = "āŒ" + localStorage.getItem('secondGuess');document.getElementById("secondGuess").style.display = "block";} - if(localStorage.getItem('winningGuess')){feedback.textContent = "You got it right!";document.getElementById("shareResult").style.display = "block";document.getElementById("guessForm").style.display = "none";}else {document.getElementById("shareResult").style.display = "none";document.getElementById("guessForm").style.display = "block";}; + if(localStorage.getItem('winningGuess')){feedback.textContent = "You got it right!";document.getElementById("shareResult").style.display = "block";document.getElementById("guessForm").style.display = "none";document.getElementById("firstGuess").style.display = "none";document.getElementById("secondGuess").style.display = "none";}else {document.getElementById("shareResult").style.display = "none";document.getElementById("guessForm").style.display = "block";}; secondGuess.textContent = "āŒ" + localStorage.getItem('secondGuess'); }else { clearGuess(); @@ -149,8 +152,8 @@ console.log("day count:" + dayCount); feedback.textContent = "You got it right!"; document.getElementById("shareResult").style.display = "block"; localStorage.setItem("winningGuess", guess.value); - document.getElementById("firstGuess").style.display = "none"; - document.getElementById("secondGuess").style.display = "none"; + document.getElementById("firstGuess").style.display = "none"; + document.getElementById("secondGuess").style.display = "none"; textResult = textResult + "šŸŸ©"; for (var i = 1; i < (3-guessNo); i++) { @@ -315,6 +318,7 @@ function getArchive(j){ deathOftheDay(); clearGuess(); checkingGuess(); + // checkGuess(); firstCheck(); document.getElementById('guess').value = ""; location.href='#';