Spaces:
Sleeping
Sleeping
File size: 1,406 Bytes
f26f813 73e6979 047b16c 462dbd9 73e6979 a276d8e 41c32b9 73e6979 a276d8e 73e6979 | 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
from streamlit_option_menu import option_menu
import json
from page import *
# 🛠 Set konfigurasi halaman di awal
st.set_page_config(page_title="Nekopoi", layout="wide")
# Load ikon dari JSON
with open("icons.json", "r") as file:
icons_dict = json.load(file)
# Daftar menu utama
menu_options = list(icons_dict.keys())
# Ambil ikon dari JSON sesuai urutan menu
menu_icons = [icons_dict[option] for option in menu_options]
# Sidebar Navigation
with st.sidebar:
selected = option_menu("Nekopoi", menu_options, icons=menu_icons, menu_icon="cast", default_index=0)
# Menu horizontal
selected2 = option_menu(None, ["Home", "Upload", "Tasks", "Settings"],
icons=['house', 'cloud-upload', "list-task", 'gear'],
menu_icon="cast", default_index=0, orientation="horizontal")
# Panggil file lain berdasarkan menu sidebar
if selected == "Home":
home.run()
elif selected == "Trending":
trending.run()
elif selected == "Categories":
categories.run()
elif selected == "Favorites":
favorites.run()
elif selected == "History":
history.run()
elif selected == "Settings":
settings.run()
elif selected == "Help":
help.run()
elif selected == "About":
about.run()
# Panggil file lain berdasarkan menu horizontal
if selected2 == "Upload":
upload.run()
elif selected2 == "Tasks":
tasks.run()
elif selected2 == "Settings":
settings.run()
|