awacke1 commited on
Commit
81ffa58
·
verified ·
1 Parent(s): edee69e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -12
app.py CHANGED
@@ -40,7 +40,7 @@ def main():
40
  st.title("3D House Exploration")
41
 
42
  # Add a new player button
43
- if st.button("Join Game"):
44
  add_player()
45
 
46
  # Display the HTML5 app
@@ -51,22 +51,18 @@ def main():
51
  new_html = st.text_area("HTML5 Content", st.session_state.html_content, height=300)
52
 
53
  # Save button
54
- if st.button("Save"):
55
  st.session_state.html_content = new_html
56
 
57
  # Refresh timer
58
- last_refresh = st.button("Refresh")
59
- if last_refresh:
60
  st.experimental_rerun()
61
-
62
- if not st.button("Refresh", key="refresh_button"):
63
  refresh_timer = st.empty()
64
- while True:
65
- time.sleep(5)
66
- refresh_timer.text(f"Refreshing in {5 - int(time.time()) % 5} seconds...")
67
- if st.button("Refresh", key="refresh_button"):
68
- st.experimental_rerun()
69
- break
70
 
71
  if __name__ == "__main__":
72
  main()
 
40
  st.title("3D House Exploration")
41
 
42
  # Add a new player button
43
+ if st.button("Join Game", key="join_game"):
44
  add_player()
45
 
46
  # Display the HTML5 app
 
51
  new_html = st.text_area("HTML5 Content", st.session_state.html_content, height=300)
52
 
53
  # Save button
54
+ if st.button("Save", key="save_button"):
55
  st.session_state.html_content = new_html
56
 
57
  # Refresh timer
58
+ if st.button("Refresh", key="refresh_button"):
 
59
  st.experimental_rerun()
60
+ else:
 
61
  refresh_timer = st.empty()
62
+ for i in range(5, 0, -1):
63
+ refresh_timer.text(f"Refreshing in {i} seconds...")
64
+ time.sleep(1)
65
+ st.experimental_rerun()
 
 
66
 
67
  if __name__ == "__main__":
68
  main()