Spaces:
Runtime error
Runtime error
File size: 7,712 Bytes
ba25022 f3ff917 5932338 ba25022 7a3c4c9 8eaa4f5 ba25022 8a7aeb9 54adca8 fc83f42 7a3c4c9 4a06139 f3ff917 ba25022 f3ff917 7a3c4c9 fc83f42 7a3c4c9 4a06139 7a3c4c9 ba25022 f3ff917 7a3c4c9 fc83f42 7a3c4c9 4a06139 f3ff917 ba25022 f3ff917 7a3c4c9 fc83f42 7a3c4c9 4a06139 f3ff917 ba25022 f3ff917 7a3c4c9 fc83f42 7a3c4c9 4a06139 f3ff917 7a3c4c9 ba25022 f3ff917 7a3c4c9 fc83f42 7a3c4c9 4a06139 f3ff917 ba25022 f3ff917 7a3c4c9 fc83f42 7a3c4c9 4a06139 f3ff917 ba25022 f3ff917 7a3c4c9 fc83f42 7a3c4c9 4a06139 f3ff917 ba25022 f3ff917 7a3c4c9 fc83f42 7a3c4c9 4a06139 f3ff917 ba25022 f3ff917 fc83f42 4a06139 f3ff917 7a3c4c9 ba25022 f3ff917 fc83f42 4a06139 7a3c4c9 ba25022 f3ff917 fc83f42 4a06139 fc83f42 7a3c4c9 f3ff917 fc83f42 4a06139 f3ff917 ba25022 a126579 fc83f42 4a06139 f3ff917 ba25022 f3ff917 fc83f42 4a06139 f3ff917 ba25022 7a3c4c9 ba25022 8eaa4f5 a2f633d ea998af 82c776e 2fa6853 ea998af 2fa6853 a2f633d 2fa6853 a2f633d 2fa6853 1db26c9 b138bbc ea998af 2fa6853 e902249 b286e06 2fa6853 a2f633d 2fa6853 b286e06 ea998af | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | import gradio as gr
import re # For regex operations
from functools import partial
import pandas as pd
# The menu definition with corrected commas and extras.
menu = {
"Starters": [
{
"name": "A111 - Summer Rolls (Vegan)",
"description": (
"Rice paper, fresh carrots, cucumbers, with mint, cilantro rolled with rice noodles and tofu."
" Served with Hoisin and peanut butter sauce."
),
"price": "💰5.50 €/ 2 rolls",
"image": "https://i.pinimg.com/736x/4f/98/cc/4f98cc73eb9574447adafa4473465bcd.jpg",
},
{
"name": "A2 - Papaya Salad (Vegan)",
"description": (
"Green papaya salad mixed with crunchy raw veggies, roasted peanuts, fried shallots "
"and tossed with a bright and citrusy lime dressing."
),
"price": "💰8.90 €",
"image": "https://product.hstatic.net/200000294248/product/xoai_du_du_tom_kho_9db38fcb08024d3ebb4933a92a8e7728_1024x1024.jpg",
},
{
"name": "A3 - Pork & Shrimp Summer Rolls",
"description": (
"Rice paper wrappers, rice vermicelli noodles, cooked pork and shrimp, rolled with fresh "
"lettuce, mint, cilantro, and cucumbers. Served with Hoisin peanut sauce or fish sauce."
),
"price": "💰7.50 €/ 3 rolls",
"image": "https://cdn.netspace.edu.vn/images/2020/04/25/cach-lam-goi-cuon-tom-thit-cuc-ki-hap-dan-245587-800.jpg",
},
{
"name": "A4 - Chicken Spring Rolls",
"description": (
"Vietnamese deep-fried spring roll filled with ground chicken, vermicelli noodles, and "
"minced wood ear mushroom. Served with fish sauce"
),
"price": "💰6.50 €/ 3 sticks",
"image": "https://i-giadinh.vnecdn.net/2024/12/05/Thnhphm11-1733391139-5608-1733391142.jpg",
},
{
"name": "A5 - Rare Beef Salad",
"description": (
"Vietnamese rare beef salad - typically features thinly sliced rare beef, mixed with fish "
"sauce, lime juice, sugar, and a variety of fresh herbs, vegetables, spices and served "
"together with prawn crackers."
),
"price": "💰10.50 €",
"image": "https://i.ytimg.com/vi/KWpZc0f9smI/maxresdefault.jpg",
},
],
"Main Courses": [
{
"name": "B1 - Bun Tron Chay Tofu (Vegan)",
"description": (
"Pan-fried Tofu with lemongrass, leeks, and bean sprouts on lukewarm rice noodles, "
"served with fresh herbs and sweet and sour fish sauce"
),
"price": "💰13.90 €",
"image": "https://img-global.cpcdn.com/recipes/e7b6be2dd3c9aa41/680x781cq80/bun-g%E1%BA%A1o-l%E1%BB%A9t-tr%E1%BB%99n-chay-recipe-main-photo.jpg",
},
{
"name": "B2 - Bun Dau (Vegan)",
"description": (
"Rice vermicelli, served with deep-fried tofu, fresh herbs, cucumber, fried vegan "
"spring rolls, dipped with vegan fish sauce, chili, and lime juice."
),
"price": "💰13.90 €",
"image": "https://i.ytimg.com/vi/TJJ6aHIXoT8/hq720.jpg?sqp=-oaymwEhCK4FEIIDSFryq4qpAxMIARUAAAAAGAElAADIQj0AgKJD&rs=AOn4CLCx4BA_0ht5p02grA8ieWohFiBByQ",
},
{
"name": "B3 - Bun Cha Ha Noi",
"description": (
"Northern Vietnamese dish features charred pork patties and pork belly slices bathed in "
"a steaming dipping sauce served alongside tender rice noodles, fresh herbs, and "
"crunchy pickles."
),
"price": "💰15.90 €",
"image": "https://daiductai.vn/upload/filemanager/B%C3%BAn%20ch%E1%BA%A3/bun-cha.jpg",
},
{
"name": "B4 - Hoi An Chicken Rice",
"description": (
"Free-range chicken, jasmine rice, fresh herbs, crispy fried shallots, chili satay. "
"Served with shredded green papaya, carrots, daikon, and Vietnamese mint, accompanied "
"by a sweet and sour fish sauce and a side bowl of chicken broth."
),
"price": "💰14.90 €",
"image": "https://i-giadinh.vnecdn.net/2023/04/22/Buoc-11-thanh-pham-1-11-9981-1682135995.jpg",
},
{
"name": "B5 - Pho Bo",
"description": "Rice noodles in beef broth with rare beef and herbs on top.",
"price": "💰15.90 €",
"image": "https://phothaihung.com/wp-content/uploads/2023/11/pho-nha-lam.jpg",
},
],
"Coffee & tea": [
{
"name": "C1 - Peach & Orange Lemongrass Iced Tea",
"description": "",
"price": "💰5.50 €",
"image": "https://data.thefeedfeed.com/static/2019/09/10/15681428875d77f627a3522.jpg",
},
{
"name": "C2 - Jasmine Lime-Lychee Iced Tea",
"description": "",
"price": "💰5.50 €",
"image": "https://goodfoodbaddie.com/wp-content/uploads/2023/06/lychee-iced-tea.jpg",
},
{
"name": "C3 - Ice Vietnamese Coffee With Condensed Milk",
"description": "",
"price": "💰5.90 €",
"image": "https://www.pho9co.com/wp-content/uploads/2024/01/vietnamese-condensed-milk-1024x800.jpg",
},
{
"name": "C4 - Cola/Cola Zero/Fanta/Sprite or Mineral Water/Sparking Water (0.2L)",
"description": "",
"price": "💰2.50 €",
"image": "https://burgernj.com/wp-content/uploads/2021/05/Soft-Drinks_result.jpg",
},
{
"name": "C5 - Gaffel Kölnsch (0.33L)",
"description": "",
"price": "💰2.60 €",
"image": "https://beertasting.app/storage/media/1ad9abc052554acb358f99be359a05ec/b3zjsb81ofhgioz7mnaa.jpeg",
},
],
}
# 强制 Tabs 横向滚动不换行的 CSS
css = """
<style>
footer, .svelte-1ipelgc { display: none !important; }
.tabs.svelte-1ipelgc {
flex-wrap: nowrap !important;
overflow-x: auto !important;
white-space: nowrap !important;
}
.tabitem.svelte-1ipelgc {
font-size: 15px !important;
flex: 0 0 auto !important;
padding: 8px 16px !important;
}
</style>
"""
with gr.Blocks() as demo:
gr.Markdown("# 🍜🥢 EAT EAT Cafe & Bistro")
gr.HTML(css)
gr.Markdown(
"Your task: One starter containing mushroom, One main course containing beef; One drink that is the cheapest on the menu."
)
with gr.Tabs():
for category, items in menu.items():
with gr.TabItem(category):
for item in items:
with gr.Row():
with gr.Column(scale=1):
gr.HTML(
f"<img src='{item.get('image', '')}' style='height:90px;width:120px;border-radius:8px;'/>"
)
with gr.Column(scale=4):
name = item["name"]
desc = item["description"]
price = item["price"]
gr.Markdown(
f"**{name}**\n\n{desc}\n\n<span style='color:green;font-weight:bold'>{price}</span>",
show_label=False,
)
if __name__ == "__main__":
demo.launch() |