Spaces:
Running
Running
seawolf2357
commited on
Commit
β’
150cfea
1
Parent(s):
0b03760
Update app.py
Browse files
app.py
CHANGED
@@ -16,27 +16,22 @@ menus = {
|
|
16 |
"Scripts": []
|
17 |
}
|
18 |
|
19 |
-
#
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
with st.sidebar.expander(menu_name):
|
25 |
-
if sub_menus: # νμ λ©λ΄κ° μλ κ²½μ°
|
26 |
-
for sub_menu in sub_menus:
|
27 |
-
# νμ λ©λ΄ μ΄λ¦μΌλ‘ λ²νΌ μμ±, κ³ μ ν ν€ μ 곡
|
28 |
-
button_key = f"{menu_name}-{sub_menu}"
|
29 |
-
st.button(sub_menu, key=button_key)
|
30 |
-
else:
|
31 |
-
st.write("No sub menus") # νμ λ©λ΄κ° μλ κ²½μ° λ©μμ§ νμ
|
32 |
-
|
33 |
-
# μ¬μ©μκ° μ νν λ©λ΄μ λ°λΌ νΉμ νλ©΄μ νμ
|
34 |
-
if selected_menu == "Home":
|
35 |
-
st.header("Welcome to ViDraft")
|
36 |
-
st.write("Choose an option from the sidebar to get started.")
|
37 |
-
# μ¬κΈ°μλΆν° μΆκ°μ μΈ λ©λ΄μ λ°λ₯Έ νλ©΄ νμ λ‘μ§μ ꡬνν μ μμ΅λλ€.
|
38 |
|
|
|
|
|
|
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
# 'Home' νμ΄μ§ νμ
|
42 |
if selected_menu == "Home":
|
@@ -123,4 +118,4 @@ elif selected_menu == "Sound":
|
|
123 |
# 'Scripts' λ©λ΄ μ ν μ μ²λ¦¬ λ‘μ§
|
124 |
elif selected_menu == "Scripts":
|
125 |
st.header("Scripts")
|
126 |
-
st.write("Script writing tools and resources.")
|
|
|
16 |
"Scripts": []
|
17 |
}
|
18 |
|
19 |
+
# μΈμ
μν μ΄κΈ°ν
|
20 |
+
if 'current_menu' not in st.session_state:
|
21 |
+
st.session_state['current_menu'] = 'Home'
|
22 |
+
if 'current_sub_menu' not in st.session_state:
|
23 |
+
st.session_state['current_sub_menu'] = ''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
+
# λ©μΈ λ©λ΄ μ ν
|
26 |
+
selected_menu = st.sidebar.selectbox("Menu", list(menus.keys()))
|
27 |
+
st.session_state['current_menu'] = selected_menu
|
28 |
|
29 |
+
# νμ λ©λ΄ μ ν (ν΄λΉλλ κ²½μ°)
|
30 |
+
if selected_menu in menus:
|
31 |
+
selected_sub_menu = st.sidebar.selectbox("Sub Menu", [""] + menus[selected_menu])
|
32 |
+
st.session_state['current_sub_menu'] = selected_sub_menu
|
33 |
+
else:
|
34 |
+
st.session_state['current_sub_menu'] = ''
|
35 |
|
36 |
# 'Home' νμ΄μ§ νμ
|
37 |
if selected_menu == "Home":
|
|
|
118 |
# 'Scripts' λ©λ΄ μ ν μ μ²λ¦¬ λ‘μ§
|
119 |
elif selected_menu == "Scripts":
|
120 |
st.header("Scripts")
|
121 |
+
st.write("Script writing tools and resources.")
|