DeepLearning101 commited on
Commit
4b00872
·
verified ·
1 Parent(s): a1df044

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +22 -13
src/streamlit_app.py CHANGED
@@ -18,7 +18,7 @@ st.markdown(
18
  scrollbar-width: none;
19
  }
20
 
21
- /* 2. 調整範例按鈕樣式 (改為科技藍風格) */
22
  .stButton button {
23
  width: auto;
24
  padding: 5px 15px;
@@ -26,25 +26,34 @@ st.markdown(
26
  border: 1px solid #58a6ff;
27
  color: #58a6ff;
28
  background-color: transparent;
29
- transition: all 0.3s ease;
30
  }
31
- .stButton button:hover {
32
- background-color: #58a6ff;
33
- color: #0d1117;
 
 
34
  }
35
 
36
- /* 3. 極度壓縮頂部空白與兩側邊距,專為小視窗優化 */
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  .block-container {
38
- padding-top: 1.5rem !important;
39
- padding-bottom: 5rem !important; /* 底部留白避免對話被輸入框蓋住 */
40
  padding-left: 1rem !important;
41
  padding-right: 1rem !important;
42
  }
43
-
44
- /* 4. 隱藏 Streamlit 預設的頂部裝飾與漢堡選單 */
45
- header {
46
- visibility: hidden;
47
- }
48
  </style>
49
  """,
50
  unsafe_allow_html=True
 
18
  scrollbar-width: none;
19
  }
20
 
21
+ /* 2. 調整範例按鈕樣式 (維持科技藍) */
22
  .stButton button {
23
  width: auto;
24
  padding: 5px 15px;
 
26
  border: 1px solid #58a6ff;
27
  color: #58a6ff;
28
  background-color: transparent;
 
29
  }
30
+
31
+ /* 🚀 3. 關鍵修正:隱藏 Header 背景與右側選單,但保留左側展開按鈕 */
32
+ header[data-testid="stHeader"] {
33
+ background-color: rgba(0,0,0,0) !important; /* 背景透明 */
34
+ color: #58a6ff !important;
35
  }
36
 
37
+ /* 隱藏右側的「...」選單按鈕 */
38
+ header[data-testid="stHeader"] #MainMenu {
39
+ visibility: hidden;
40
+ }
41
+
42
+ /* 確保左側的展開按鈕 (CollapsedControl) 是可見的 */
43
+ div[data-testid="collapsedControl"] {
44
+ visibility: visible !important;
45
+ background-color: #0d1117 !important; /* 給它一點深色背景,免得在白色畫面上看不見 */
46
+ border-radius: 0 5px 5px 0;
47
+ top: 10px;
48
+ }
49
+
50
+ /* 4. 壓縮主畫面邊距 */
51
  .block-container {
52
+ padding-top: 2rem !important;
53
+ padding-bottom: 5rem !important;
54
  padding-left: 1rem !important;
55
  padding-right: 1rem !important;
56
  }
 
 
 
 
 
57
  </style>
58
  """,
59
  unsafe_allow_html=True