DeepLearning101 commited on
Commit
2239e64
·
verified ·
1 Parent(s): 51f8064

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import gradio as gr
2
  from datetime import datetime, timedelta
3
 
4
- # --- 1. 主題配色 (保持黑金風格) ---
5
  theme = gr.themes.Soft(
6
  primary_hue="amber",
7
  neutral_hue="zinc",
@@ -17,9 +17,10 @@ theme = gr.themes.Soft(
17
  block_title_text_color="#d4af37",
18
  button_primary_background_fill="#d4af37",
19
  button_primary_text_color="#000000",
 
20
  )
21
 
22
- # --- 2. CSS 修復 (解決選單被擋住 + 樣式美化) ---
23
  custom_css = """
24
  /* 隱藏 footer */
25
  footer {display: none !important;}
@@ -29,19 +30,22 @@ footer {display: none !important;}
29
  overflow: visible !important;
30
  }
31
 
32
- /* 下拉選單樣式修正 */
33
- .options {
34
  background-color: #262626 !important;
35
  border: 1px solid #d4af37 !important;
36
  z-index: 10000 !important; /* 確保在最上層 */
37
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
38
  }
39
 
40
- .item {
 
41
  color: #E0E0E0 !important;
 
42
  }
43
 
44
- .item:hover, .item.selected {
 
45
  background-color: #d4af37 !important;
46
  color: black !important;
47
  }
 
1
  import gradio as gr
2
  from datetime import datetime, timedelta
3
 
4
+ # --- 1. 主題配色 (修復錯誤版) ---
5
  theme = gr.themes.Soft(
6
  primary_hue="amber",
7
  neutral_hue="zinc",
 
17
  block_title_text_color="#d4af37",
18
  button_primary_background_fill="#d4af37",
19
  button_primary_text_color="#000000",
20
+ # ⚠️ 已移除報錯的 table_row_focus_background_fill
21
  )
22
 
23
+ # --- 2. CSS 修復 (確保選單樣式正確) ---
24
  custom_css = """
25
  /* 隱藏 footer */
26
  footer {display: none !important;}
 
30
  overflow: visible !important;
31
  }
32
 
33
+ /* 下拉選單樣式修正 (針對 Gradio 4.x) */
34
+ .options, .wrap .options {
35
  background-color: #262626 !important;
36
  border: 1px solid #d4af37 !important;
37
  z-index: 10000 !important; /* 確保在最上層 */
38
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
39
  }
40
 
41
+ /* 選單內的選項 */
42
+ .item, .options .item {
43
  color: #E0E0E0 !important;
44
+ padding: 8px 12px !important;
45
  }
46
 
47
+ /* 滑鼠滑過選項 */
48
+ .item:hover, .item.selected, .options .item:hover {
49
  background-color: #d4af37 !important;
50
  color: black !important;
51
  }