feat: finish game

This commit is contained in:
2023-12-12 23:28:56 +08:00
parent e84eb8044d
commit 447915d277
6 changed files with 59 additions and 13 deletions

View File

@@ -35,6 +35,19 @@ function checkAnswer(dishName){
return answer == dishName
}
function handleHint(hint) {
console.log(hint + " 被点击了!");
if (hint == "bottom") {
hideElement("#hint img")
showElement("#hintpage img")
}
if (hint == "page") {
hideElement("#hintpage img")
showElement("#hint img")
}
}
function handleClick(dishName) {
console.log(dishName + " 被点击了!");
if (checkAnswer(dishName)){
@@ -150,6 +163,9 @@ document.addEventListener("DOMContentLoaded", function() {
// Show normal Qin Shi Huang
showElement('#qinshihuang img');
// Show hint bottom
showElement('#hint img')
// Show first question
var randomQuestion = questions[QAlist[currentIndex]];
document.getElementById("dialogueText").innerHTML = randomQuestion;