-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
285 lines (250 loc) · 11.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="styles.css">
<style>
body {
font-family: Arial, sans-serif;
background: #e7e5e5;
}
.video-container{
width: 80%;
display: flex;
margin:1rem auto;
}
#circularVideo {
border-radius: 10px; /* This makes the video circular */
border:2px solid rgb(182, 179, 179);
overflow: hidden; /* This ensures that the video does not spill outside the circular shape */
width: 100%; /* Adjust as needed */
height: 300px; /* Adjust as needed */
margin:0 auto;
justify-content: center;
object-fit: cover; /* This controls how the video should be resized to fit its container */
margin-top: 1rem;
}
.navbar {
background-color: #2c3e50;
}
.navbar-brand {
color: #f1c40f !important;
font-weight: bolder;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-style: italic;
}
.nav-link {
color: black;
background-color: #c7c5c5;
}
.nav-link:hover {
color: white;
background-color: #f1c40f !important;;
}
.menu-item {
margin: 20px;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(0,0,0,0.1);
transition: all 0.3s ease-in-out;
background-color: rgb(218, 213, 213);
}
.menu-item:hover {
box-shadow: 0px 0px 20px rgba(0,0,0,0.2);
transform: scale(1.02);
}
.card {
border: none;
}
.card-img-top {
height: 200px;
object-fit: cover;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.card-title {
color: #16a085;
}
.card-subtitle {
color: #8e44ad;
}
.card-text {
color: #c0392b;
}
.card-body {
background-color: #ecf0f1;
}
.navbar-toggler{
color: white;
background-color: white;
}
.modal {
display: none;
position: fixed;
z-index: 1;
padding-top: 100px;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0,0.4);
}
#menu {
display: grid;
grid-template-columns: 1fr;
gap: 20px;
}
@media (min-width: 576px) {
#menu {
grid-template-columns: repeat(2, 1fr);
}
}
@media (min-width: 992px) {
#menu {
grid-template-columns: repeat(3, 1fr);
}
}
.modal-content {
background-color: #fefefe;
margin: auto;
padding: 20px;
border: 1px solid #888;
width: 80%;
}
.close-button {
color: #aaaaaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close-button:hover,
.close-button:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg">
<a class="navbar-brand" href="#">My Restaurant</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<input class="form-control mr-sm-2" type="search" id="search-input" placeholder="Search" aria-label="Search">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<button class="filter-button nav-link" data-filter="all">All</button>
</li>
<li class="nav-item">
<button class="filter-button nav-link" data-filter="starters">Starters</button>
</li>
<li class="nav-item">
<button class="filter-button nav-link" data-filter="mains">Mains</button>
</li>
<li class="nav-item">
<button class="filter-button nav-link" data-filter="desserts">Desserts</button>
</li>
<li class="nav-item">
<button class="filter-button nav-link" data-filter="beverages">Beverages</button>
</li>
</ul>
</div>
</nav>
<div class="video-container">
<video autoplay muted loop id="circularVideo">
<source src="https://files.codingninjas.in/restaurant-1706081051.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>
<div class="container">
<div id="menu" class="row">
<!-- Items will be inserted here by JavaScript -->
</div>
</div>
<div id="cart-popup" class="modal">
<div class="modal-content">
<span class="close-button">×</span>
<p>Item added to cart!</p>
</div>
</div>
<script>const menu = [
{ id: 1, title: "Soup of the day", category: "starters", price:"50₹", description: "Freshly made soup with seasonal ingredients",img: "https://images.pexels.com/photos/1731535/pexels-photo-1731535.jpeg?auto=compress&cs=tinysrgb&w=400" },
{ id: 2, title: "Bruschetta", category: "starters", price: "70₹", description: "Grilled bread rubbed with garlic and topped with diced tomatoes, fresh basil, and mozzarella",img: "https://www.allrecipes.com/thmb/kt9t899s87rKleitZiaUwWOoNJI=/750x0/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)/3605381-b506207e5f494e44a7cf5c1bbe488748.jpg" },
{ id: 3, title: "Chicken Parmesan", category: "mains", price: "120₹", description: "Crispy chicken topped with tomato sauce and mozzarella, served with spaghetti",img: "https://media.gettyimages.com/id/1358831517/photo/crispy-chicken-parmesan.jpg?s=612x612&w=0&k=20&c=izCK6IforZt1WU1f467NXB-PPR0TAfEw0aoJ6d8imB0=" },
{ id: 4, title: "Steak Frites", category: "mains", price: "180₹", description: "Grilled steak served with french fries and salad" , img: "https://media.gettyimages.com/id/463889403/photo/rib-eye-steak.jpg?s=612x612&w=0&k=20&c=igQuEqd2hEwHnwIcuMbiUnQRm5T9Mwk1ASFanAq6iOk="},
{ id: 5, title: "Chocolate Lava Cake", category: "desserts", price: "80₹", description: "Warm chocolate cake with a gooey molten chocolate center, served with vanilla ice cream" , img: "https://media.istockphoto.com/id/544716244/photo/warm-chocolate-lava-cake-with-molten-center-and-red-currants.webp?b=1&s=170667a&w=0&k=20&c=6NPIcP8XUG4WwbJU-qfLOEP07aU79doAIsqZ8wic478="},
{ id: 6, title: "Apple Pie", category: "desserts", price: "60₹", description: "Classic apple pie with a flaky crust, served with whipped cream", img: "https://plus.unsplash.com/premium_photo-1666353535417-c86616951727?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MXx8YXBwbGUlMjBwaWV8ZW58MHx8MHx8fDA%3D&auto=format&fit=crop&w=500&q=60"},
{ id: 7, title: "Vegan Burger", category: "mains", price: "100₹", description: "Plant-based burger served with fries", img: "https://plus.unsplash.com/premium_photo-1664648063589-76b97669bc29?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MXx8dmVnYW4lMjBidXJnZXJ8ZW58MHx8MHx8fDA%3D&auto=format&fit=crop&w=500&q=60" },
{ id: 8, title: "Caesar Salad", category: "starters", price: "60₹", description: "Fresh romaine lettuce with Caesar dressing, parmesan, and croutons", img: "https://images.unsplash.com/photo-1550304943-4f24f54ddde9?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Mnx8Y2Vhc2FyJTIwc2FsYWR8ZW58MHx8MHx8fDA%3D&auto=format&fit=crop&w=500&q=60" },
{ id: 9, title: "Spaghetti Carbonara", category: "mains", price: "140₹", description: "Classic carbonara with pancetta, egg, hard cheese, and pepper", img: "https://images.unsplash.com/photo-1600803907087-f56d462fd26b?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MTF8fHNwYWdoZXR0aSUyMGNhcmJvbmFyYXxlbnwwfHwwfHx8MA%3D%3D&auto=format&fit=crop&w=500&q=60" },
{ id: 10, title: "Tiramisu", category: "desserts", price: "70₹", description: "Italian dessert made of savoiardi dipped in coffee, layered with a whipped mixture of eggs, sugar, and mascarpone cheese", img: "https://images.unsplash.com/photo-1571877227200-a0d98ea607e9?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8M3x8dGlyYW1pc3V8ZW58MHx8MHx8fDA%3D&auto=format&fit=crop&w=500&q=60" },
{ id: 11, title: "Iced Coffee", category: "beverages", price: "40₹", description: "Chilled coffee served with ice and cream", img: "https://media.istockphoto.com/id/170428990/photo/iced-mocha.webp?b=1&s=170667a&w=0&k=20&c=ItUVpbetBvrKaKcJySbepwehwa2JIJjSOqzHulpvJY0=" },
{ id: 12, title: "Mango Lassi", category: "beverages", price: "50₹", description: "Refreshing Indian drink made with mango and yogurt", img: "https://media.istockphoto.com/id/1217751214/photo/fresh-mango-lassi-and-mango-fruit.webp?b=1&s=170667a&w=0&k=20&c=Jt0J70BwVkGdirVAu78hKb-MiMzN3_GUbCz8SmGUdS8=" },
{ id: 13, title: "Green Tea", category: "beverages", price: "30₹", description: "Traditional green tea with antioxidants", img: "https://images.unsplash.com/photo-1627435601361-ec25f5b1d0e5?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8NHx8Z3JlZW4lMjB0ZWF8ZW58MHx8MHx8fDA%3D&auto=format&fit=crop&w=500&q=60" },
];
const menuContainer = document.querySelector('#menu');
const filterButtons = document.querySelectorAll('.filter-button');
const searchInput = document.querySelector('#search-input');
function displayMenuItems(menuItems) {
let displayMenu = menuItems.map(function (item) {
return `<div class="menu-item">
<div class="card">
<img src="${item.img}" class="card-img-top" alt="${item.title}">
<div class="card-body">
<h5 class="card-title">${item.title}</h5>
<h6 class="card-subtitle mb-2 text-muted">${item.price}</h6>
<p class="card-text">${item.description}</p>
<p class="card-text"><small class="text-muted">Category: ${item.category}</small></p>
</div>
</div>
</div>
`;
});
displayMenu = displayMenu.join("");
menuContainer.innerHTML = displayMenu;
}
filterButtons.forEach(function (button) {
button.addEventListener('click', function (e) {
const category = e.currentTarget.dataset.filter;
const menuCategory = category === 'all'
? menu
: menu.filter(function (menuItem) {
return menuItem.category === category;
});
displayMenuItems(menuCategory);
});
});
window.addEventListener('DOMContentLoaded', function () {
displayMenuItems(menu);
});
// Popup functionality
var modal = document.getElementById("cart-popup");
var span = document.getElementsByClassName("close-button")[0];
function showPopup() {
modal.style.display = "block";
}
span.onclick = function() {
modal.style.display = "none";
}
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
// Search functionality
searchInput.addEventListener('keyup', function(e) {
const searchString = e.target.value.toLowerCase();
const filteredMenu = menu.filter((menuItem) => {
return menuItem.title.toLowerCase().includes(searchString) || menuItem.description.toLowerCase().includes(searchString);
});
displayMenuItems(filteredMenu);
});
</script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</body>
</html>