anasrz commited on
Commit
14f74ff
1 Parent(s): cc99daa

Create footer.py

Browse files
Files changed (1) hide show
  1. footer.py +73 -0
footer.py ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from htbuilder import HtmlElement, div, ul, li, br, hr, a, p, img, styles, classes, fonts
3
+ from htbuilder.units import percent, px
4
+ from htbuilder.funcs import rgba, rgb
5
+
6
+
7
+ def image(src_as_string, **style):
8
+ return img(src=src_as_string, style=styles(**style))
9
+
10
+
11
+ def link(link, text, **style):
12
+ return a(_href=link, _target="_blank", style=styles(**style))(text)
13
+
14
+
15
+ def layout(*args):
16
+
17
+ style = """
18
+ <style>
19
+ # MainMenu {visibility: hidden;}
20
+ footer {visibility: hidden;}
21
+ .stApp { bottom: 105px; }
22
+ </style>
23
+ """
24
+
25
+ style_div = styles(
26
+ position="fixed",
27
+ left=0,
28
+ bottom=0,
29
+ margin=px(0, 0, 0, 0),
30
+ width=percent(100),
31
+ color="black",
32
+ text_align="center",
33
+ height="auto",
34
+ opacity=1
35
+ )
36
+
37
+ style_hr = styles(
38
+ display="block",
39
+ margin=px(8, 8, "auto", "auto"),
40
+ border_style="inset",
41
+ border_width=px(2)
42
+ )
43
+
44
+ body = p()
45
+ foot = div(
46
+ style=style_div
47
+ )(
48
+ hr(
49
+ style=style_hr
50
+ ),
51
+ body
52
+ )
53
+
54
+ st.markdown(style, unsafe_allow_html=True)
55
+
56
+ for arg in args:
57
+ if isinstance(arg, str):
58
+ body(arg)
59
+
60
+ elif isinstance(arg, HtmlElement):
61
+ body(arg)
62
+
63
+ st.markdown(str(foot), unsafe_allow_html=True)
64
+
65
+
66
+ def footer():
67
+ myargs = [
68
+ "Made ",
69
+ " with ❤️ by ",
70
+ link("https://anasrz.com", "Muhammad Anas Raza"),
71
+ br(),
72
+ ]
73
+ layout(*myargs)