Skip to content

Commit

Permalink
update logic again
Browse files Browse the repository at this point in the history
  • Loading branch information
sugoides committed Feb 13, 2024
1 parent 20eefea commit 6f94f53
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions will-you-be-my-valentine/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ function preloadImages() {
// Preload images
const preloadedImages = [];
const img = new Image();
img.src = `img/cat-yes.jpg`;
preloadedImages.push(img);
for (let i = 1; i <= MAX_IMAGES; i++) {

img.src = `img/cat-${i}.jpg`;
preloadedImages.push(img);
}
img.src = `img/cat-yes.jpg`;
preloadedImages.push(img);

}

yesButton.addEventListener("click", handleYesClick);
Expand Down

0 comments on commit 6f94f53

Please sign in to comment.