def layout(*args): style = """ <style> #MainMenu {visibility: hidden;} footer {visibility: hidden;} </style> """ style_div = styles(left=0, bottom=0, margin=px(0, 0, 0, 0), width=percent(100), color="black", text_align="center", height="auto", opacity=1) style_hr = styles(margin=px(3, 3, 10, 3), border_style="inset", border_width=px(3)) body = p() foot = div(style=style_div)(hr(style=style_hr), body) st.markdown(style, unsafe_allow_html=True) for arg in args: if isinstance(arg, str): body(arg) elif isinstance(arg, HtmlElement): body(arg) st.markdown(str(foot), unsafe_allow_html=True)
def layout(*args): style = """ <style> # MainMenu {visibility: hidden;} footer {visibility: hidden;} .stApp { bottom: 70px; } </style> """ style_div = styles(position="fixed", left=0, bottom=0, margin=px(0, 0, 0, 0), width=percent(100), color="black", text_align="center", height="auto", opacity=1) body = p() foot = div(style=style_div)(body) st.markdown(style, unsafe_allow_html=True) for arg in args: if isinstance(arg, str): body(arg) elif isinstance(arg, HtmlElement): body(arg) st.markdown(str(foot), unsafe_allow_html=True)
def layout(*args): style = """ <style> # MainMenu {visibility: hidden;} footer {visibility: hidden;} .stApp { bottom: 105px; } </style> """ style_div = styles(position="fixed", left=0, bottom=0, margin=px(0, 0, 0, 0), width=percent(100), color="black", text_align="center", height="auto", opacity=1) style_hr = styles(display="block", margin=px(8, 8, "auto", "auto"), border_style="inset", border_width=px(2)) body = p() foot = div(style=style_div)(hr(style=style_hr), body) st.markdown(style, unsafe_allow_html=True) for arg in args: if isinstance(arg, str): body(arg) elif isinstance(arg, HtmlElement): body(arg) st.markdown(str(foot), unsafe_allow_html=True) # def footer(): # myargs = [ # "Made in ", # image('https://avatars3.githubusercontent.com/u/45109972?s=400&v=4', # width=px(25), height=px(25)), # " with ❤️ by Avinash Nair", # link("https://www.linkedin.com/in/avinash-nair-299b72157/", "@AvinashNair"), # br(), # ] # layout(*myargs) # if __name__ == "__main__": # footer()
def layout(*args): style = """ <style> # MainMenu {visibility: hidden;} footer {visibility: hidden;} .stApp { bottom: 63px; } </style> """ style_div = styles( position="fixed", left=0, bottom=0, margin=px(0,0,0,0), width=percent(100), height="auto", color="black", background_color="#f5f7f8", text_align="left", opacity=1 ) style_hr = styles( position="fixed", left=0, bottom=px(75), display="block", margin=px(8, 8, "auto", "auto"), border_style="inset", border_width=px(2) ) body = p() foot = div( style=style_div )( #hr( # style=style_hr #), body ) st.markdown(style, unsafe_allow_html=True) for arg in args: if isinstance(arg, str): body(arg) elif isinstance(arg, HtmlElement): body(arg) st.markdown(str(foot), unsafe_allow_html=True)
def layout(*args): hide_stuff = """ <style> #MainMenu {visibility: hidden;} footer {visibility: hidden;} .stApp { bottom: 105px; } </style> """ style_div = styles(position="fixed", left=0, bottom=0, margin=px(0, 0, 0, 0), width=percent(100), color="black", text_align="center", height="auto", opacity=1) style_hr = styles( #display="block", margin=px(0, 0, "auto", "auto"), #border_style="inset", border_width=px(3)) body = p() foot = div(style=style_div)(hr(style=style_hr), body) for arg in args: if isinstance(arg, str): body(arg) elif isinstance(arg, HtmlElement): body(arg) st.markdown(hide_stuff, unsafe_allow_html=True) st.markdown(str(foot), unsafe_allow_html=True)
def test_varargs(self): self.assertEqual(px(10, 9, 8), ('10px', '9px', '8px')) self.assertEqual(px(0, 1), ('0', '1px')) self.assertEqual(em(5, 7), ('5em', '7em')) self.assertEqual(percent(99, 99.9), ('99%', '99.9%'))
def test_basic_usage(self): self.assertEqual(px(10), ('10px', )) self.assertEqual(px(0), ('0', )) self.assertEqual(em(5), ('5em', )) self.assertEqual(percent(99), ('99%', ))