import gradio as gr import datetime # 自定義 CSS:打造高級黑金風格 custom_css = """ .gradio-container { background-color: #0c0c0c !important; color: #d4af37 !important; } .gr-button-primary { background: linear-gradient(45deg, #af8f2c, #d4af37) !important; border: none !important; color: black !important; font-weight: bold !important; } .gr-input, .gr-dropdown, .gr-number { background-color: #1a1a1a !important; border: 1px solid #333 !important; color: white !important; } h1 { font-family: 'Playfair Display', serif; letter-spacing: 2px; } .availability-box { padding: 10px; border: 1px solid #d4af37; border-radius: 5px; text-align: center; margin-bottom: 20px; } """ def get_available_slots(date_str): # 這裡未來會接 Supabase 查詢 # 範例邏輯:如果是假日就剩比較少位子 return [("18:00", "剩 4 位"), ("19:30", "剩 2 位"), ("21:00", "已客滿")] def handle_booking(name, tel, pax, date, time): if not name or not tel: return "⚠️ 請完整填寫姓名與聯絡電話。" # 這裡執行寫入 Supabase 的邏輯 return f"### 🥂 預約申請已提交!\n**{name}** 您好,我們已收到您的申請。請留意 Email 並於 24 小時內點擊「確認出席」以保留您的座位。" with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as demo: gr.HTML("""
品味精緻時光,期待您的蒞臨