Spaces:
Sleeping
Sleeping
Update templates/menu.html
Browse files- templates/menu.html +61 -30
templates/menu.html
CHANGED
|
@@ -188,27 +188,32 @@
|
|
| 188 |
z-index: 1000;
|
| 189 |
}
|
| 190 |
.search-bar-container {
|
| 191 |
-
padding: 10px;
|
| 192 |
position: absolute;
|
| 193 |
-
left:
|
| 194 |
top: 50%;
|
| 195 |
-
transform:
|
| 196 |
display: flex;
|
| 197 |
-
justify-content: flex-start;
|
| 198 |
align-items: center;
|
| 199 |
width: 300px;
|
|
|
|
| 200 |
}
|
| 201 |
.search-bar-container input {
|
| 202 |
-
width:
|
| 203 |
-
padding: 8px
|
| 204 |
font-size: 16px;
|
| 205 |
-
border-radius:
|
| 206 |
border: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 207 |
}
|
| 208 |
.search-icon {
|
| 209 |
position: absolute;
|
| 210 |
left: 15px;
|
| 211 |
-
font-size:
|
| 212 |
color: #888;
|
| 213 |
}
|
| 214 |
.addon-section {
|
|
@@ -304,19 +309,6 @@
|
|
| 304 |
height: 40px;
|
| 305 |
width: 40px;
|
| 306 |
}
|
| 307 |
-
@media (max-width: 576px) {
|
| 308 |
-
.modal-dialog {
|
| 309 |
-
max-width: 98%;
|
| 310 |
-
}
|
| 311 |
-
.modal-footer .btn {
|
| 312 |
-
height: 35px;
|
| 313 |
-
padding: 0 12px;
|
| 314 |
-
}
|
| 315 |
-
.modal-footer .form-control {
|
| 316 |
-
width: 40px;
|
| 317 |
-
height: 35px;
|
| 318 |
-
}
|
| 319 |
-
}
|
| 320 |
/* Styles for Ingredients, Nutritional Info, and Allergens */
|
| 321 |
.item-details {
|
| 322 |
background-color: #f8f9fa;
|
|
@@ -357,7 +349,7 @@
|
|
| 357 |
.toggle-details:hover {
|
| 358 |
text-decoration: underline;
|
| 359 |
}
|
| 360 |
-
/*
|
| 361 |
.category-buttons {
|
| 362 |
display: flex;
|
| 363 |
flex-wrap: wrap;
|
|
@@ -383,6 +375,52 @@
|
|
| 383 |
.category-button:hover {
|
| 384 |
background-color: #e6f4ea;
|
| 385 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 386 |
</style>
|
| 387 |
</head>
|
| 388 |
<body>
|
|
@@ -404,7 +442,6 @@
|
|
| 404 |
</div>
|
| 405 |
</div>
|
| 406 |
|
| 407 |
-
<!-- Updated Category Selection -->
|
| 408 |
<form method="get" action="/menu" class="text-center mb-4" id="categoryForm">
|
| 409 |
<label class="form-label fw-bold">Select a Category:</label>
|
| 410 |
<div class="category-buttons">
|
|
@@ -413,7 +450,6 @@
|
|
| 413 |
{% endfor %}
|
| 414 |
<button type="button" class="category-button {% if selected_category == 'Customized Dish' %}selected{% endif %}" data-category="Customized Dish">Customized Dish</button>
|
| 415 |
</div>
|
| 416 |
-
<!-- Hidden input to store the selected category -->
|
| 417 |
<input type="hidden" name="category" id="selectedCategoryInput" value="{{ selected_category }}">
|
| 418 |
</form>
|
| 419 |
|
|
@@ -715,7 +751,6 @@
|
|
| 715 |
const categoryForm = document.getElementById('categoryForm');
|
| 716 |
const selectedCategoryInput = document.getElementById('selectedCategoryInput');
|
| 717 |
|
| 718 |
-
// Set default category to "All" if none is selected
|
| 719 |
if (!selectedCategoryInput.value) {
|
| 720 |
selectedCategoryInput.value = "All";
|
| 721 |
document.querySelector('.category-button[data-category="All"]').classList.add('selected');
|
|
@@ -723,13 +758,9 @@
|
|
| 723 |
|
| 724 |
categoryButtons.forEach(button => {
|
| 725 |
button.addEventListener('click', function () {
|
| 726 |
-
// Remove 'selected' class from all buttons
|
| 727 |
categoryButtons.forEach(btn => btn.classList.remove('selected'));
|
| 728 |
-
// Add 'selected' class to the clicked button
|
| 729 |
this.classList.add('selected');
|
| 730 |
-
// Update the hidden input value
|
| 731 |
selectedCategoryInput.value = this.getAttribute('data-category');
|
| 732 |
-
// Submit the form
|
| 733 |
categoryForm.submit();
|
| 734 |
});
|
| 735 |
});
|
|
@@ -1091,7 +1122,7 @@
|
|
| 1091 |
document.body.appendChild(successNotification);
|
| 1092 |
setTimeout(() => {
|
| 1093 |
successNotification.remove();
|
| 1094 |
-
},
|
| 1095 |
}
|
| 1096 |
|
| 1097 |
document.addEventListener('DOMContentLoaded', function () {
|
|
|
|
| 188 |
z-index: 1000;
|
| 189 |
}
|
| 190 |
.search-bar-container {
|
|
|
|
| 191 |
position: absolute;
|
| 192 |
+
left: 50%;
|
| 193 |
top: 50%;
|
| 194 |
+
transform: translate(-50%, -50%);
|
| 195 |
display: flex;
|
|
|
|
| 196 |
align-items: center;
|
| 197 |
width: 300px;
|
| 198 |
+
max-width: 90%;
|
| 199 |
}
|
| 200 |
.search-bar-container input {
|
| 201 |
+
width: 100%;
|
| 202 |
+
padding: 8px 15px 8px 40px;
|
| 203 |
font-size: 16px;
|
| 204 |
+
border-radius: 25px;
|
| 205 |
border: none;
|
| 206 |
+
background-color: #fff;
|
| 207 |
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
| 208 |
+
outline: none;
|
| 209 |
+
}
|
| 210 |
+
.search-bar-container input::placeholder {
|
| 211 |
+
color: #888;
|
| 212 |
}
|
| 213 |
.search-icon {
|
| 214 |
position: absolute;
|
| 215 |
left: 15px;
|
| 216 |
+
font-size: 18px;
|
| 217 |
color: #888;
|
| 218 |
}
|
| 219 |
.addon-section {
|
|
|
|
| 309 |
height: 40px;
|
| 310 |
width: 40px;
|
| 311 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 312 |
/* Styles for Ingredients, Nutritional Info, and Allergens */
|
| 313 |
.item-details {
|
| 314 |
background-color: #f8f9fa;
|
|
|
|
| 349 |
.toggle-details:hover {
|
| 350 |
text-decoration: underline;
|
| 351 |
}
|
| 352 |
+
/* Category Buttons */
|
| 353 |
.category-buttons {
|
| 354 |
display: flex;
|
| 355 |
flex-wrap: wrap;
|
|
|
|
| 375 |
.category-button:hover {
|
| 376 |
background-color: #e6f4ea;
|
| 377 |
}
|
| 378 |
+
/* Mobile View Adjustments */
|
| 379 |
+
@media (max-width: 576px) {
|
| 380 |
+
.fixed-top-bar {
|
| 381 |
+
height: 60px;
|
| 382 |
+
padding: 10px;
|
| 383 |
+
}
|
| 384 |
+
.search-bar-container {
|
| 385 |
+
width: 80%;
|
| 386 |
+
max-width: 100%;
|
| 387 |
+
}
|
| 388 |
+
.search-bar-container input {
|
| 389 |
+
padding: 6px 12px 6px 35px;
|
| 390 |
+
font-size: 14px;
|
| 391 |
+
border-radius: 20px;
|
| 392 |
+
}
|
| 393 |
+
.search-icon {
|
| 394 |
+
left: 12px;
|
| 395 |
+
font-size: 16px;
|
| 396 |
+
}
|
| 397 |
+
.avatar-dropdown-container {
|
| 398 |
+
right: 10px;
|
| 399 |
+
}
|
| 400 |
+
.avatar-icon {
|
| 401 |
+
width: 35px;
|
| 402 |
+
height: 35px;
|
| 403 |
+
font-size: 18px;
|
| 404 |
+
}
|
| 405 |
+
.category-buttons {
|
| 406 |
+
gap: 8px;
|
| 407 |
+
}
|
| 408 |
+
.category-button {
|
| 409 |
+
padding: 4px 12px;
|
| 410 |
+
font-size: 0.85rem;
|
| 411 |
+
}
|
| 412 |
+
.modal-dialog {
|
| 413 |
+
max-width: 98%;
|
| 414 |
+
}
|
| 415 |
+
.modal-footer .btn {
|
| 416 |
+
height: 35px;
|
| 417 |
+
padding: 0 12px;
|
| 418 |
+
}
|
| 419 |
+
.modal-footer .form-control {
|
| 420 |
+
width: 40px;
|
| 421 |
+
height: 35px;
|
| 422 |
+
}
|
| 423 |
+
}
|
| 424 |
</style>
|
| 425 |
</head>
|
| 426 |
<body>
|
|
|
|
| 442 |
</div>
|
| 443 |
</div>
|
| 444 |
|
|
|
|
| 445 |
<form method="get" action="/menu" class="text-center mb-4" id="categoryForm">
|
| 446 |
<label class="form-label fw-bold">Select a Category:</label>
|
| 447 |
<div class="category-buttons">
|
|
|
|
| 450 |
{% endfor %}
|
| 451 |
<button type="button" class="category-button {% if selected_category == 'Customized Dish' %}selected{% endif %}" data-category="Customized Dish">Customized Dish</button>
|
| 452 |
</div>
|
|
|
|
| 453 |
<input type="hidden" name="category" id="selectedCategoryInput" value="{{ selected_category }}">
|
| 454 |
</form>
|
| 455 |
|
|
|
|
| 751 |
const categoryForm = document.getElementById('categoryForm');
|
| 752 |
const selectedCategoryInput = document.getElementById('selectedCategoryInput');
|
| 753 |
|
|
|
|
| 754 |
if (!selectedCategoryInput.value) {
|
| 755 |
selectedCategoryInput.value = "All";
|
| 756 |
document.querySelector('.category-button[data-category="All"]').classList.add('selected');
|
|
|
|
| 758 |
|
| 759 |
categoryButtons.forEach(button => {
|
| 760 |
button.addEventListener('click', function () {
|
|
|
|
| 761 |
categoryButtons.forEach(btn => btn.classList.remove('selected'));
|
|
|
|
| 762 |
this.classList.add('selected');
|
|
|
|
| 763 |
selectedCategoryInput.value = this.getAttribute('data-category');
|
|
|
|
| 764 |
categoryForm.submit();
|
| 765 |
});
|
| 766 |
});
|
|
|
|
| 1122 |
document.body.appendChild(successNotification);
|
| 1123 |
setTimeout(() => {
|
| 1124 |
successNotification.remove();
|
| 1125 |
+
}, \x2000);
|
| 1126 |
}
|
| 1127 |
|
| 1128 |
document.addEventListener('DOMContentLoaded', function () {
|