File size: 2,194 Bytes
cead143
79d2b6a
970d605
cf6dcc7
 
70d8d2a
 
6e8c858
 
 
cebb418
70d8d2a
 
cebb418
70d8d2a
6e8c858
 
970d605
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130998d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import streamlit as st

# νŽ˜μ΄μ§€ μ„€μ •
st.set_page_config(layout="wide")

# μ‚¬μ΄λ“œλ°” 타이틀 μ„€μ •
st.sidebar.title("ViDraft")

# 메뉴 ν•­λͺ©κ³Ό ν•˜μœ„ ν•­λͺ© μ •μ˜
menus = {
    "Free Stock": ["Template Video", "Template Image", "Search Video", "Search Image"],
    "Image": ["Generation", "Face ID", "Inpainting", "Remove Background", "Studio"],
    "Video": ["Generation", "Talking Face", "Remove Background", "Studio"],
    "Sound": ["Video SFX", "Video Music", "TTS(Voice)", "Voice Clone", "Image SFX", "Image Music"],
    "Scripts": ["Script"]
}

# μ„ νƒλœ 메뉴 및 ν•˜λΆ€ 메뉴 μ΄ˆκΈ°ν™”
selected_menu = None
selected_sub_menu = None

# 각 메뉴별 ν•˜λΆ€ 메뉴λ₯Ό 펼침
for menu_name, sub_menus in menus.items():
    with st.sidebar.expander(menu_name):
        # ν•˜λΆ€ 메뉴λ₯Ό 선택할 수 μžˆλŠ” selectbox 생성
        selected = st.selectbox(f"Select {menu_name} option", [""] + sub_menus, key=menu_name)
        if selected:
            selected_menu = menu_name
            selected_sub_menu = selected

# μ„ νƒλœ 메뉴와 ν•˜λΆ€ 메뉴에 λ”°λ₯Έ λ‚΄μš© ν‘œμ‹œ
if selected_menu and selected_sub_menu:
    st.subheader(f"{selected_menu} > {selected_sub_menu}")
    # 여기에 μ„ νƒλœ 메뉴에 λ”°λ₯Έ μ½˜ν…μΈ  ν‘œμ‹œ 둜직 μΆ”κ°€

    # 'Template Video'κ°€ μ„ νƒλ˜μ—ˆμ„ λ•Œ λΉ„λ””μ˜€ 가러리λ₯Ό ν‘œμ‹œ
    if selected_menu == "Free Stock" and selected_sub_menu == "Template Video":
        st.subheader("Template Videos")
        
        # λΉ„λ””μ˜€ 파일 경둜 μ„€μ •
        video_files = ["ex1.mp4", "ex2.mp4", "ex3.mp4", "ex4.mp4", "ex5.mp4", "ex6.mp4", "ex7.mp4","ex8.mp4", "ex9.mp4", "ex10.mp4", "ex11.mp4", "ex12.mp4", "ex13.mp4", "ex14.mp4","ex15.mp4", "ex16.mp4", "ex17.mp4", "ex18.mp4"]

        # 가러리 ν˜•νƒœλ‘œ λΉ„λ””μ˜€ ν‘œμ‹œ
        cols = st.columns(2)  # 2개의 μ—΄λ‘œ λ„“κ²Œ 배치
        for index, video_file in enumerate(video_files):
            with cols[index % 2]:
                st.video(video_file)
else:
    # 아무것도 μ„ νƒλ˜μ§€ μ•Šμ•˜μ„ λ•Œ κΈ°λ³Έ 화면에 "ViDraft" 좜λ ₯
    st.title("ViDraft")
    st.write("Welcome to ViDraft! Please select an option from the sidebar to get started.")