-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstreamlit_style.py
85 lines (76 loc) · 2.75 KB
/
streamlit_style.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
85
class Style:
def __init__(self):
pass
@staticmethod
def set_footer():
return """<style> footer {visibility: hidden;} footer::before {
content:'© 2021 | NC State University & NC Museum of Natural
Sciences | Developed and Maintained by Mohammad Alyetama';
visibility: visible; position: fixed; left: 1; right: 1; bottom: 0;
text-align: center; # color: green; } </style> """
@staticmethod
def badge(name, image, link):
return f'<a href="{link}" target="_blank"><img alt="{name}" ' \
f'src="{image}"></a> '
def get_badges(self):
streamlit_badge = self.badge(
'Streamlit',
'https://img.shields.io/badge/Streamlit-FF4B4B?style=for-the'
'-badge&logo=Streamlit&logoColor=white', 'https://streamlit.io')
python_badge = self.badge(
'Python 3.10.0rc1',
'https://img.shields.io/badge/Python-FFD43B?style=for-the-badge'
'&logo=python&logoColor=darkgreen', 'https://www.python.org/')
postgres_badge = self.badge(
'PostgreSQL',
'https://img.shields.io/badge/PostgreSQL-316192?style=for-the'
'-badge&logo=postgresql&logoColor=white',
'https://www.postgresql.org/')
docker_badge = self.badge(
'Docker',
'https://img.shields.io/badge/Docker-2CA5E0?style=for-the-badge'
'&logo=docker&logoColor=white', 'https://www.docker.com/')
azure_badge = self.badge(
'Microsoft Azure',
'https://img.shields.io/badge/microsoft%20azure-0089D6?style=for'
'-the-badge&logo=microsoft-azure&logoColor=white',
'https://azure.microsoft.com')
return f'###### Built with:<br>{streamlit_badge} ' \
f'{python_badge} {postgres_badge} ' \
f'{docker_badge} {azure_badge} '
@staticmethod
def highlight_css():
return '''.highlight_1 {
border-radius: 0.05rem;
color: white;
padding: 0.05rem;
margin-bottom: 0.05rem;
}
.highlight_2 {
border-radius: 0.20rem;
color: white;
padding: 0.20rem;
margin-bottom: 0.20rem;
}
.bold {
padding-left: 1rem;
font-weight: 700;
}
.blue {
background-color: #428bca;
}
.green {
background-color: #5cb85c;
}
.catname {
background-color: #f8f8f2;
color: #282a36;
}
.sansserif {
font-family: Helvetica, Arial, Sans-Serif;
font-size: 20px;
}
span {
margin: 0px;
padding: 0px;
}'''