fixed local storage error
This commit is contained in:
parent
42d127e039
commit
04d1594ce8
@ -45,7 +45,7 @@
|
|||||||
<div class="content">
|
<div class="content">
|
||||||
<i class="fas fa-tint"></i>
|
<i class="fas fa-tint"></i>
|
||||||
<div class="InstructionText">
|
<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>
|
scene from the movie is revealed. You have a maximum of 3 guesses to find the movie.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -192,7 +192,7 @@
|
|||||||
<div class="autocomplete">
|
<div class="autocomplete">
|
||||||
<!-- <label for="guess">Movie:</label> -->
|
<!-- <label for="guess">Movie:</label> -->
|
||||||
<input class="guess" type="text" id="autoComplete" placeholder="Movie">
|
<input class="guess" type="text" id="autoComplete" placeholder="Movie">
|
||||||
<input type="button" id="submitGuess" value="Submit">
|
<input type="button" id="submitGuess" value="Skip">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
12
main.js
12
main.js
@ -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 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 = [];
|
var pix = [];
|
||||||
// autocomplete(document.getElementById("guess"), movies);
|
// 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 countDownTime = new Date();
|
||||||
var present_date = new Date();
|
var present_date = new Date();
|
||||||
|
|
||||||
@ -241,7 +241,11 @@ window.onload = deathOftheDay();
|
|||||||
console.log(buttonNo);
|
console.log(buttonNo);
|
||||||
addData();
|
addData();
|
||||||
}
|
}
|
||||||
|
if(!localStorage.getItem('result')){
|
||||||
textResult = "Horrordle #"+dayCount+"\n🔪";
|
textResult = "Horrordle #"+dayCount+"\n🔪";
|
||||||
|
}else{
|
||||||
|
textResult = localStorage.getItem('result');
|
||||||
|
}
|
||||||
function checkGuess() {
|
function checkGuess() {
|
||||||
localStorage.setItem('playedBefore','true');
|
localStorage.setItem('playedBefore','true');
|
||||||
|
|
||||||
@ -330,7 +334,7 @@ console.log("day count:" + dayCount);
|
|||||||
|
|
||||||
|
|
||||||
const autoCompleteJS = new autoComplete({
|
const autoCompleteJS = new autoComplete({
|
||||||
placeHolder: "Search for Movies...",
|
placeHolder: "Search for Horror Movies...",
|
||||||
// wrapper: false,
|
// wrapper: false,
|
||||||
data: {
|
data: {
|
||||||
src: movies.map(movies => movies[0])
|
src: movies.map(movies => movies[0])
|
||||||
@ -368,7 +372,7 @@ autoCompleteJS.input.addEventListener("selection", function (event) {
|
|||||||
autoCompleteJS.input.value = guess;
|
autoCompleteJS.input.value = guess;
|
||||||
// Console log autoComplete data feedback
|
// Console log autoComplete data feedback
|
||||||
console.log(event.detail.selection.value);
|
console.log(event.detail.selection.value);
|
||||||
// checkGuess();
|
checkGuess();
|
||||||
});
|
});
|
||||||
|
|
||||||
function copyToClipboard() {
|
function copyToClipboard() {
|
||||||
@ -393,7 +397,7 @@ function getArchive(j,d = dayCount){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
submitGuess.addEventListener('click', checkGuess)
|
submitGuess.addEventListener('click', checkGuess)
|
||||||
|
|
||||||
const labels = [
|
const labels = [
|
||||||
'First Guess',
|
'First Guess',
|
||||||
|
Loading…
Reference in New Issue
Block a user