File size: 2,455 Bytes
cead143
79d2b6a
970d605
cf6dcc7
 
70d8d2a
 
6e8c858
4e604e3
 
 
 
 
 
 
 
 
6e8c858
cebb418
70d8d2a
 
cebb418
70d8d2a
6e8c858
 
970d605
 
 
 
 
 
 
 
 
 
 
 
 
 
4e604e3
 
130998d
4e604e3
 
 
 
 
 
 
 
 
 
 
 
 
 
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
53
54
55
56
57
import streamlit as st

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

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

# 'Home' λ²„νŠΌμ„ μ‚¬μ΄λ“œλ°”μ— μΆ”κ°€
if st.sidebar.button('Home'):
    selected_menu = 'Home'
    selected_sub_menu = None
else:
    selected_menu = None
    selected_sub_menu = None

# 메뉴 ν•­λͺ©κ³Ό ν•˜μœ„ ν•­λͺ© μ •μ˜, 'Home' λ©”λ‰΄λŠ” λ²„νŠΌμœΌλ‘œ μ²˜λ¦¬λ˜λ―€λ‘œ μ—¬κΈ°μ—λŠ” ν¬ν•¨μ‹œν‚€μ§€ μ•ŠμŒ
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"]
}

# 각 메뉴별 ν•˜λΆ€ 메뉴λ₯Ό 펼침
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}")
    # 여기에 μ„ νƒλœ 메뉴에 λ”°λ₯Έ μ½˜ν…μΈ  ν‘œμ‹œ 둜직 μΆ”κ°€

# 'Home' 메뉴가 μ„ νƒλ˜μ—ˆμ„ λ•Œ λ˜λŠ” 앱이 초기 μƒνƒœμΌ λ•Œ 화면에 "ViDraft" 좜λ ₯
if selected_menu == 'Home' or (selected_menu is None and selected_sub_menu is None):
    st.title("ViDraft")
    st.write("Welcome to ViDraft! Your ultimate platform for video editing, image processing, and sound engineering.")

# '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)