Update templates/search.html
Browse files- templates/search.html +180 -170
templates/search.html
CHANGED
@@ -11,72 +11,68 @@
|
|
11 |
<link rel="preload" href="/static/placeholder.jpg" as="image">
|
12 |
<style>
|
13 |
body {
|
14 |
-
font-family:
|
15 |
-
background-color: #
|
16 |
margin: 0;
|
17 |
padding: 0;
|
18 |
display: flex;
|
19 |
flex-direction: column;
|
20 |
-
padding-bottom:
|
21 |
}
|
22 |
.container {
|
23 |
-
max-width:
|
24 |
}
|
25 |
.menu-heading {
|
26 |
-
font-size:
|
27 |
font-weight: 700;
|
28 |
color: #fff;
|
29 |
text-align: center;
|
30 |
-
padding: 20px;
|
31 |
-
margin:
|
32 |
-
background: linear-gradient(45deg, #
|
33 |
-
border-radius:
|
34 |
-
box-shadow: 0
|
35 |
width: 100%;
|
36 |
-
max-width:
|
37 |
margin-left: auto;
|
38 |
margin-right: auto;
|
39 |
}
|
40 |
.menu-card {
|
41 |
-
max-width:
|
42 |
-
border-radius:
|
43 |
overflow: hidden;
|
44 |
background-color: #fff;
|
45 |
margin: auto;
|
46 |
display: flex;
|
47 |
flex-direction: column;
|
48 |
-
box-shadow: 0
|
49 |
cursor: pointer;
|
50 |
-
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
51 |
-
}
|
52 |
-
.menu-card:hover {
|
53 |
-
transform: translateY(-5px);
|
54 |
-
box-shadow: 0 10px 20px rgba(0,0,0,0.2);
|
55 |
}
|
56 |
.card-img-container {
|
57 |
position: relative;
|
58 |
width: 100%;
|
59 |
-
height:
|
60 |
}
|
61 |
.card-img {
|
62 |
height: 100%;
|
63 |
width: 100%;
|
64 |
object-fit: cover;
|
65 |
-
border-radius:
|
66 |
display: block;
|
67 |
}
|
68 |
.card-title {
|
69 |
position: absolute;
|
70 |
-
top:
|
71 |
left: 50%;
|
72 |
transform: translateX(-50%);
|
73 |
-
font-size: 1.
|
74 |
font-weight: 600;
|
75 |
color: #fff;
|
76 |
text-align: center;
|
77 |
-
|
78 |
-
|
79 |
-
|
|
|
80 |
width: 90%;
|
81 |
white-space: nowrap;
|
82 |
overflow: hidden;
|
@@ -84,135 +80,143 @@
|
|
84 |
z-index: 1;
|
85 |
}
|
86 |
.menu-card .card-body {
|
87 |
-
padding:
|
88 |
text-align: center;
|
89 |
}
|
90 |
.menu-card .card-body .card-text.section {
|
91 |
-
font-size:
|
92 |
color: #6c757d;
|
|
|
93 |
margin-bottom: 10px;
|
94 |
}
|
95 |
.avatar-dropdown-container {
|
96 |
position: absolute;
|
97 |
-
right:
|
98 |
top: 50%;
|
99 |
transform: translateY(-50%);
|
|
|
|
|
|
|
100 |
}
|
101 |
.avatar-icon {
|
102 |
-
width:
|
103 |
-
height:
|
104 |
border-radius: 50%;
|
105 |
-
background: linear-gradient(45deg, #
|
106 |
cursor: pointer;
|
107 |
display: flex;
|
108 |
align-items: center;
|
109 |
justify-content: center;
|
110 |
color: white;
|
111 |
-
font-size:
|
112 |
font-weight: bold;
|
113 |
-
box-shadow: 0 2px 6px rgba(0,0,0,0.2);
|
114 |
-
transition: transform 0.3s ease;
|
115 |
-
}
|
116 |
-
.avatar-icon:hover {
|
117 |
-
transform: scale(1.1);
|
118 |
}
|
119 |
.dropdown-menu {
|
120 |
position: absolute;
|
121 |
right: 0;
|
122 |
top: 100%;
|
123 |
-
background-color: #
|
124 |
-
border-radius:
|
125 |
-
width:
|
126 |
-
box-shadow:
|
127 |
display: none;
|
128 |
-
border: 1px solid #
|
129 |
z-index: 1000;
|
130 |
}
|
131 |
.dropdown-menu .dropdown-item {
|
132 |
-
padding:
|
133 |
text-decoration: none;
|
134 |
-
color: #
|
135 |
-
border-bottom: 1px solid #
|
136 |
display: flex;
|
137 |
align-items: center;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
font-size: 16px;
|
139 |
-
transition: background-color 0.3s ease;
|
140 |
}
|
141 |
.dropdown-menu .dropdown-item:last-child {
|
142 |
border-bottom: none;
|
143 |
}
|
144 |
.dropdown-menu .dropdown-item:hover {
|
145 |
-
background-color: #
|
146 |
-
color: #
|
147 |
-
|
148 |
-
.dropdown-menu .dropdown-item i {
|
149 |
-
margin-right: 10px;
|
150 |
-
font-size: 18px;
|
151 |
}
|
152 |
.fixed-top-bar {
|
153 |
-
position:
|
154 |
top: 0;
|
155 |
left: 0;
|
156 |
width: 100%;
|
157 |
-
height:
|
158 |
-
background: linear-gradient(45deg, #
|
159 |
color: white;
|
160 |
padding: 15px;
|
161 |
display: flex;
|
162 |
justify-content: space-between;
|
163 |
align-items: center;
|
164 |
z-index: 1000;
|
165 |
-
box-shadow: 0 2px 6px rgba(0,0,0,0.2);
|
166 |
}
|
167 |
.back-arrow-container {
|
168 |
position: absolute;
|
169 |
-
left:
|
170 |
top: 50%;
|
171 |
transform: translateY(-50%);
|
|
|
|
|
|
|
172 |
}
|
173 |
.back-arrow {
|
174 |
-
width:
|
175 |
-
height:
|
176 |
border-radius: 50%;
|
177 |
-
background: linear-gradient(45deg, #
|
178 |
display: flex;
|
179 |
align-items: center;
|
180 |
justify-content: center;
|
181 |
color: white;
|
182 |
-
font-size:
|
183 |
cursor: pointer;
|
184 |
-
transition: transform 0.
|
185 |
text-decoration: none;
|
186 |
-
box-shadow: 0 2px
|
187 |
}
|
188 |
.back-arrow:hover {
|
189 |
-
background: linear-gradient(45deg, #
|
190 |
transform: scale(1.1);
|
191 |
}
|
192 |
.back-arrow:active {
|
193 |
transform: scale(0.95);
|
194 |
}
|
195 |
.search-bar-container {
|
196 |
-
position:
|
197 |
-
left:
|
198 |
top: 50%;
|
199 |
transform: translateY(-50%);
|
200 |
-
|
201 |
-
|
|
|
|
|
|
|
202 |
}
|
203 |
.search-bar-container input {
|
204 |
width: 100%;
|
205 |
-
padding:
|
206 |
font-size: 16px;
|
207 |
border-radius: 25px;
|
208 |
border: none;
|
209 |
background-color: #fff;
|
210 |
-
box-shadow: 0
|
211 |
outline: none;
|
212 |
-
transition:
|
213 |
}
|
214 |
.search-bar-container input:focus {
|
215 |
-
|
216 |
}
|
217 |
.search-bar-container input::placeholder {
|
218 |
color: #888;
|
@@ -220,57 +224,54 @@
|
|
220 |
.search-icon {
|
221 |
position: absolute;
|
222 |
left: 15px;
|
223 |
-
|
224 |
-
transform: translateY(-50%);
|
225 |
-
font-size: 20px;
|
226 |
color: #888;
|
227 |
}
|
228 |
.mic-icon {
|
229 |
position: absolute;
|
230 |
right: 15px;
|
231 |
-
|
232 |
-
transform: translateY(-50%);
|
233 |
-
font-size: 20px;
|
234 |
color: #888;
|
235 |
cursor: pointer;
|
236 |
transition: color 0.3s ease;
|
237 |
}
|
238 |
.mic-icon.active {
|
239 |
-
color: #
|
240 |
}
|
241 |
-
.
|
242 |
position: absolute;
|
243 |
top: 100%;
|
244 |
left: 0;
|
245 |
right: 0;
|
246 |
background-color: #fff;
|
247 |
-
border-radius:
|
248 |
-
box-shadow: 0
|
249 |
max-height: 300px;
|
250 |
overflow-y: auto;
|
251 |
z-index: 1000;
|
252 |
display: none;
|
|
|
253 |
}
|
254 |
-
.
|
255 |
display: flex;
|
256 |
align-items: center;
|
257 |
-
padding: 10px
|
258 |
border-bottom: 1px solid #eee;
|
259 |
cursor: pointer;
|
260 |
-
transition: background-color 0.
|
261 |
}
|
262 |
-
.
|
263 |
-
background-color: #
|
264 |
}
|
265 |
-
.
|
266 |
width: 50px;
|
267 |
height: 50px;
|
268 |
object-fit: cover;
|
269 |
border-radius: 5px;
|
270 |
-
margin-right:
|
271 |
}
|
272 |
-
.
|
273 |
-
font-size:
|
274 |
color: #333;
|
275 |
}
|
276 |
.bottom-action-bar {
|
@@ -278,21 +279,21 @@
|
|
278 |
bottom: 0;
|
279 |
left: 0;
|
280 |
right: 0;
|
281 |
-
background-color:
|
282 |
-
padding:
|
283 |
display: flex;
|
284 |
justify-content: space-between;
|
285 |
align-items: center;
|
286 |
-
box-shadow: 0 -
|
287 |
z-index: 1000;
|
288 |
-
max-width:
|
289 |
margin: 0 auto;
|
290 |
}
|
291 |
.bottom-action-bar .btn {
|
292 |
flex: 1;
|
293 |
-
margin: 0
|
294 |
-
padding:
|
295 |
-
border-radius:
|
296 |
font-weight: bold;
|
297 |
font-size: 16px;
|
298 |
color: white;
|
@@ -300,71 +301,73 @@
|
|
300 |
align-items: center;
|
301 |
justify-content: center;
|
302 |
text-align: center;
|
303 |
-
|
|
|
304 |
}
|
305 |
.bottom-action-bar .btn-order-history {
|
306 |
-
background:
|
|
|
307 |
}
|
308 |
.bottom-action-bar .btn-order-history:hover {
|
309 |
-
background:
|
|
|
310 |
}
|
311 |
.bottom-action-bar .btn-view-cart {
|
312 |
-
background:
|
|
|
313 |
}
|
314 |
.bottom-action-bar .btn-view-cart:hover {
|
315 |
-
background:
|
|
|
316 |
}
|
317 |
.cart-icon-badge {
|
318 |
-
background-color:
|
319 |
-
color: #
|
320 |
border-radius: 50%;
|
321 |
-
width:
|
322 |
-
height:
|
323 |
display: inline-flex;
|
324 |
align-items: center;
|
325 |
justify-content: center;
|
326 |
font-size: 12px;
|
327 |
-
margin-left:
|
328 |
}
|
329 |
.no-results {
|
330 |
text-align: center;
|
331 |
-
font-size: 1.
|
332 |
color: #6c757d;
|
333 |
-
margin-top:
|
334 |
}
|
335 |
@media (max-width: 576px) {
|
336 |
.fixed-top-bar {
|
337 |
-
height:
|
338 |
padding: 10px;
|
339 |
}
|
340 |
.back-arrow-container {
|
341 |
-
left:
|
342 |
}
|
343 |
.back-arrow {
|
344 |
-
width:
|
345 |
-
height:
|
346 |
-
font-size:
|
347 |
}
|
348 |
.search-bar-container {
|
349 |
-
width: calc(80% -
|
350 |
-
max-width: calc(100% -
|
351 |
-
left:
|
352 |
}
|
353 |
.search-bar-container input {
|
354 |
-
padding:
|
355 |
font-size: 14px;
|
356 |
border-radius: 20px;
|
357 |
}
|
358 |
.search-icon {
|
359 |
left: 12px;
|
360 |
-
font-size:
|
361 |
}
|
362 |
.mic-icon {
|
363 |
right: 12px;
|
364 |
-
font-size:
|
365 |
-
}
|
366 |
-
.autocomplete-popup {
|
367 |
-
width: 100%;
|
368 |
}
|
369 |
.avatar-dropdown-container {
|
370 |
right: 10px;
|
@@ -377,37 +380,51 @@
|
|
377 |
.dropdown-menu {
|
378 |
width: 220px;
|
379 |
}
|
|
|
|
|
|
|
|
|
380 |
.menu-heading {
|
381 |
-
font-size: 1.
|
382 |
-
padding:
|
383 |
-
margin:
|
384 |
}
|
385 |
.menu-card {
|
386 |
max-width: 100%;
|
387 |
}
|
388 |
.card-img-container {
|
389 |
-
height:
|
390 |
}
|
391 |
.card-title {
|
392 |
-
font-size:
|
393 |
-
top:
|
394 |
-
padding:
|
395 |
}
|
396 |
.menu-card .card-body .card-text.section {
|
397 |
-
font-size: 0.
|
398 |
}
|
399 |
.bottom-action-bar {
|
400 |
-
padding: 10px
|
401 |
}
|
402 |
.bottom-action-bar .btn {
|
403 |
-
padding: 10px
|
404 |
font-size: 14px;
|
405 |
}
|
406 |
.cart-icon-badge {
|
407 |
-
width:
|
408 |
-
height:
|
409 |
-
font-size:
|
410 |
-
margin-left:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
411 |
}
|
412 |
}
|
413 |
</style>
|
@@ -434,11 +451,11 @@
|
|
434 |
<input type="text" id="searchBar" class="form-control" placeholder="Search items or sections..." autocomplete="off">
|
435 |
<i class="bi bi-search search-icon"></i>
|
436 |
<i class="bi bi-mic mic-icon" id="micIcon"></i>
|
437 |
-
<div class="
|
438 |
</div>
|
439 |
</div>
|
440 |
|
441 |
-
<div class="container mt-
|
442 |
<h1 class="menu-heading">Search Menu Items</h1>
|
443 |
<div class="row" id="menuItems">
|
444 |
{% for section, items in ordered_menu.items() %}
|
@@ -446,7 +463,7 @@
|
|
446 |
<div class="col-md-6 mb-4 menu-item" data-name="{{ item.Name | default('Unnamed Item') }}" data-section="{{ item.Section__c | default(section) }}">
|
447 |
<div class="card menu-card" onclick="selectItem('{{ item.Name | default('Unnamed Item') }}', '{{ item.Section__c | default(section) }}')">
|
448 |
<div class="card-img-container">
|
449 |
-
<img src="{{ item.Image1__c | default('/static/placeholder.jpg') }}" alt="{{ item.Name | default('Unnamed Item') }}" class="card-img" loading="eager" decoding="async" width="
|
450 |
<h5 class="card-title">{{ item.Name | default('Unnamed Item') }}</h5>
|
451 |
</div>
|
452 |
<div class="card-body">
|
@@ -527,39 +544,38 @@
|
|
527 |
noResults.style.display = hasResults ? 'none' : 'block';
|
528 |
}
|
529 |
|
530 |
-
function
|
531 |
-
const
|
532 |
-
|
533 |
if (!query) {
|
534 |
-
|
535 |
return;
|
536 |
}
|
537 |
|
538 |
const filteredItems = menuItems.filter(item =>
|
539 |
-
item.name.toLowerCase().
|
|
|
540 |
);
|
541 |
|
542 |
if (filteredItems.length === 0) {
|
543 |
-
|
544 |
return;
|
545 |
}
|
546 |
|
547 |
filteredItems.forEach(item => {
|
548 |
-
const
|
549 |
-
|
550 |
-
|
551 |
<img src="${item.image}" alt="${item.name}">
|
552 |
<span>${item.name}</span>
|
553 |
`;
|
554 |
-
|
555 |
-
|
556 |
-
filterMenuItems(item.name);
|
557 |
-
autocompletePopup.style.display = 'none';
|
558 |
});
|
559 |
-
|
560 |
});
|
561 |
|
562 |
-
|
563 |
}
|
564 |
|
565 |
document.addEventListener('DOMContentLoaded', function () {
|
@@ -584,20 +600,21 @@
|
|
584 |
|
585 |
// Search Bar Functionality
|
586 |
const searchBar = document.getElementById('searchBar');
|
587 |
-
const
|
588 |
const searchQuery = localStorage.getItem('searchQuery');
|
589 |
if (searchQuery) {
|
590 |
searchBar.value = searchQuery;
|
591 |
filterMenuItems(searchQuery);
|
|
|
592 |
localStorage.removeItem('searchQuery');
|
593 |
}
|
594 |
searchBar.addEventListener('input', function () {
|
595 |
filterMenuItems(this.value);
|
596 |
-
|
597 |
});
|
598 |
document.addEventListener('click', function (event) {
|
599 |
-
if (!searchBar.contains(event.target) && !
|
600 |
-
|
601 |
}
|
602 |
});
|
603 |
|
@@ -612,7 +629,7 @@
|
|
612 |
const query = event.results[0][0].transcript.trim();
|
613 |
searchBar.value = query;
|
614 |
filterMenuItems(query);
|
615 |
-
|
616 |
};
|
617 |
recognition.onend = () => micIcon.classList.remove('active');
|
618 |
recognition.onerror = (event) => {
|
@@ -651,11 +668,4 @@
|
|
651 |
});
|
652 |
</script>
|
653 |
</body>
|
654 |
-
</html
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
|
|
11 |
<link rel="preload" href="/static/placeholder.jpg" as="image">
|
12 |
<style>
|
13 |
body {
|
14 |
+
font-family: Arial, sans-serif;
|
15 |
+
background-color: #fdf4e3;
|
16 |
margin: 0;
|
17 |
padding: 0;
|
18 |
display: flex;
|
19 |
flex-direction: column;
|
20 |
+
padding-bottom: 70px;
|
21 |
}
|
22 |
.container {
|
23 |
+
max-width: 900px;
|
24 |
}
|
25 |
.menu-heading {
|
26 |
+
font-size: 2rem;
|
27 |
font-weight: 700;
|
28 |
color: #fff;
|
29 |
text-align: center;
|
30 |
+
padding: 15px 20px;
|
31 |
+
margin: 20px 0;
|
32 |
+
background: linear-gradient(45deg, #FFA07A, #FFB347);
|
33 |
+
border-radius: 10px;
|
34 |
+
box-shadow: 0 4px 8px rgba(0,0,0,0.2);
|
35 |
width: 100%;
|
36 |
+
max-width: 900px;
|
37 |
margin-left: auto;
|
38 |
margin-right: auto;
|
39 |
}
|
40 |
.menu-card {
|
41 |
+
max-width: 350px;
|
42 |
+
border-radius: 15px;
|
43 |
overflow: hidden;
|
44 |
background-color: #fff;
|
45 |
margin: auto;
|
46 |
display: flex;
|
47 |
flex-direction: column;
|
48 |
+
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
49 |
cursor: pointer;
|
|
|
|
|
|
|
|
|
|
|
50 |
}
|
51 |
.card-img-container {
|
52 |
position: relative;
|
53 |
width: 100%;
|
54 |
+
height: 200px;
|
55 |
}
|
56 |
.card-img {
|
57 |
height: 100%;
|
58 |
width: 100%;
|
59 |
object-fit: cover;
|
60 |
+
border-radius: 15px 15px 0 0;
|
61 |
display: block;
|
62 |
}
|
63 |
.card-title {
|
64 |
position: absolute;
|
65 |
+
top: 10px;
|
66 |
left: 50%;
|
67 |
transform: translateX(-50%);
|
68 |
+
font-size: 1.2rem;
|
69 |
font-weight: 600;
|
70 |
color: #fff;
|
71 |
text-align: center;
|
72 |
+
margin: 0;
|
73 |
+
padding: 5px 10px;
|
74 |
+
background-color: rgba(0, 0, 0, 0.5);
|
75 |
+
border-radius: 5px;
|
76 |
width: 90%;
|
77 |
white-space: nowrap;
|
78 |
overflow: hidden;
|
|
|
80 |
z-index: 1;
|
81 |
}
|
82 |
.menu-card .card-body {
|
83 |
+
padding: 10px;
|
84 |
text-align: center;
|
85 |
}
|
86 |
.menu-card .card-body .card-text.section {
|
87 |
+
font-size: 0.9rem;
|
88 |
color: #6c757d;
|
89 |
+
text-align: center;
|
90 |
margin-bottom: 10px;
|
91 |
}
|
92 |
.avatar-dropdown-container {
|
93 |
position: absolute;
|
94 |
+
right: 10px;
|
95 |
top: 50%;
|
96 |
transform: translateY(-50%);
|
97 |
+
display: flex;
|
98 |
+
align-items: center;
|
99 |
+
justify-content: center;
|
100 |
}
|
101 |
.avatar-icon {
|
102 |
+
width: 40px;
|
103 |
+
height: 40px;
|
104 |
border-radius: 50%;
|
105 |
+
background: linear-gradient(45deg, #FF4500, #000000, #1E90FF);
|
106 |
cursor: pointer;
|
107 |
display: flex;
|
108 |
align-items: center;
|
109 |
justify-content: center;
|
110 |
color: white;
|
111 |
+
font-size: 20px;
|
112 |
font-weight: bold;
|
|
|
|
|
|
|
|
|
|
|
113 |
}
|
114 |
.dropdown-menu {
|
115 |
position: absolute;
|
116 |
right: 0;
|
117 |
top: 100%;
|
118 |
+
background-color: #fff8f0;
|
119 |
+
border-radius: 5px;
|
120 |
+
width: 220px;
|
121 |
+
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
|
122 |
display: none;
|
123 |
+
border: 1px solid #ffd8b1;
|
124 |
z-index: 1000;
|
125 |
}
|
126 |
.dropdown-menu .dropdown-item {
|
127 |
+
padding: 12px 16px;
|
128 |
text-decoration: none;
|
129 |
+
color: #333;
|
130 |
+
border-bottom: 1px solid #ffd8b1;
|
131 |
display: flex;
|
132 |
align-items: center;
|
133 |
+
font-size: 15px;
|
134 |
+
transition: background-color 0.2s ease;
|
135 |
+
background: linear-gradient(45deg, #FF4500, #000000, #1E90FF);
|
136 |
+
-webkit-background-clip: text;
|
137 |
+
-webkit-text-fill-color: transparent;
|
138 |
+
}
|
139 |
+
.dropdown-menu .dropdown-item i {
|
140 |
+
margin-right: 10px;
|
141 |
font-size: 16px;
|
|
|
142 |
}
|
143 |
.dropdown-menu .dropdown-item:last-child {
|
144 |
border-bottom: none;
|
145 |
}
|
146 |
.dropdown-menu .dropdown-item:hover {
|
147 |
+
background-color: #ffe4c4;
|
148 |
+
color: #333;
|
149 |
+
-webkit-text-fill-color: #333;
|
|
|
|
|
|
|
150 |
}
|
151 |
.fixed-top-bar {
|
152 |
+
position: relative;
|
153 |
top: 0;
|
154 |
left: 0;
|
155 |
width: 100%;
|
156 |
+
height: 54px;
|
157 |
+
background: linear-gradient(45deg, #FFA07A, #FFB347);
|
158 |
color: white;
|
159 |
padding: 15px;
|
160 |
display: flex;
|
161 |
justify-content: space-between;
|
162 |
align-items: center;
|
163 |
z-index: 1000;
|
|
|
164 |
}
|
165 |
.back-arrow-container {
|
166 |
position: absolute;
|
167 |
+
left: 10px;
|
168 |
top: 50%;
|
169 |
transform: translateY(-50%);
|
170 |
+
display: flex;
|
171 |
+
align-items: center;
|
172 |
+
justify-content: center;
|
173 |
}
|
174 |
.back-arrow {
|
175 |
+
width: 36px;
|
176 |
+
height: 36px;
|
177 |
border-radius: 50%;
|
178 |
+
background: linear-gradient(45deg, #FFA07A, #FFB347);
|
179 |
display: flex;
|
180 |
align-items: center;
|
181 |
justify-content: center;
|
182 |
color: white;
|
183 |
+
font-size: 20px;
|
184 |
cursor: pointer;
|
185 |
+
transition: transform 0.2s ease, background-color 0.2s ease;
|
186 |
text-decoration: none;
|
187 |
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
188 |
}
|
189 |
.back-arrow:hover {
|
190 |
+
background: linear-gradient(45deg, #FF8C61, #FF9E2C);
|
191 |
transform: scale(1.1);
|
192 |
}
|
193 |
.back-arrow:active {
|
194 |
transform: scale(0.95);
|
195 |
}
|
196 |
.search-bar-container {
|
197 |
+
position: absolute;
|
198 |
+
left: 60px;
|
199 |
top: 50%;
|
200 |
transform: translateY(-50%);
|
201 |
+
display: flex;
|
202 |
+
align-items: center;
|
203 |
+
width: 300px;
|
204 |
+
max-width: calc(90% - 60px);
|
205 |
+
position: relative;
|
206 |
}
|
207 |
.search-bar-container input {
|
208 |
width: 100%;
|
209 |
+
padding: 8px 40px 8px 40px;
|
210 |
font-size: 16px;
|
211 |
border-radius: 25px;
|
212 |
border: none;
|
213 |
background-color: #fff;
|
214 |
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
215 |
outline: none;
|
216 |
+
transition: border-bottom 0.3s ease;
|
217 |
}
|
218 |
.search-bar-container input:focus {
|
219 |
+
border-bottom: 2px solid #FFA07A;
|
220 |
}
|
221 |
.search-bar-container input::placeholder {
|
222 |
color: #888;
|
|
|
224 |
.search-icon {
|
225 |
position: absolute;
|
226 |
left: 15px;
|
227 |
+
font-size: 18px;
|
|
|
|
|
228 |
color: #888;
|
229 |
}
|
230 |
.mic-icon {
|
231 |
position: absolute;
|
232 |
right: 15px;
|
233 |
+
font-size: 18px;
|
|
|
|
|
234 |
color: #888;
|
235 |
cursor: pointer;
|
236 |
transition: color 0.3s ease;
|
237 |
}
|
238 |
.mic-icon.active {
|
239 |
+
color: #007bff;
|
240 |
}
|
241 |
+
.search-popup {
|
242 |
position: absolute;
|
243 |
top: 100%;
|
244 |
left: 0;
|
245 |
right: 0;
|
246 |
background-color: #fff;
|
247 |
+
border-radius: 5px;
|
248 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
249 |
max-height: 300px;
|
250 |
overflow-y: auto;
|
251 |
z-index: 1000;
|
252 |
display: none;
|
253 |
+
margin-top: 5px;
|
254 |
}
|
255 |
+
.search-popup-item {
|
256 |
display: flex;
|
257 |
align-items: center;
|
258 |
+
padding: 10px;
|
259 |
border-bottom: 1px solid #eee;
|
260 |
cursor: pointer;
|
261 |
+
transition: background-color 0.2s ease;
|
262 |
}
|
263 |
+
.search-popup-item:hover {
|
264 |
+
background-color: #f8f9fa;
|
265 |
}
|
266 |
+
.search-popup-item img {
|
267 |
width: 50px;
|
268 |
height: 50px;
|
269 |
object-fit: cover;
|
270 |
border-radius: 5px;
|
271 |
+
margin-right: 10px;
|
272 |
}
|
273 |
+
.search-popup-item span {
|
274 |
+
font-size: 14px;
|
275 |
color: #333;
|
276 |
}
|
277 |
.bottom-action-bar {
|
|
|
279 |
bottom: 0;
|
280 |
left: 0;
|
281 |
right: 0;
|
282 |
+
background-color: white;
|
283 |
+
padding: 10px 20px;
|
284 |
display: flex;
|
285 |
justify-content: space-between;
|
286 |
align-items: center;
|
287 |
+
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
|
288 |
z-index: 1000;
|
289 |
+
max-width: 900px;
|
290 |
margin: 0 auto;
|
291 |
}
|
292 |
.bottom-action-bar .btn {
|
293 |
flex: 1;
|
294 |
+
margin: 0 5px;
|
295 |
+
padding: 10px 15px;
|
296 |
+
border-radius: 8px;
|
297 |
font-weight: bold;
|
298 |
font-size: 16px;
|
299 |
color: white;
|
|
|
301 |
align-items: center;
|
302 |
justify-content: center;
|
303 |
text-align: center;
|
304 |
+
min-width: 0;
|
305 |
+
white-space: nowrap;
|
306 |
}
|
307 |
.bottom-action-bar .btn-order-history {
|
308 |
+
background-color: #FFA07A;
|
309 |
+
border-color: #FFA07A;
|
310 |
}
|
311 |
.bottom-action-bar .btn-order-history:hover {
|
312 |
+
background-color: #FF8C61;
|
313 |
+
border-color: #FF8C61;
|
314 |
}
|
315 |
.bottom-action-bar .btn-view-cart {
|
316 |
+
background-color: #0FAA39;
|
317 |
+
border-color: #0FAA39;
|
318 |
}
|
319 |
.bottom-action-bar .btn-view-cart:hover {
|
320 |
+
background-color: #0D9232;
|
321 |
+
border-color: #0D9232;
|
322 |
}
|
323 |
.cart-icon-badge {
|
324 |
+
background-color: white;
|
325 |
+
color: #0FAA39;
|
326 |
border-radius: 50%;
|
327 |
+
width: 20px;
|
328 |
+
height: 20px;
|
329 |
display: inline-flex;
|
330 |
align-items: center;
|
331 |
justify-content: center;
|
332 |
font-size: 12px;
|
333 |
+
margin-left: 8px;
|
334 |
}
|
335 |
.no-results {
|
336 |
text-align: center;
|
337 |
+
font-size: 1.2rem;
|
338 |
color: #6c757d;
|
339 |
+
margin-top: 20px;
|
340 |
}
|
341 |
@media (max-width: 576px) {
|
342 |
.fixed-top-bar {
|
343 |
+
height: 60px;
|
344 |
padding: 10px;
|
345 |
}
|
346 |
.back-arrow-container {
|
347 |
+
left: 8px;
|
348 |
}
|
349 |
.back-arrow {
|
350 |
+
width: 32px;
|
351 |
+
height: 32px;
|
352 |
+
font-size: 18px;
|
353 |
}
|
354 |
.search-bar-container {
|
355 |
+
width: calc(80% - 50px);
|
356 |
+
max-width: calc(100% - 50px);
|
357 |
+
left: 50px;
|
358 |
}
|
359 |
.search-bar-container input {
|
360 |
+
padding: 6px 35px 6px 35px;
|
361 |
font-size: 14px;
|
362 |
border-radius: 20px;
|
363 |
}
|
364 |
.search-icon {
|
365 |
left: 12px;
|
366 |
+
font-size: 16px;
|
367 |
}
|
368 |
.mic-icon {
|
369 |
right: 12px;
|
370 |
+
font-size: 16px;
|
|
|
|
|
|
|
371 |
}
|
372 |
.avatar-dropdown-container {
|
373 |
right: 10px;
|
|
|
380 |
.dropdown-menu {
|
381 |
width: 220px;
|
382 |
}
|
383 |
+
.dropdown-menu .dropdown-item {
|
384 |
+
padding: 12px 16px;
|
385 |
+
font-size: 15px;
|
386 |
+
}
|
387 |
.menu-heading {
|
388 |
+
font-size: 1.5rem;
|
389 |
+
padding: 10px 15px;
|
390 |
+
margin: 15px 0;
|
391 |
}
|
392 |
.menu-card {
|
393 |
max-width: 100%;
|
394 |
}
|
395 |
.card-img-container {
|
396 |
+
height: 150px;
|
397 |
}
|
398 |
.card-title {
|
399 |
+
font-size: 1rem;
|
400 |
+
top: 8px;
|
401 |
+
padding: 4px 8px;
|
402 |
}
|
403 |
.menu-card .card-body .card-text.section {
|
404 |
+
font-size: 0.8rem;
|
405 |
}
|
406 |
.bottom-action-bar {
|
407 |
+
padding: 8px 10px;
|
408 |
}
|
409 |
.bottom-action-bar .btn {
|
410 |
+
padding: 8px 10px;
|
411 |
font-size: 14px;
|
412 |
}
|
413 |
.cart-icon-badge {
|
414 |
+
width: 18px;
|
415 |
+
height: 18px;
|
416 |
+
font-size: 10px;
|
417 |
+
margin-left: 5px;
|
418 |
+
}
|
419 |
+
.search-popup {
|
420 |
+
width: 100%;
|
421 |
+
}
|
422 |
+
.search-popup-item img {
|
423 |
+
width: 40px;
|
424 |
+
height: 40px;
|
425 |
+
}
|
426 |
+
.search-popup-item span {
|
427 |
+
font-size: 12px;
|
428 |
}
|
429 |
}
|
430 |
</style>
|
|
|
451 |
<input type="text" id="searchBar" class="form-control" placeholder="Search items or sections..." autocomplete="off">
|
452 |
<i class="bi bi-search search-icon"></i>
|
453 |
<i class="bi bi-mic mic-icon" id="micIcon"></i>
|
454 |
+
<div class="search-popup" id="searchPopup"></div>
|
455 |
</div>
|
456 |
</div>
|
457 |
|
458 |
+
<div class="container mt-4">
|
459 |
<h1 class="menu-heading">Search Menu Items</h1>
|
460 |
<div class="row" id="menuItems">
|
461 |
{% for section, items in ordered_menu.items() %}
|
|
|
463 |
<div class="col-md-6 mb-4 menu-item" data-name="{{ item.Name | default('Unnamed Item') }}" data-section="{{ item.Section__c | default(section) }}">
|
464 |
<div class="card menu-card" onclick="selectItem('{{ item.Name | default('Unnamed Item') }}', '{{ item.Section__c | default(section) }}')">
|
465 |
<div class="card-img-container">
|
466 |
+
<img src="{{ item.Image1__c | default('/static/placeholder.jpg') }}" alt="{{ item.Name | default('Unnamed Item') }}" class="card-img" loading="eager" decoding="async" width="350" height="200">
|
467 |
<h5 class="card-title">{{ item.Name | default('Unnamed Item') }}</h5>
|
468 |
</div>
|
469 |
<div class="card-body">
|
|
|
544 |
noResults.style.display = hasResults ? 'none' : 'block';
|
545 |
}
|
546 |
|
547 |
+
function showSearchPopup(query) {
|
548 |
+
const searchPopup = document.getElementById('searchPopup');
|
549 |
+
searchPopup.innerHTML = '';
|
550 |
if (!query) {
|
551 |
+
searchPopup.style.display = 'none';
|
552 |
return;
|
553 |
}
|
554 |
|
555 |
const filteredItems = menuItems.filter(item =>
|
556 |
+
item.name.toLowerCase().includes(query.toLowerCase()) ||
|
557 |
+
item.section.toLowerCase().includes(query.toLowerCase())
|
558 |
);
|
559 |
|
560 |
if (filteredItems.length === 0) {
|
561 |
+
searchPopup.style.display = 'none';
|
562 |
return;
|
563 |
}
|
564 |
|
565 |
filteredItems.forEach(item => {
|
566 |
+
const popupItem = document.createElement('div');
|
567 |
+
popupItem.className = 'search-popup-item';
|
568 |
+
popupItem.innerHTML = `
|
569 |
<img src="${item.image}" alt="${item.name}">
|
570 |
<span>${item.name}</span>
|
571 |
`;
|
572 |
+
popupItem.addEventListener('click', () => {
|
573 |
+
selectItem(item.name, item.section);
|
|
|
|
|
574 |
});
|
575 |
+
searchPopup.appendChild(popupItem);
|
576 |
});
|
577 |
|
578 |
+
searchPopup.style.display = 'block';
|
579 |
}
|
580 |
|
581 |
document.addEventListener('DOMContentLoaded', function () {
|
|
|
600 |
|
601 |
// Search Bar Functionality
|
602 |
const searchBar = document.getElementById('searchBar');
|
603 |
+
const searchPopup = document.getElementById('searchPopup');
|
604 |
const searchQuery = localStorage.getItem('searchQuery');
|
605 |
if (searchQuery) {
|
606 |
searchBar.value = searchQuery;
|
607 |
filterMenuItems(searchQuery);
|
608 |
+
showSearchPopup(searchQuery);
|
609 |
localStorage.removeItem('searchQuery');
|
610 |
}
|
611 |
searchBar.addEventListener('input', function () {
|
612 |
filterMenuItems(this.value);
|
613 |
+
showSearchPopup(this.value);
|
614 |
});
|
615 |
document.addEventListener('click', function (event) {
|
616 |
+
if (!searchBar.contains(event.target) && !searchPopup.contains(event.target)) {
|
617 |
+
searchPopup.style.display = 'none';
|
618 |
}
|
619 |
});
|
620 |
|
|
|
629 |
const query = event.results[0][0].transcript.trim();
|
630 |
searchBar.value = query;
|
631 |
filterMenuItems(query);
|
632 |
+
showSearchPopup(query);
|
633 |
};
|
634 |
recognition.onend = () => micIcon.classList.remove('active');
|
635 |
recognition.onerror = (event) => {
|
|
|
668 |
});
|
669 |
</script>
|
670 |
</body>
|
671 |
+
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|