Spaces:
Runtime error
Runtime error
Upload footer.py
Browse files
footer.py
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from htbuilder import HtmlElement, div, a, p, img, styles
|
3 |
+
from htbuilder.units import percent, px
|
4 |
+
|
5 |
+
|
6 |
+
def image(src_as_string, **style):
|
7 |
+
return img(src=src_as_string, style=styles(**style))
|
8 |
+
|
9 |
+
|
10 |
+
def link(link, text, **style):
|
11 |
+
return a(_href=link, _target="_blank", style=styles(**style))(text)
|
12 |
+
|
13 |
+
|
14 |
+
def layout(*args):
|
15 |
+
|
16 |
+
style = """
|
17 |
+
<style>
|
18 |
+
# MainMenu {visibility: hidden;}
|
19 |
+
footer {visibility: hidden;}
|
20 |
+
.stApp { bottom: 40px; }
|
21 |
+
.st-emotion-cache-139wi93 {
|
22 |
+
width: 100%;
|
23 |
+
padding: 1rem 1rem 15px;
|
24 |
+
max-width: 46rem;
|
25 |
+
}
|
26 |
+
</style>
|
27 |
+
"""
|
28 |
+
|
29 |
+
style_div = styles(
|
30 |
+
position="fixed",
|
31 |
+
left=0,
|
32 |
+
bottom=0,
|
33 |
+
margin=px(0, 0, 0, 0),
|
34 |
+
width=percent(100),
|
35 |
+
color="white",
|
36 |
+
text_align="center",
|
37 |
+
height="auto",
|
38 |
+
opacity=1
|
39 |
+
)
|
40 |
+
|
41 |
+
body = p()
|
42 |
+
foot = div(
|
43 |
+
style=style_div
|
44 |
+
)(
|
45 |
+
body
|
46 |
+
)
|
47 |
+
|
48 |
+
st.markdown(style, unsafe_allow_html=True)
|
49 |
+
|
50 |
+
for arg in args:
|
51 |
+
if isinstance(arg, str):
|
52 |
+
body(arg)
|
53 |
+
|
54 |
+
elif isinstance(arg, HtmlElement):
|
55 |
+
body(arg)
|
56 |
+
|
57 |
+
st.markdown(str(foot), unsafe_allow_html=True)
|
58 |
+
|
59 |
+
|
60 |
+
def footer():
|
61 |
+
myargs = [
|
62 |
+
"Made with ❤️ by Nikhil, Mihir, Nilay",
|
63 |
+
]
|
64 |
+
layout(*myargs)
|
65 |
+
|
66 |
+
|
67 |
+
if __name__ == "__main__":
|
68 |
+
footer()
|