feat: add dialogue box
This commit is contained in:
parent
83e93a77e8
commit
cf2705c501
@ -51,6 +51,14 @@
|
|||||||
left: 1050px;
|
left: 1050px;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
#dialogueBox img{
|
||||||
|
position: absolute;
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
top: 50px;
|
||||||
|
left: 600px;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
#customer1 img{ /* 中年男 */
|
#customer1 img{ /* 中年男 */
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- customers elements -->
|
<!-- customers elements -->
|
||||||
|
<div id="dialogueBox" class="dialogueBox">
|
||||||
|
<img src="asset/pic/qinshihuang/DialogueBox.png" alt="对话框">
|
||||||
|
</div>
|
||||||
<div id="customer1" class="customer">
|
<div id="customer1" class="customer">
|
||||||
<img src="asset/pic/qinshihuang/Customer1_YoungMan.png" alt="中年男">
|
<img src="asset/pic/qinshihuang/Customer1_YoungMan.png" alt="中年男">
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
document.addEventListener("DOMContentLoaded", function() {
|
|
||||||
// Function to show an element
|
// Function to show an element
|
||||||
function showElement(selector) {
|
function showElement(selector) {
|
||||||
const element = document.querySelector(selector);
|
const element = document.querySelector(selector);
|
||||||
@ -6,6 +5,8 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||||||
element.style.display = 'block';
|
element.style.display = 'block';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
|
||||||
|
|
||||||
// Function to randomly select a customer
|
// Function to randomly select a customer
|
||||||
function showRandomCustomer() {
|
function showRandomCustomer() {
|
||||||
@ -14,6 +15,9 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||||||
showElement(customers[randomIndex]);
|
showElement(customers[randomIndex]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show dialogue box
|
||||||
|
showElement("#dialogueBox img");
|
||||||
|
|
||||||
// Show all dishes
|
// Show all dishes
|
||||||
showElement('#mapo-tofu img');
|
showElement('#mapo-tofu img');
|
||||||
showElement('#roast-duck img');
|
showElement('#roast-duck img');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user