fixed movie not found issue

This commit is contained in:
gocivici 2022-10-28 12:26:17 +03:00
parent 37e12674bf
commit a658bafb71
2 changed files with 16 additions and 4 deletions

View File

@ -141,6 +141,7 @@
<div class="calendar__number">29</div> <div class="calendar__number">29</div>
<div class="calendar__number">30</div> <div class="calendar__number">30</div>
<div class="calendar__number">31</div> <div class="calendar__number">31</div>
<div class="calendar__number">1</div>
</div> </div>
</div> </div>

19
main.js
View File

@ -1064,7 +1064,8 @@ var movies = [
// autocomplete(document.getElementById("guess"), movies); // autocomplete(document.getElementById("guess"), movies);
var gameBeginning = new Date('October 1, 2022 00:00:00'); var gameBeginning = new Date('October 1, 2022 00:00:00');
var countDownTime = new Date(); var countDownTime = new Date();
var present_date = new Date('October 31, 2022 00:00:00'); var present_date = new Date();
// var present_date = new Date('November 1, 2022 00:00:00');
// var present_date = new Date('September 26, 2022 00:00:00'); // var present_date = new Date('September 26, 2022 00:00:00');
// gameBeginning = new Date(gameBeginning.getTime() + 0 * 60 * 1000); // gameBeginning = new Date(gameBeginning.getTime() + 0 * 60 * 1000);
@ -1230,7 +1231,8 @@ window.onload = deathOftheDay();
function deathOftheDay(x=dayCount){ function deathOftheDay(x=dayCount){
pix = []; pix = [];
movieOfTheDay = movies[x]; movieOfTheDay = movies[x];
if (x<31){
document.getElementById("movieFrame").style.display = "block";
for (let i = 1; i < 4; i++) { for (let i = 1; i < 4; i++) {
pix.push("images/"+movieOfTheDay[0]+"/"+i+".png"); pix.push("images/"+movieOfTheDay[0]+"/"+i+".png");
preloadImage("images/"+movieOfTheDay[0]+"/"+i+".png"); preloadImage("images/"+movieOfTheDay[0]+"/"+i+".png");
@ -1240,6 +1242,13 @@ window.onload = deathOftheDay();
console.log('Movie: ', movieOfTheDay[0]); console.log('Movie: ', movieOfTheDay[0]);
console.log('Array: ', pix); console.log('Array: ', pix);
showPic(); showPic();
} else{
document.getElementById("movieFrame").style.display = "none";
document.getElementById("guessForm").style.display = "none";
document.getElementsByClassName("picButtons")[0].style.display="none";
document.getElementById("movieName").innerHTML = "Thanks for playing Horrordle!";
document.getElementById("feedback").innerHTML = "Thanks for playing Horrordle!";
}
// picButton = document.getElementsByClassName('picButton'); // picButton = document.getElementsByClassName('picButton');
// picButton.setAttribute('onclick','getImage()'); // picButton.setAttribute('onclick','getImage()');
@ -1461,11 +1470,13 @@ function getArchive(j,d = dayCount){
for (var i = 0; i < dates.length; i++) { for (var i = 0; i < dates.length; i++) {
dates[i].classList.remove('current'); dates[i].classList.remove('current');
} }
present_date.setDate(j); present_date.setMonth(9,j);
// present_date.setDate(j);
console.log(present_date);
getReady(); getReady();
var pix = []; var pix = [];
dayCounter(); dayCounter();
// markCalendar(); markCalendar();
var points = "⬛⬛⬛" var points = "⬛⬛⬛"
firstCheck(); firstCheck();
clearGuess(); clearGuess();