-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathutils.py
More file actions
69 lines (59 loc) · 1.99 KB
/
utils.py
File metadata and controls
69 lines (59 loc) · 1.99 KB
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
import streamlit as st
import time
def create_navbar(type=None):
st.write("##### ")
st.write("### ModernMKZ")
st.divider()
st.write("__Menu de Navegação__")
st.page_link("app.py", use_container_width=True, label="Ferramenta", icon="📈")
st.page_link("pages/about.py", use_container_width=True, label="Sobre o Projeto", icon="📄")
st.page_link("pages/portfolio.py", use_container_width=True, label="Carteiras", icon="💼")
st.page_link("pages/user.py", use_container_width=True, label="Perfil", icon="👾")
st.divider()
if not type:
st.write("__Créditos__")
st.image('./assets/img/group3.png', use_column_width=True)
def loader(text):
text = text + '...'
with st.spinner(text):
time.sleep(1)
# fazer um toast no futuro
def formatted_real(value):
return f"{value:.2f}".replace(".", ",")
def validar_form(name_portfolio, stocks):
if name_portfolio == "":
return False
for stock in stocks:
if stock == "":
return False
return True
def add_custom_css():
st.markdown(
"""
<style>
.custom-container {
background-color: #f0f0f5;
padding: 10px;
border-radius: 5px;
}
.custom-title {
color: #333;
font-size: 24px;
font-weight: bold;
}
#MainMenu {visibility: hidden;}
footer {visibility: hidden;}
.stDeployButton { visibility: hidden; }
[data-testid="stStatusWidget"] { visibility: hidden; }
[data-testid="stHeader"] { visibility: hidden; }
[data-testid="stAppViewBlockContainer"] { padding: 2em 5em; }
[data-testid="stSidebar"] { display: none; }
[data-testid="baseButton-headerNoPadding"] { display: none; visibility: hidden; }
</style>
""",
unsafe_allow_html=True
)
def main():
st.write("This is outside the custom container.")
if __name__ == "__main__":
main()