BrianChuan commited on
Commit ·
6c12d73
1
Parent(s): c0164b7
Style CSS update
Browse files- app.py +2 -4
- emotion.py +1 -31
app.py
CHANGED
|
@@ -185,11 +185,9 @@ def bridge_predict_frame(frame, st):
|
|
| 185 |
# ==========================================
|
| 186 |
# 4. Gradio 介面建構
|
| 187 |
# ==========================================
|
|
|
|
| 188 |
|
| 189 |
-
|
| 190 |
-
combined_css = emotion.css
|
| 191 |
-
|
| 192 |
-
with gr.Blocks(title="AI 心情食堂") as demo:
|
| 193 |
|
| 194 |
st_state = gr.State(emotion.AppState())
|
| 195 |
|
|
|
|
| 185 |
# ==========================================
|
| 186 |
# 4. Gradio 介面建構
|
| 187 |
# ==========================================
|
| 188 |
+
css_ = "#app_container { max-width: 960px; margin: 0 auto; }"
|
| 189 |
|
| 190 |
+
with gr.Blocks(title="AI 心情食堂", css=css_) as demo:
|
|
|
|
|
|
|
|
|
|
| 191 |
|
| 192 |
st_state = gr.State(emotion.AppState())
|
| 193 |
|
emotion.py
CHANGED
|
@@ -446,38 +446,8 @@ def on_stop(st: AppState):
|
|
| 446 |
|
| 447 |
|
| 448 |
# =========================
|
| 449 |
-
# Gradio UI
|
| 450 |
# =========================
|
| 451 |
-
css = """
|
| 452 |
-
/* 讓 App 容器置中且維持淺色背景 */
|
| 453 |
-
#app_container { max-width: 960px; margin: 0 auto; }
|
| 454 |
-
.gradio-container { background: #f1f5f9 !important; }
|
| 455 |
-
|
| 456 |
-
/* 1. 全域強制標題與文字為黑色 (針對 Markdown 生成的內容) */
|
| 457 |
-
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6,
|
| 458 |
-
.prose p, .prose strong, .prose em, .prose li {
|
| 459 |
-
color: #000000 !important;
|
| 460 |
-
}
|
| 461 |
-
|
| 462 |
-
/* 2. 針對 Tab 按鈕文字強制為黑色 */
|
| 463 |
-
.tab-nav button {
|
| 464 |
-
color: #000000 !important;
|
| 465 |
-
}
|
| 466 |
-
.tab-nav button.selected {
|
| 467 |
-
color: #000000 !important;
|
| 468 |
-
font-weight: bold; /* 選中時加粗 */
|
| 469 |
-
}
|
| 470 |
-
|
| 471 |
-
/* 3. 針對輸入元件的 Label (例如 Radio, Textbox 上方的文字) */
|
| 472 |
-
label span {
|
| 473 |
-
color: #000000 !important;
|
| 474 |
-
}
|
| 475 |
-
|
| 476 |
-
/* 4. 其他一般文字區塊 */
|
| 477 |
-
.markdown-text {
|
| 478 |
-
color: #000000 !important;
|
| 479 |
-
}
|
| 480 |
-
"""
|
| 481 |
|
| 482 |
if __name__ == "__main__":
|
| 483 |
with gr.Blocks(title="Emotion Detector", css=css) as demo:
|
|
|
|
| 446 |
|
| 447 |
|
| 448 |
# =========================
|
| 449 |
+
# Gradio UI
|
| 450 |
# =========================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 451 |
|
| 452 |
if __name__ == "__main__":
|
| 453 |
with gr.Blocks(title="Emotion Detector", css=css) as demo:
|