File size: 1,863 Bytes
2fb9655
ac2109d
 
 
 
 
 
 
2fb9655
 
 
 
 
 
 
 
 
ac2109d
b843cdb
 
 
 
 
ac2109d
 
 
 
 
 
 
 
 
 
2fb9655
 
ac2109d
 
2fb9655
 
 
 
 
 
 
 
 
 
ac2109d
2fb9655
 
 
 
ac2109d
2fb9655
 
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
import streamlit as st
import json

# Load furniture categories and attributes from a JSON file
def load_furniture_data():
    with open('./config/furniture_taxonomy.json', 'r') as file:
        data = json.load(file)
    return data

# Custom CSS to style the buttons
st.markdown("""
<style>
.streamlit-button { background-color: #0052CC; color: white; }
</style>
""", unsafe_allow_html=True)

# Function to display the main page
def main_page(furniture_data):
    st.title("Social Media - What's Trending")
    
    category = st.selectbox('Select Category', ['Apparel', 'Furnitures', 'Beauty'])
    brands = ['Arhaus', 'Crate&Barrel', 'Williams Sonoma', 'Pottery Barn', 'West Elm', 'Z Gallerie']
    brand = st.selectbox('Select Brand', brands)

    # Dropdown for selecting furniture category
    categories = list(furniture_data['Furniture'].keys())
    selected_category = st.selectbox('Select Category', categories)

    # Load attributes based on the selected category
    attributes = furniture_data['Furniture'][selected_category]['attributes']
    for attribute, options in attributes.items():
        st.multiselect(f'Choose {attribute}', options)

    if st.button('Show Trending TikToks'):
        st.write("Display trending TikTok images here...")
        # Display TikTok images and links (implementation depends on data source)

# Function to display the TikTok video page
def tiktok_video_page():
    st.title("TikTok Video and Metadata")
    st.video("URL_of_the_TikTok_video")
    st.write("Metadata of the TikTok video...")
    
    if st.button('Go back'):
        main_page()

# Main app logic
furniture_data = load_furniture_data()
if 'page' not in st.session_state:
    st.session_state.page = 'main'

if st.session_state.page == 'main':
    main_page(furniture_data)
elif st.session_state.page == 'tiktok_video':
    tiktok_video_page()