diff --git "a/templates/menu.html" "b/templates/menu.html" --- "a/templates/menu.html" +++ "b/templates/menu.html" @@ -39,7 +39,6 @@ transition: opacity 0.3s ease-in-out; box-shadow: 0 4px 8px rgba(0,0,0,0.1); } - .menu-card.visible { opacity: 1; } @@ -60,12 +59,11 @@ opacity: 1; } .menu-card img { - width: 100%; /* Ensure image takes up full width */ - height: 200px; /* Set fixed height */ - object-fit: cover; /* Ensure the image fills the container without distortion */ - object-position: center; /* Center the image within the container */ + width: 100%; + height: 200px; + object-fit: cover; + object-position: center; } - .menu-card:hover .menu-video { opacity: 1; transform: scale(1.05); @@ -506,26 +504,23 @@ #filter-form { display: flex; flex-direction: column; - align-items: flex-start; /* Align to the left */ - justify-content: flex-start; /* Align to the top */ + align-items: flex-start; + justify-content: flex-start; margin-bottom: 20px; - margin-left: 10px; /* Added 10px gap to the left */ + margin-left: 10px; } - .form-label { font-size: 1.2rem; font-weight: 600; color: #333; margin-bottom: 10px; } - .toggle-container { display: flex; align-items: center; gap: 10px; margin: 8px 0; } - .custom-toggle { appearance: none; width: 48px; @@ -536,11 +531,9 @@ cursor: pointer; transition: background-color 0.3s ease; } - .custom-toggle:checked { - background: linear-gradient(45deg, #32CD32, #3CB371); /* Changed to green color when checked */ + background: linear-gradient(45deg, #32CD32, #3CB371); } - .custom-toggle::before { content: ''; position: absolute; @@ -553,17 +546,14 @@ transition: transform 0.3s ease; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); } - .custom-toggle:checked::before { - transform: translateX(24px); /* Moves the toggle to the right */ + transform: translateX(24px); } - .toggle-container label { font-size: 1rem; color: #333; cursor: pointer; } - @keyframes checkmark { from { transform: scale(0); } to { transform: scale(1); } @@ -1088,7 +1078,7 @@ font-size: 0.9rem; } } - .chat-container { + .chat-container { box-sizing: border-box; margin: 0; padding: 0; @@ -1174,8 +1164,8 @@ } .ingredients-list, .menu-items-list, .customization-ingredients-list { display: flex; - flex-wrap: nowrap; /* Ensure items stay in a single row */ - overflow-x: auto; /* Allow horizontal scrolling */ + flex-wrap: nowrap; + overflow-x: auto; padding: 10px; margin: 10px 0; background-color: #f5f7fa; @@ -1184,8 +1174,8 @@ scroll-behavior: smooth; } .ingredient-item, .menu-item { - flex: 0 0 auto; /* Ensure items don't stretch */ - width: 200px; /* Set a fixed width for each item */ + flex: 0 0 auto; + width: 200px; background-color: #ffffff; border: 1px solid #e0e0e0; border-radius: 10px; @@ -1351,11 +1341,11 @@ padding: 8px 15px; } .ingredients-list, .menu-items-list, .customization-ingredients-list { - flex-direction: row; /* Keep the items in a row on mobile */ + flex-direction: row; gap: 10px; } .ingredient-item, .menu-item { - flex: 0 0 150px; /* Adjust the item width to fit smaller screens */ + flex: 0 0 150px; } .ingredient-item img, .menu-item img { height: 100px; @@ -1402,6 +1392,112 @@ height: 110px; } } + /* Mic Modal Styling */ + #micModal .modal-dialog { + max-width: 300px; + margin: 1.75rem auto; + } + #micModal .modal-content { + border-radius: 12px; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); + background-color: #fff; + text-align: center; + } + #micModal .modal-header { + background: linear-gradient(45deg, #FFA07A, #FFB347); + border-top-left-radius: 12px; + border-top-right-radius: 12px; + padding: 12px 15px; + border-bottom: none; + } + #micModal .modal-title { + font-size: 1.3rem; + font-weight: 600; + color: #fff; + margin: 0 auto; + } + #micModal .modal-body { + padding: 20px; + display: flex; + flex-direction: column; + align-items: center; + gap: 15px; + min-height: 200px; + } + #micModal .modal-body i#mic-icon-animation { + font-size: 2.5rem; + color: #007bff; + animation: pulse 2s infinite; + } + #micModal .modal-body p#mic-status { + font-size: 1.1rem; + color: #333; + margin: 0; + transition: opacity 0.3s ease; + } + #micModal .modal-body #mic-item-image { + max-height: 100px; + width: 100%; + object-fit: cover; + border-radius: 8px; + margin-bottom: 10px; + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); + transition: opacity 0.3s ease; + } + #micModal .modal-body #mic-item-name { + font-size: 1.2rem; + font-weight: 600; + color: #333333; + margin-bottom: 10px; + transition: opacity 0.3s ease; + } + #micModal .modal-body #mic-item-details.show { + animation: fadeIn 0.3s ease; + } + #micModal .modal-footer { + padding: 15px; + border-top: none; + justify-content: center; + } + #micModal .modal-footer .btn-secondary { + background-color: #6c757d; + border-color: #6c757d; + padding: 10px 20px; + font-size: 1rem; + border-radius: 8px; + } + #micModal .modal-footer .btn-secondary:hover { + background-color: #5a6268; + border-color: #5a6268; + } + @keyframes pulse { + 0% { transform: scale(1); } + 50% { transform: scale(1.2); } + 100% { transform: scale(1); } + } + @media (max-width: 576px) { + #micModal .modal-dialog { + max-width: 90%; + } + #micModal .modal-body i { + font-size: 2rem; + } + #micModal .modal-body p { + font-size: 1rem; + } + #micModal .modal-body img { + max-height: 80px; + margin-bottom: 8px; + } + #micModal .modal-body h5 { + font-size: 1rem; + margin-bottom: 8px; + } + #micModal .modal-footer .btn-secondary { + padding: 8px 15px; + font-size: 0.9rem; + } + } @@ -1424,7 +1520,7 @@ -
+
@@ -1444,20 +1540,19 @@
-
{% if selected_category == "Customized Dish" %}
-
-
🍳 Chef Bot
-
- -
-
- - -
-
+
+
🍳 Chef Bot
+
+ +
+
+ + +
+
{% else %} {% if ordered_menu.items()|length == 0 %} @@ -1599,1197 +1694,748 @@
- +
+ + + + + + - + + + - - + function selectCustomizationIngredient(ingredient) { + if (!selectedCustomizationIngredients.includes(ingredient)) { + selectedCustomizationIngredients.push(ingredient); + appendMessage('bot', `Added ${ingredient} to your customization. Anything else?`); + displaySelectedCustomizationIngredients(); + updateSession(); + } + } + function displaySelectedCustomizationIngredients() { + const existingSelected = chatMessages.querySelector('.selected-customization-ingredients'); + if (existingSelected) existingSelected.remove(); + if (selectedCustomizationIngredients.length > 0) { + const selectedContainer = document.createElement('div'); + selectedContainer.className = 'selected-customization-ingredients'; + selectedContainer.innerHTML = 'Selected Customization Ingredients:'; + selectedCustomizationIngredients.forEach(ingredient => { + const ingredientDiv = document.createElement('div'); + ingredientDiv.textContent = ingredient; + selectedContainer.appendChild(ingredientDiv); + }); + chatMessages.appendChild(selectedContainer); + chatMessages.scrollTop = chatMessages.scrollHeight; + } + } + function updateSession() { + fetch('/update_session', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + conversation_state: conversationState, + user_name: userName, + selected_ingredients: selectedIngredients, + selected_customization_ingredients: selectedCustomizationIngredients, + customization_text: customizationText + }) + }) + .catch(error => console.error('Error updating session:', error)); + } + function submitCustomDish() { + const customDish = { + name: `Custom Dish by ${userName}`, + price: 10.00, + quantity: 1, + section: 'Customized Dish', + category: 'Customized Dish', + addons: selectedCustomizationIngredients.map(ingredient => ({ + name: 'Customization', + value: ingredient, + extra_charge: 0 + })), + instructions: customizationText + }; + fetch('/add_to_cart', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(customDish) + }) + .then(response => response.json()) + .then(data => { + if (data.success) { + updateCartItemCount(data.cart_item_count); + } else { + alert('Error adding custom dish to cart: ' + data.message); + } + }) + .catch(error => { + console.error('Error adding custom dish to cart:', error); + alert('Error adding custom dish to cart.'); + }); + } + // Initialize chat based on session state + if (conversationState === 'greeting') { + appendMessage('bot', `Hello! I'm your Chef Bot. What's your name?`); + } else if (conversationState === 'select_ingredients') { + appendMessage('bot', `Welcome back, ${userName}! What's the base ingredient you'd like to start with?`); + displayIngredients(); + } else if (conversationState === 'customization') { + appendMessage('bot', `Great! How would you like to customize your dish?`); + } else if (conversationState === 'select_customization_ingredients') { + appendMessage('bot', `What ingredients would you like to add for customization?`); + displayCustomizationIngredients(); + } else if (conversationState === 'confirm') { + appendMessage('bot', `Your dish is ready! Ingredients: ${selectedIngredients.join(', ')}. Customization: ${customizationText}. Confirm? (Type 'yes' or 'no')`); + } else if (conversationState === 'modify') { + appendMessage('bot', `Want to modify your dish or start over? Type 'modify' or 'start over'.`); + } + {% endif %} + + + \ No newline at end of file