diff --git a/app.py b/app.py
index 6b6e117..946ca66 100644
--- a/app.py
+++ b/app.py
@@ -17,6 +17,7 @@ from pathlib import Path
import qrcode
import streamlit as st
+from streamlit_autorefresh import st_autorefresh
DATA_PATH = os.environ.get(
"DATA_PATH", str(Path(__file__).parent / "hackathon.json")
@@ -446,8 +447,34 @@ def render_stage_topics(data):
def render_stage_vote(data):
- st.markdown('
π³ ν¬ν μμ
', unsafe_allow_html=True)
- st.info("Task 11μμ ꡬν")
+ st_autorefresh(interval=3000, key="vote_poll")
+
+ st.markdown('π³ ν¬ν
', unsafe_allow_html=True)
+ st.markdown(
+ 'π± ν΄λν°μΌλ‘ QR μ€μΊ β λ³ΈμΈ μ΄λ¦ μ ν β ν¬ν
',
+ unsafe_allow_html=True,
+ )
+
+ vote_url = compute_vote_url()
+ qr_png = make_qr_png(vote_url)
+
+ c1, c2, c3 = st.columns([1, 2, 1])
+ with c2:
+ st.image(qr_png, use_container_width=False, width=500)
+ st.markdown(
+ f'{vote_url}
',
+ unsafe_allow_html=True,
+ )
+
+ votes = data.get("votes", [])
+ total = len(data.get("people", []))
+ voted = len(votes)
+ pct = int(100 * voted / total) if total else 0
+ st.markdown(
+ f'{voted} / {total}
',
+ unsafe_allow_html=True,
+ )
+ st.progress(pct / 100 if total else 0)
def render_voter():