Update app.py
Browse files
app.py
CHANGED
|
@@ -15,6 +15,7 @@ st.markdown("""
|
|
| 15 |
white-space: nowrap; /* 防止標題換行 */
|
| 16 |
overflow: hidden;
|
| 17 |
text-overflow: ellipsis;
|
|
|
|
| 18 |
}
|
| 19 |
.stImage > img {
|
| 20 |
max-width: 95%; /* 圖片寬度幾乎填滿 */
|
|
@@ -46,7 +47,7 @@ if 'page' not in st.session_state:
|
|
| 46 |
# 顯示當前頁面的圖片,放大至幾乎全版面
|
| 47 |
st.image(image_data[st.session_state.page]["path"],
|
| 48 |
caption=image_data[st.session_state.page]["caption"],
|
| 49 |
-
use_container_width=True)
|
| 50 |
|
| 51 |
# 換頁按鈕
|
| 52 |
col1, col2 = st.columns(2)
|
|
@@ -116,7 +117,7 @@ def main():
|
|
| 116 |
buf = io.BytesIO()
|
| 117 |
qr_img.save(buf, format="PNG")
|
| 118 |
byte_im = buf.getvalue()
|
| 119 |
-
st.image(byte_im, caption="掃描此 QR Code 前往表單", use_container_width=False)
|
| 120 |
except Exception as e:
|
| 121 |
st.error(f"生成 QR Code 時發生錯誤: {str(e)}")
|
| 122 |
|
|
|
|
| 15 |
white-space: nowrap; /* 防止標題換行 */
|
| 16 |
overflow: hidden;
|
| 17 |
text-overflow: ellipsis;
|
| 18 |
+
font-size: 2rem; /* 調整字體大小為 2rem,約 32px,根據需要調整 */
|
| 19 |
}
|
| 20 |
.stImage > img {
|
| 21 |
max-width: 95%; /* 圖片寬度幾乎填滿 */
|
|
|
|
| 47 |
# 顯示當前頁面的圖片,放大至幾乎全版面
|
| 48 |
st.image(image_data[st.session_state.page]["path"],
|
| 49 |
caption=image_data[st.session_state.page]["caption"],
|
| 50 |
+
use_container_width=True)
|
| 51 |
|
| 52 |
# 換頁按鈕
|
| 53 |
col1, col2 = st.columns(2)
|
|
|
|
| 117 |
buf = io.BytesIO()
|
| 118 |
qr_img.save(buf, format="PNG")
|
| 119 |
byte_im = buf.getvalue()
|
| 120 |
+
st.image(byte_im, caption="掃描此 QR Code 前往表單", use_container_width=False)
|
| 121 |
except Exception as e:
|
| 122 |
st.error(f"生成 QR Code 時發生錯誤: {str(e)}")
|
| 123 |
|