Skip to content

Commit

Permalink
Redirecting to the Game Screen Fixed (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
antilneeraj authored Jan 29, 2024
1 parent 1fa8fd5 commit d56f932
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions assets/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ const previewPhoto = () => {
};
fileInput.addEventListener("change", previewPhoto);

// Upload Play----

document.querySelector("#upload-btn").addEventListener("click", () => {
const img = document.querySelector(".file-preview");
const src = img.getAttribute("src");
Expand All @@ -342,6 +344,20 @@ document.querySelector("#upload-btn").addEventListener("click", () => {
choose_edible.play();
});

document.querySelectorAll(".choose-btn").forEach(button => {
button.addEventListener("click", () => {
const img = button.querySelector("img");
const src = img.getAttribute("src");
const alt = img.getAttribute("alt");
selected_edible = { src, alt };
screens[1].classList.add("up1");
game_container.style.height = "100vh";
startGame();
displayChange();
choose_edible.play();
});
});

// --------------- Uploading Image End ----------------

function chooseGameplayTime() {
Expand Down

0 comments on commit d56f932

Please sign in to comment.