Spaces:
Runtime error
Runtime error
Kangarroar
commited on
Commit
·
a3803c0
1
Parent(s):
db761cb
Update app.py
Browse files
app.py
CHANGED
@@ -1,23 +1,33 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
st.session_state["user_name"] = username
|
13 |
-
st.session_state["tos_agreed"] = True
|
14 |
-
st.experimental_reroute("/congratulations")
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
st.write(
|
21 |
-
|
22 |
-
if
|
23 |
-
|
|
|
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()
|