30 lines
917 B
JavaScript
30 lines
917 B
JavaScript
document.addEventListener("DOMContentLoaded", function() {
|
|
// Function to show an element
|
|
function showElement(selector) {
|
|
const element = document.querySelector(selector);
|
|
if (element) {
|
|
element.style.display = 'block';
|
|
}
|
|
}
|
|
|
|
// Function to randomly select a customer
|
|
function showRandomCustomer() {
|
|
const customers = ['#customer1 img', '#customer2 img', '#customer3 img'];
|
|
const randomIndex = Math.floor(Math.random() * customers.length);
|
|
showElement(customers[randomIndex]);
|
|
}
|
|
|
|
// Show all dishes
|
|
showElement('#mapo-tofu img');
|
|
showElement('#roast-duck img');
|
|
showElement('#yangzhou-fried-rice img');
|
|
showElement('#braised-prawns img');
|
|
showElement('#kung-pao-chicken img');
|
|
|
|
// Show a random customer
|
|
showRandomCustomer();
|
|
|
|
// Show normal Qin Shi Huang
|
|
showElement('#qinshihuang img');
|
|
});
|