voicemenu1433 / templates /menu_page.html
lokesh341's picture
Update templates/menu_page.html
4e75788 verified
raw
history blame
3.27 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Biryani Hub Menu</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f8f8f8;
text-align: center;
margin: 0;
padding: 20px;
}
h1 {
color: #ff5722;
margin-bottom: 30px;
}
.menu-container {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin-top: 20px;
}
.menu-item {
background: white;
padding: 15px;
margin: 10px;
border-radius: 8px;
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
width: 300px;
text-align: left;
}
.menu-item h3 {
margin: 0;
color: #333;
}
.menu-item p {
margin: 5px 0;
color: #555;
}
.menu-item button {
background-color: #ff5722;
color: white;
border: none;
padding: 8px;
cursor: pointer;
width: 100%;
border-radius: 5px;
}
.menu-item button:hover {
background-color: #e64a19;
}
.cart-container {
position: fixed;
bottom: 20px;
right: 20px;
z-index: 999;
}
.cart-button {
background-color: #007bff;
color: white;
padding: 10px 20px;
border-radius: 50px;
font-size: 1rem;
font-weight: bold;
text-decoration: none;
display: flex;
align-items: center;
justify-content: center;
}
.cart-button:hover {
background-color: #0056b3;
text-decoration: none;
}
</style>
</head>
<body>
<h1>Restaurant Menu</h1>
<!-- Menu Display -->
<div class="menu-container">
{% for item in menu %}
<div class="menu-item">
<h3>{{ item.name }}</h3>
<img src="{{ url_for('static', filename='images/' + item.image_url) }}" alt="{{ item.name }}" style="width: 100px; height: 100px; border-radius: 8px;">
<p><strong>Category:</strong> {{ item.category }}</p>
<p><strong>Price:</strong> ${{ item.price }}</p>
<p><strong>Ingredients:</strong> {{ item.ingredients }}</p>
<button onclick="addToCart('{{ item.name }}', {{ item.price }})">Add to Cart</button>
</div>
{% endfor %}
</div>
<!-- Cart Button -->
<div class="cart-container">
<a href="/cart" class="cart-button">View Cart</a>
</div>
<script>
let cart = [];
// Add items to cart
function addToCart(name, price) {
cart.push({ name, price });
alert(name + " added to cart!");
}
// View cart function (you can further expand it based on cart items)
function viewCart() {
console.log(cart); // Display cart items in the browser console for now
}
</script>
</body>
</html>