Kangarroar commited on
Commit
a3803c0
·
1 Parent(s): db761cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -18
app.py CHANGED
@@ -1,23 +1,33 @@
1
  import streamlit as st
2
 
3
- def main():
4
- st.set_page_config(page_title="Terms of Service Agreement", page_icon=":guardsman:", layout="wide")
5
- st.title("Terms of Service Agreement")
 
 
 
 
 
 
6
 
7
- agreed = st.checkbox("I agree to the terms of service")
8
- username = st.text_input("Enter your username")
 
 
 
 
 
 
 
9
 
10
- if st.button("Submit") and agreed and username.strip():
11
- st.experimental_rerun()
12
- st.session_state["user_name"] = username
13
- st.session_state["tos_agreed"] = True
14
- st.experimental_reroute("/congratulations")
15
 
16
- if not st.session_state.get("tos_agreed", False):
17
- return
18
-
19
- st.title("Congratulations!")
20
- st.write(f"Welcome to our platform, {st.session_state['user_name']}!")
21
-
22
- if __name__ == "__main__":
23
- main()
 
1
  import streamlit as st
2
 
3
+ # Define a function to hide a Streamlit tab
4
+ def hide_tab():
5
+ hide_streamlit_style = """
6
+ <style>
7
+ #MainMenu {visibility: hidden;}
8
+ footer {visibility: hidden;}
9
+ </style>
10
+ """
11
+ st.markdown(hide_streamlit_style, unsafe_allow_html=True)
12
 
13
+ # Define a function to show a Streamlit tab
14
+ def show_tab():
15
+ show_streamlit_style = """
16
+ <style>
17
+ #MainMenu {visibility: visible;}
18
+ footer {visibility: visible;}
19
+ </style>
20
+ """
21
+ st.markdown(show_streamlit_style, unsafe_allow_html=True)
22
 
23
+ # Hide the Streamlit tab by default
24
+ hide_tab()
 
 
 
25
 
26
+ # Create a button to show the hidden tab
27
+ if st.button('Show tab'):
28
+ show_tab()
29
+ # Add content to the tab
30
+ st.write('This is a hidden tab. You can now see it!')
31
+ # Create a button to hide the tab again
32
+ if st.button('Hide tab'):
33
+ hide_tab()