fixed local storage error

This commit is contained in:
gocivici 2022-09-27 18:24:46 +03:00
parent 42d127e039
commit 04d1594ce8
3 changed files with 12 additions and 6 deletions

View File

@ -45,7 +45,7 @@
<div class="content">
<i class="fas fa-tint"></i>
<div class="InstructionText">
<p>If you guess wrong or submit while empty, a new
<p>If you guess wrong or skip, a new
scene from the movie is revealed. You have a maximum of 3 guesses to find the movie.</p>
</div>
</div>
@ -192,7 +192,7 @@
<div class="autocomplete">
<!-- <label for="guess">Movie:</label> -->
<input class="guess" type="text" id="autoComplete" placeholder="Movie">
<input type="button" id="submitGuess" value="Submit">
<input type="button" id="submitGuess" value="Skip">
</div>
</form>

12
main.js
View File

@ -50,7 +50,7 @@ function revealButtons(g = guessNo){
var movies = [["The Texas Chainsaw Massacre",1,"Sally Hardesty"],["It Follows",2,"Jaime Height"],["Friday the 13th",0,"Alice Hardy"],["Event Horizon",2,"Lieutenant Starck"],["Hellraiser",2,"Kirsty Cotton"],["A Nightmare on Elm Street",1,"Nancy Thompson"],["The Cabin in the Woods",2],["American Psycho",0]];
var pix = [];
// autocomplete(document.getElementById("guess"), movies);
var gameBeginning = new Date('September 24, 2022 00:00:00');
var gameBeginning = new Date('September 23, 2022 00:00:00');
var countDownTime = new Date();
var present_date = new Date();
@ -241,7 +241,11 @@ window.onload = deathOftheDay();
console.log(buttonNo);
addData();
}
if(!localStorage.getItem('result')){
textResult = "Horrordle #"+dayCount+"\n🔪";
}else{
textResult = localStorage.getItem('result');
}
function checkGuess() {
localStorage.setItem('playedBefore','true');
@ -330,7 +334,7 @@ console.log("day count:" + dayCount);
const autoCompleteJS = new autoComplete({
placeHolder: "Search for Movies...",
placeHolder: "Search for Horror Movies...",
// wrapper: false,
data: {
src: movies.map(movies => movies[0])
@ -368,7 +372,7 @@ autoCompleteJS.input.addEventListener("selection", function (event) {
autoCompleteJS.input.value = guess;
// Console log autoComplete data feedback
console.log(event.detail.selection.value);
// checkGuess();
checkGuess();
});
function copyToClipboard() {
@ -393,7 +397,7 @@ function getArchive(j,d = dayCount){
submitGuess.addEventListener('click', checkGuess)
submitGuess.addEventListener('click', checkGuess)
const labels = [
'First Guess',

View File

@ -435,6 +435,8 @@ input[type=button] {
} */
#submitGuess{
margin-left: 8px;
background-color: #121212;
border: 1px solid orangered;
}
#submitBonusGuess{
display: none;