feat: add dialogue box

This commit is contained in:
2023-12-09 22:42:01 +08:00
parent 83e93a77e8
commit cf2705c501
3 changed files with 17 additions and 2 deletions

View File

@@ -1,11 +1,12 @@
document.addEventListener("DOMContentLoaded", function() {
// Function to show an element
// Function to show an element
function showElement(selector) {
const element = document.querySelector(selector);
if (element) {
element.style.display = 'block';
}
}
document.addEventListener("DOMContentLoaded", function() {
// Function to randomly select a customer
function showRandomCustomer() {
@@ -14,6 +15,9 @@ document.addEventListener("DOMContentLoaded", function() {
showElement(customers[randomIndex]);
}
// Show dialogue box
showElement("#dialogueBox img");
// Show all dishes
showElement('#mapo-tofu img');
showElement('#roast-duck img');