Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,7 @@ import qrcode
|
|
| 8 |
from PIL import Image
|
| 9 |
import io
|
| 10 |
|
| 11 |
-
# 自訂 CSS
|
| 12 |
st.markdown("""
|
| 13 |
<style>
|
| 14 |
.stApp header h1 {
|
|
@@ -42,6 +42,13 @@ st.markdown("""
|
|
| 42 |
padding: 5px;
|
| 43 |
}
|
| 44 |
/* 頒獎台樣式 */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
.podium {
|
| 46 |
text-align: center;
|
| 47 |
padding: 10px;
|
|
@@ -50,6 +57,9 @@ st.markdown("""
|
|
| 50 |
border: 2px solid #000;
|
| 51 |
color: #333;
|
| 52 |
font-weight: bold;
|
|
|
|
|
|
|
|
|
|
| 53 |
}
|
| 54 |
.podium.first {
|
| 55 |
height: 150px; /* 第一名最高 */
|
|
@@ -66,7 +76,11 @@ st.markdown("""
|
|
| 66 |
.podium-label {
|
| 67 |
margin-top: 5px;
|
| 68 |
font-size: 1rem;
|
| 69 |
-
color: #
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
}
|
| 71 |
</style>
|
| 72 |
""", unsafe_allow_html=True)
|
|
|
|
| 8 |
from PIL import Image
|
| 9 |
import io
|
| 10 |
|
| 11 |
+
# 自訂 CSS 確保標題不換行、調整圖片大小、優化按鈕布局、右下角資訊並調整頒獎台樣式
|
| 12 |
st.markdown("""
|
| 13 |
<style>
|
| 14 |
.stApp header h1 {
|
|
|
|
| 42 |
padding: 5px;
|
| 43 |
}
|
| 44 |
/* 頒獎台樣式 */
|
| 45 |
+
.podium-container {
|
| 46 |
+
display: flex;
|
| 47 |
+
justify-content: center;
|
| 48 |
+
align-items: flex-end; /* 確保下緣對齊 */
|
| 49 |
+
margin-top: 20px;
|
| 50 |
+
margin-bottom: 20px;
|
| 51 |
+
}
|
| 52 |
.podium {
|
| 53 |
text-align: center;
|
| 54 |
padding: 10px;
|
|
|
|
| 57 |
border: 2px solid #000;
|
| 58 |
color: #333;
|
| 59 |
font-weight: bold;
|
| 60 |
+
display: flex;
|
| 61 |
+
flex-direction: column;
|
| 62 |
+
justify-content: flex-end; /* 內容靠下對齊 */
|
| 63 |
}
|
| 64 |
.podium.first {
|
| 65 |
height: 150px; /* 第一名最高 */
|
|
|
|
| 76 |
.podium-label {
|
| 77 |
margin-top: 5px;
|
| 78 |
font-size: 1rem;
|
| 79 |
+
color: #fff; /* 文字改為白色 */
|
| 80 |
+
border: 2px solid #fff; /* 添加白色邊框 */
|
| 81 |
+
padding: 5px; /* 內距 */
|
| 82 |
+
background-color: rgba(0, 0, 0, 0.5); /* 半透明背景,提升可讀性 */
|
| 83 |
+
white-space: pre-line; /* 允許換行 */
|
| 84 |
}
|
| 85 |
</style>
|
| 86 |
""", unsafe_allow_html=True)
|