Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -111,6 +111,43 @@ def check_confirmation(request: gr.Request):
|
|
| 111 |
except: return ""
|
| 112 |
return ""
|
| 113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
# --- 7. 介面佈局 (完整版) ---
|
| 115 |
with gr.Blocks(theme=theme, css=custom_css, title="Booking") as demo:
|
| 116 |
|
|
@@ -123,7 +160,7 @@ with gr.Blocks(theme=theme, css=custom_css, title="Booking") as demo:
|
|
| 123 |
with gr.Row():
|
| 124 |
with gr.Column():
|
| 125 |
gr.Markdown("### 📅 預約資訊 Booking Info")
|
| 126 |
-
|
| 127 |
date_options = get_date_options()
|
| 128 |
booking_date = gr.Dropdown(choices=date_options, label="選擇日期 Select Date", interactive=True)
|
| 129 |
pax_count = gr.Slider(minimum=1, maximum=10, value=2, step=1, label="用餐人數 Guest Count")
|
|
@@ -150,7 +187,7 @@ with gr.Blocks(theme=theme, css=custom_css, title="Booking") as demo:
|
|
| 150 |
|
| 151 |
submit_btn = gr.Button("確認預約 Request Booking (系統會記錄是否曾 No Show)", size="lg", variant="primary")
|
| 152 |
output_msg = gr.HTML()
|
| 153 |
-
|
| 154 |
# 頁尾警語
|
| 155 |
gr.HTML("""
|
| 156 |
<div class="legal-footer">
|
|
|
|
| 111 |
except: return ""
|
| 112 |
return ""
|
| 113 |
|
| 114 |
+
# --- 6. 介面設定 (Theme & CSS) ---
|
| 115 |
+
theme = gr.themes.Soft(
|
| 116 |
+
primary_hue="amber",
|
| 117 |
+
neutral_hue="zinc",
|
| 118 |
+
font=[gr.themes.GoogleFont("Playfair Display"), "ui-sans-serif", "sans-serif"],
|
| 119 |
+
).set(
|
| 120 |
+
body_background_fill="#0F0F0F",
|
| 121 |
+
block_background_fill="#1a1a1a",
|
| 122 |
+
block_border_width="1px",
|
| 123 |
+
block_border_color="#333",
|
| 124 |
+
input_background_fill="#262626",
|
| 125 |
+
input_border_color="#444",
|
| 126 |
+
body_text_color="#E0E0E0",
|
| 127 |
+
block_title_text_color="#d4af37",
|
| 128 |
+
button_primary_background_fill="#d4af37",
|
| 129 |
+
button_primary_text_color="#000000",
|
| 130 |
+
)
|
| 131 |
+
|
| 132 |
+
custom_css = """
|
| 133 |
+
footer {display: none !important;}
|
| 134 |
+
.gradio-container, .block, .row, .column { overflow: visible !important; }
|
| 135 |
+
.options, .wrap .options {
|
| 136 |
+
background-color: #262626 !important;
|
| 137 |
+
border: 1px solid #d4af37 !important;
|
| 138 |
+
z-index: 10000 !important;
|
| 139 |
+
box-shadow: 0 5px 15px rgba(0,0,0,0.5);
|
| 140 |
+
}
|
| 141 |
+
.item, .options .item { color: #E0E0E0 !important; padding: 8px 12px !important; }
|
| 142 |
+
.item:hover, .item.selected, .options .item:hover { background-color: #d4af37 !important; color: black !important; }
|
| 143 |
+
input:focus, .dropdown-trigger:focus-within { border-color: #d4af37 !important; box-shadow: 0 0 8px rgba(212, 175, 55, 0.4) !important; }
|
| 144 |
+
h3 { border-bottom: 1px solid #444; padding-bottom: 5px; margin-bottom: 10px; }
|
| 145 |
+
.legal-footer {
|
| 146 |
+
text-align: center; margin-top: 15px; padding-top: 15px; border-top: 1px solid #333; color: #666; font-size: 0.75rem; line-height: 1.5; font-family: sans-serif;
|
| 147 |
+
}
|
| 148 |
+
.legal-footer strong { color: #888; }
|
| 149 |
+
"""
|
| 150 |
+
|
| 151 |
# --- 7. 介面佈局 (完整版) ---
|
| 152 |
with gr.Blocks(theme=theme, css=custom_css, title="Booking") as demo:
|
| 153 |
|
|
|
|
| 160 |
with gr.Row():
|
| 161 |
with gr.Column():
|
| 162 |
gr.Markdown("### 📅 預約資訊 Booking Info")
|
| 163 |
+
|
| 164 |
date_options = get_date_options()
|
| 165 |
booking_date = gr.Dropdown(choices=date_options, label="選擇日期 Select Date", interactive=True)
|
| 166 |
pax_count = gr.Slider(minimum=1, maximum=10, value=2, step=1, label="用餐人數 Guest Count")
|
|
|
|
| 187 |
|
| 188 |
submit_btn = gr.Button("確認預約 Request Booking (系統會記錄是否曾 No Show)", size="lg", variant="primary")
|
| 189 |
output_msg = gr.HTML()
|
| 190 |
+
|
| 191 |
# 頁尾警語
|
| 192 |
gr.HTML("""
|
| 193 |
<div class="legal-footer">
|