import gradio as gr # Step 1: Define food items food_items = [ { "name": "Samosa", "price": "$10", "description": "Crispy fried pastry filled with spiced potatoes and peas. Serves 1. [Energy: 200 kcal, Protein: 5g, Carbohydrates: 25g, Fiber: 3g, Fat: 10g, Sugar: 1g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/Potato-Samosa.jpg" }, { "name": "Onion Pakoda", "price": "$14", "description": "Deep-fried onion fritters seasoned with herbs and spices. Serves 2. [Energy: 250 kcal, Protein: 6g, Carbohydrates: 30g, Fiber: 4g, Fat: 12g, Sugar: 2g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/onion-pakoda.jpg" }, { "name": "Paneer Tikka", "price": "$15", "description": "Grilled paneer cubes marinated in spices. Serves 1. [Energy: 300 kcal, Protein: 15g, Carbohydrates: 10g, Fiber: 2g, Fat: 20g, Sugar: 1g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/paneer-tikka.jpg" }, { "name": "Veg Biryani", "price": "$12", "description": "Aromatic rice cooked with vegetables and spices. Serves 1. [Energy: 350 kcal, Protein: 8g, Carbohydrates: 50g, Fiber: 5g, Fat: 12g, Sugar: 2g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/veg-biryani.jpg" }, { "name": "Chicken Curry", "price": "$16", "description": "Tender chicken pieces cooked in a spicy curry. Serves 1. [Energy: 400 kcal, Protein: 25g, Carbohydrates: 10g, Fiber: 2g, Fat: 25g, Sugar: 3g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/chicken-curry.jpg" }, { "name": "Masala Dosa", "price": "$10", "description": "Thin rice crepe stuffed with spiced potato filling. Serves 1. [Energy: 300 kcal, Protein: 6g, Carbohydrates: 45g, Fiber: 4g, Fat: 8g, Sugar: 1g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/masala-dosa.jpg" }, { "name": "Idli", "price": "$8", "description": "Steamed rice cakes served with chutney and sambar. Serves 2. [Energy: 200 kcal, Protein: 4g, Carbohydrates: 40g, Fiber: 3g, Fat: 1g, Sugar: 1g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/idli.jpg" }, { "name": "Medu Vada", "price": "$9", "description": "Crispy fried lentil donuts served with chutney. Serves 2. [Energy: 250 kcal, Protein: 7g, Carbohydrates: 30g, Fiber: 4g, Fat: 10g, Sugar: 1g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/medu-vada.jpg" }, { "name": "Pav Bhaji", "price": "$12", "description": "Spicy mashed vegetables served with buttered bread. Serves 1. [Energy: 400 kcal, Protein: 10g, Carbohydrates: 50g, Fiber: 6g, Fat: 15g, Sugar: 4g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/pav-bhaji.jpg" }, { "name": "Chole Bhature", "price": "$14", "description": "Spicy chickpea curry served with deep-fried bread. Serves 1. [Energy: 500 kcal, Protein: 15g, Carbohydrates: 60g, Fiber: 7g, Fat: 20g, Sugar: 3g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/chole-bhature.jpg" }, { "name": "Dal Tadka", "price": "$11", "description": "Yellow lentils cooked with spices and tempered with ghee. Serves 1. [Energy: 300 kcal, Protein: 10g, Carbohydrates: 30g, Fiber: 6g, Fat: 12g, Sugar: 2g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/dal-tadka.jpg" }, { "name": "Butter Chicken", "price": "$18", "description": "Creamy chicken curry made with butter and spices. Serves 1. [Energy: 450 kcal, Protein: 28g, Carbohydrates: 10g, Fiber: 2g, Fat: 30g, Sugar: 4g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/butter-chicken.jpg" }, { "name": "Tandoori Roti", "price": "$5", "description": "Whole wheat flatbread cooked in a tandoor. Serves 1. [Energy: 150 kcal, Protein: 4g, Carbohydrates: 25g, Fiber: 3g, Fat: 2g, Sugar: 1g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/tandoori-roti.jpg" }, { "name": "Garlic Naan", "price": "$7", "description": "Leavened flatbread topped with garlic and butter. Serves 1. [Energy: 200 kcal, Protein: 5g, Carbohydrates: 30g, Fiber: 2g, Fat: 5g, Sugar: 1g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/garlic-naan.jpg" }, { "name": "Matar Paneer", "price": "$13", "description": "Cottage cheese and peas cooked in a tomato-based gravy. Serves 1. [Energy: 350 kcal, Protein: 12g, Carbohydrates: 20g, Fiber: 4g, Fat: 25g, Sugar: 3g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/matar-paneer.jpg" }, { "name": "Aloo Paratha", "price": "$10", "description": "Stuffed flatbread with spiced potato filling. Serves 1. [Energy: 300 kcal, Protein: 7g, Carbohydrates: 45g, Fiber: 5g, Fat: 10g, Sugar: 1g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/aloo-paratha.jpg" }, { "name": "Rasgulla", "price": "$6", "description": "Soft and spongy cheese balls soaked in sugar syrup. Serves 1. [Energy: 150 kcal, Protein: 3g, Carbohydrates: 30g, Fiber: 0g, Fat: 2g, Sugar: 25g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/rasgulla.jpg" }, { "name": "Gulab Jamun", "price": "$7", "description": "Deep-fried dough balls soaked in sugar syrup. Serves 1. [Energy: 180 kcal, Protein: 2g, Carbohydrates: 35g, Fiber: 0g, Fat: 5g, Sugar: 30g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/gulab-jamun.jpg" }, { "name": "Kheer", "price": "$8", "description": "Creamy rice pudding flavored with cardamom and nuts. Serves 1. [Energy: 200 kcal, Protein: 4g, Carbohydrates: 30g, Fiber: 1g, Fat: 8g, Sugar: 20g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/kheer.jpg" }, { "name": "Mango Lassi", "price": "$5", "description": "Refreshing yogurt-based mango drink. Serves 1. [Energy: 150 kcal, Protein: 5g, Carbohydrates: 25g, Fiber: 1g, Fat: 3g, Sugar: 20g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/mango-lassi.jpg" }, { "name": "Masala Chai", "price": "$4", "description": "Spiced Indian tea made with milk and spices. Serves 1. [Energy: 100 kcal, Protein: 2g, Carbohydrates: 15g, Fiber: 0g, Fat: 3g, Sugar: 10g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/masala-chai.jpg" }, { "name": "Pani Puri", "price": "$8", "description": "Crispy hollow puris filled with tangy flavored water. Serves 1. [Energy: 150 kcal, Protein: 4g, Carbohydrates: 20g, Fiber: 2g, Fat: 5g, Sugar: 2g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/pani-puri.jpg" }, { "name": "Sev Puri", "price": "$9", "description": "Crispy puris topped with chutneys, onions, and sev. Serves 1. [Energy: 180 kcal, Protein: 5g, Carbohydrates: 25g, Fiber: 3g, Fat: 6g, Sugar: 3g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/sev-puri.jpg" }, { "name": "Dhokla", "price": "$7", "description": "Soft and spongy steamed savory cake made from fermented batter. Serves 1. [Energy: 120 kcal, Protein: 6g, Carbohydrates: 15g, Fiber: 2g, Fat: 4g, Sugar: 2g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/dhokla.jpg" }, { "name": "Bhindi Masala", "price": "$12", "description": "Spicy stir-fried okra with onions and tomatoes. Serves 1. [Energy: 200 kcal, Protein: 4g, Carbohydrates: 15g, Fiber: 4g, Fat: 12g, Sugar: 2g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/bhindi-masala.jpg" }, { "name": "Palak Paneer", "price": "$13", "description": "Cottage cheese cubes in a creamy spinach gravy. Serves 1. [Energy: 300 kcal, Protein: 10g, Carbohydrates: 15g, Fiber: 3g, Fat: 20g, Sugar: 2g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/palak-paneer.jpg" }, { "name": "Vegetable Pulao", "price": "$11", "description": "Fragrant rice cooked with mixed vegetables and spices. Serves 1. [Energy: 300 kcal, Protein: 6g, Carbohydrates: 50g, Fiber: 4g, Fat: 10g, Sugar: 2g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/vegetable-pulao.jpg" }, { "name": "Aloo Gobi", "price": "$10", "description": "Potatoes and cauliflower cooked with spices. Serves 1. [Energy: 250 kcal, Protein: 5g, Carbohydrates: 20g, Fiber: 5g, Fat: 15g, Sugar: 1g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/aloo-gobi.jpg" }, { "name": "Rajma", "price": "$12", "description": "Red kidney beans cooked in a flavorful tomato gravy. Serves 1. [Energy: 300 kcal, Protein: 10g, Carbohydrates: 40g, Fiber: 7g, Fat: 8g, Sugar: 2g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/rajma.jpg" }, { "name": "Kachori", "price": "$7", "description": "Spiced lentil-filled crispy fried snack. Serves 1. [Energy: 200 kcal, Protein: 5g, Carbohydrates: 25g, Fiber: 3g, Fat: 10g, Sugar: 2g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/kachori.jpg" }, { "name": "Shahi Paneer", "price": "$14", "description": "Rich and creamy paneer curry with a royal taste. Serves 1. [Energy: 400 kcal, Protein: 12g, Carbohydrates: 15g, Fiber: 2g, Fat: 30g, Sugar: 3g]", "image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/shahi-paneer.jpg" } ] # Step 2: Generate HTML for food items def generate_food_menu(): html_content = "
" for item in food_items: html_content += f"""

{item['name']}

{item['price']}

{item['description']}

\"{item['name']}\"
""" html_content += "
" return html_content # Step 3: Add JavaScript for the pop-up popup_js = """ """ # Step 4: Build the Gradio Interface with gr.Blocks() as demo: with gr.Row(): gr.HTML(generate_food_menu()) # Render food menu gr.HTML("""
\"Food

Choose a spice level:

Required - Choose 1.

Biryani Extra's

Optional - Choose as many as you like.

Special instructions

Quantity

""") gr.HTML(popup_js) # Inject JavaScript demo.launch()