-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathmain_st.py
84 lines (68 loc) · 2.42 KB
/
main_st.py
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import streamlit as st
from apps import home, county_compare
PAGES = {
"Home": home.view,
"County Compare": county_compare.view,
}
def show_menu():
st.sidebar.title("Social Media Toolkit Generator")
st.sidebar.header("Defund the Police")
dark_theme = st.sidebar.checkbox("Dark theme")
if dark_theme:
show_dark_theme()
else:
show_light_theme()
st.sidebar.markdown(
"“Defund the police” means reallocating or redirecting funding away from the "
"police department to other government agencies funded by the local municipality."
)
st.sidebar.markdown(
"The goal of this tool is to highlight how much money local communities spend on "
"Police, and then how reallocating funds can make a direct impact into their community"
)
# TODO add more "apps" such as county compare tool
selection = st.sidebar.selectbox("Go To", list(PAGES.keys()))
page = PAGES.get(selection)
page()
def show_dark_theme():
hide_streamlit_style = """
<title> Half Explot </title>
<style>
#MainMenu {visibility: hidden;}
footer {visibility: hidden;}
.sidebar .sidebar-content {background-image: linear-gradient(180deg,#4CA1AF,#2c3e50);}
.btn-outline-secondary {
border-color: #09ab3b85;
color: #f9f9f9;
}
body {
color: #fafafa;
text-align: left;
background-color: #262730;
}
</style>
"""
st.markdown(hide_streamlit_style, unsafe_allow_html=True)
def show_light_theme():
hide_streamlit_style = """
<title> Half Explot </title>
<style>
#MainMenu {visibility: hidden;}
footer {visibility: hidden;}
.sidebar .sidebar-content {background-image: linear-gradient(180deg,#ff6b6b,#ffe66d);}
.btn-outline-secondary {
border-color: #09ab3b85;
color: #000000;
}
body {
color: #000000;
text-align: left;
background-color: #fffff;
}
</style>
"""
st.markdown(hide_streamlit_style, unsafe_allow_html=True)
def main():
show_menu()
if __name__ == "__main__":
main()