nagasurendra commited on
Commit
f070a0e
·
verified ·
1 Parent(s): 19c968c

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +8 -0
templates/index.html CHANGED
@@ -437,18 +437,23 @@
437
  let options = [];
438
 
439
  if (conversation.length === 2) { // After name input
 
440
  botResponse = `Nice to meet you, ${userInput}! 😊 Let's create your perfect meal! What type of food would you prefer?`;
441
  options = [
442
  { text: 'Vegetarian', class: 'green' },
443
  { text: 'Non-Vegetarian', class: 'red' }
444
  ];
445
  } else if (lastMessage.includes('non-vegetarian')) {
 
 
446
  conversation.push({ role: 'user', message: 'Non-Vegetarian' });
447
  console.log("Food preference selected: Non-Vegetarian");
448
  botResponse = 'Great choice! 🍽️ Please select a non-vegetarian option:';
449
  fetchIngredients('non-vegetarian');
450
  return;
451
  } else if (lastMessage.includes('vegetarian')) {
 
 
452
  conversation.push({ role: 'user', message: 'Vegetarian' });
453
  console.log("Food preference selected: Vegetarian");
454
  botResponse = 'Great choice! 🍽️ Here are some vegetarian ingredients:';
@@ -731,6 +736,7 @@
731
  } else {
732
  const menuItems = data.menu_items || [];
733
  addMessage('bot', 'Here are some dishes based on your selection:');
 
734
  displayMenuItems(menuItems);
735
  }
736
  })
@@ -811,6 +817,8 @@
811
  { text: 'Yes', class: 'green' },
812
  { text: 'No', class: 'red' }
813
  ];
 
 
814
  displayOptions(options);
815
  };
816
  menuItem.appendChild(img);
 
437
  let options = [];
438
 
439
  if (conversation.length === 2) { // After name input
440
+ currentStep = 'food_type';
441
  botResponse = `Nice to meet you, ${userInput}! 😊 Let's create your perfect meal! What type of food would you prefer?`;
442
  options = [
443
  { text: 'Vegetarian', class: 'green' },
444
  { text: 'Non-Vegetarian', class: 'red' }
445
  ];
446
  } else if (lastMessage.includes('non-vegetarian')) {
447
+ currentStep = 'select_ingredients';
448
+
449
  conversation.push({ role: 'user', message: 'Non-Vegetarian' });
450
  console.log("Food preference selected: Non-Vegetarian");
451
  botResponse = 'Great choice! 🍽️ Please select a non-vegetarian option:';
452
  fetchIngredients('non-vegetarian');
453
  return;
454
  } else if (lastMessage.includes('vegetarian')) {
455
+ currentStep = 'select_ingredients';
456
+
457
  conversation.push({ role: 'user', message: 'Vegetarian' });
458
  console.log("Food preference selected: Vegetarian");
459
  botResponse = 'Great choice! 🍽️ Here are some vegetarian ingredients:';
 
736
  } else {
737
  const menuItems = data.menu_items || [];
738
  addMessage('bot', 'Here are some dishes based on your selection:');
739
+ currentStep = 'menu_display';
740
  displayMenuItems(menuItems);
741
  }
742
  })
 
817
  { text: 'Yes', class: 'green' },
818
  { text: 'No', class: 'red' }
819
  ];
820
+ currentStep = 'customization';
821
+
822
  displayOptions(options);
823
  };
824
  menuItem.appendChild(img);