Spaces:
Sleeping
Sleeping
Update templates/menu_page.html
Browse files- templates/menu_page.html +28 -12
templates/menu_page.html
CHANGED
@@ -12,30 +12,44 @@
|
|
12 |
.menu-item img { width: 100px; height: 100px; border-radius: 8px; margin-right: 10px; }
|
13 |
.details { display: flex; align-items: center; }
|
14 |
.text { margin-left: 10px; }
|
|
|
15 |
</style>
|
16 |
</head>
|
17 |
<body>
|
18 |
<div class="menu-container">
|
19 |
<h1>Welcome to the Menu</h1>
|
|
|
|
|
|
|
|
|
20 |
<div id="menu-items"></div>
|
21 |
</div>
|
22 |
|
23 |
<script>
|
24 |
const menuItems = [
|
25 |
-
{ name: 'Samosa', price: 9, ingredients: 'Potatoes, Peas, Flour, Spices', description: 'Crispy fried pastry filled with spiced potatoes and peas.' },
|
26 |
-
{ name: 'Onion Pakoda', price: 10, ingredients: 'Onions, Gram Flour, Spices', description: 'Deep-fried onion fritters seasoned with herbs and spices.' },
|
27 |
-
{ name: 'Chilli Gobi', price: 12, ingredients: 'Cauliflower, Chili Sauce, Spices', description: 'Cauliflower florets tossed in a spicy chili sauce.' },
|
28 |
-
{ name: 'Chicken Biryani', price: 14, ingredients: 'Chicken, Basmati Rice, Spices', description: 'Aromatic basmati rice cooked with tender chicken and spices.' },
|
29 |
-
{ name: 'Mutton Biryani', price: 16, ingredients: 'Mutton, Basmati Rice, Spices', description: 'Flavorful rice dish made with succulent mutton and aromatic spices.' }
|
|
|
|
|
|
|
30 |
];
|
31 |
|
32 |
const menuContainer = document.getElementById('menu-items');
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
const recognition = new (window.SpeechRecognition || window.webkitSpeechRecognition)();
|
41 |
recognition.lang = 'en-US';
|
@@ -68,7 +82,9 @@
|
|
68 |
|
69 |
recognition.onerror = () => { speak('Sorry, I could not understand. Please try again.'); };
|
70 |
|
71 |
-
window.onload =
|
|
|
|
|
72 |
</script>
|
73 |
</body>
|
74 |
</html>
|
|
|
12 |
.menu-item img { width: 100px; height: 100px; border-radius: 8px; margin-right: 10px; }
|
13 |
.details { display: flex; align-items: center; }
|
14 |
.text { margin-left: 10px; }
|
15 |
+
.menu-option { margin: 20px; font-size: 1.5rem; }
|
16 |
</style>
|
17 |
</head>
|
18 |
<body>
|
19 |
<div class="menu-container">
|
20 |
<h1>Welcome to the Menu</h1>
|
21 |
+
<div class="menu-option">
|
22 |
+
<button onclick="showMenu('veg')">Veg Items</button>
|
23 |
+
<button onclick="showMenu('non-veg')">Non-Veg Items</button>
|
24 |
+
</div>
|
25 |
<div id="menu-items"></div>
|
26 |
</div>
|
27 |
|
28 |
<script>
|
29 |
const menuItems = [
|
30 |
+
{ name: 'Samosa', price: 9, ingredients: 'Potatoes, Peas, Flour, Spices', description: 'Crispy fried pastry filled with spiced potatoes and peas.', imageUrl: 'https://via.placeholder.com/100', category: 'veg' },
|
31 |
+
{ name: 'Onion Pakoda', price: 10, ingredients: 'Onions, Gram Flour, Spices', description: 'Deep-fried onion fritters seasoned with herbs and spices.', imageUrl: 'https://via.placeholder.com/100', category: 'veg' },
|
32 |
+
{ name: 'Chilli Gobi', price: 12, ingredients: 'Cauliflower, Chili Sauce, Spices', description: 'Cauliflower florets tossed in a spicy chili sauce.', imageUrl: 'https://via.placeholder.com/100', category: 'veg' },
|
33 |
+
{ name: 'Chicken Biryani', price: 14, ingredients: 'Chicken, Basmati Rice, Spices', description: 'Aromatic basmati rice cooked with tender chicken and spices.', imageUrl: 'https://via.placeholder.com/100', category: 'non-veg' },
|
34 |
+
{ name: 'Mutton Biryani', price: 16, ingredients: 'Mutton, Basmati Rice, Spices', description: 'Flavorful rice dish made with succulent mutton and aromatic spices.', imageUrl: 'https://via.placeholder.com/100', category: 'non-veg' },
|
35 |
+
{ name: 'Fish Curry', price: 18, ingredients: 'Fish, Spices, Coconut Milk', description: 'Delicious fish curry made with fresh fish and coconut milk.', imageUrl: 'https://via.placeholder.com/100', category: 'non-veg' },
|
36 |
+
{ name: 'Paneer Butter Masala', price: 13, ingredients: 'Paneer, Tomato, Butter, Spices', description: 'Soft paneer cubes in a creamy, flavorful gravy.', imageUrl: 'https://via.placeholder.com/100', category: 'veg' },
|
37 |
+
{ name: 'Aloo Gobi', price: 10, ingredients: 'Potatoes, Cauliflower, Spices', description: 'A traditional Indian curry with potatoes and cauliflower.', imageUrl: 'https://via.placeholder.com/100', category: 'veg' },
|
38 |
];
|
39 |
|
40 |
const menuContainer = document.getElementById('menu-items');
|
41 |
+
|
42 |
+
function showMenu(type) {
|
43 |
+
menuContainer.innerHTML = ''; // Clear previous menu items
|
44 |
+
const filteredItems = menuItems.filter(item => item.category === type);
|
45 |
+
|
46 |
+
filteredItems.forEach(item => {
|
47 |
+
const div = document.createElement('div');
|
48 |
+
div.classList.add('menu-item');
|
49 |
+
div.innerHTML = `<div class="details"><img src="${item.imageUrl}" alt="${item.name}"><div class="text"><h3>${item.name}</h3><p>${item.description}</p><p><strong>Ingredients:</strong> ${item.ingredients}</p><p><strong>Price:</strong> $${item.price}</p></div></div>`;
|
50 |
+
menuContainer.appendChild(div);
|
51 |
+
});
|
52 |
+
}
|
53 |
|
54 |
const recognition = new (window.SpeechRecognition || window.webkitSpeechRecognition)();
|
55 |
recognition.lang = 'en-US';
|
|
|
82 |
|
83 |
recognition.onerror = () => { speak('Sorry, I could not understand. Please try again.'); };
|
84 |
|
85 |
+
window.onload = () => {
|
86 |
+
speak("Welcome to Biryani Hub! Would you like to see the Veg or Non-Veg menu?", () => {});
|
87 |
+
};
|
88 |
</script>
|
89 |
</body>
|
90 |
</html>
|