Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,6 +30,65 @@ from xml.etree import ElementTree as ET
|
|
| 30 |
from PIL import Image
|
| 31 |
from urllib.parse import quote # Ensure this import is included
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
# 1. Configuration
|
| 35 |
|
|
@@ -1430,3 +1489,7 @@ display_glossary_grid(roleplaying_glossary) # Word Glossary Jump Grid - Dynamic
|
|
| 1430 |
|
| 1431 |
num_columns_text=st.slider(key="num_columns_text", label="Choose Number of Text Columns", min_value=1, max_value=10, value=4)
|
| 1432 |
display_buttons_with_scores(num_columns_text) # Feedback Jump Grid
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
from PIL import Image
|
| 31 |
from urllib.parse import quote # Ensure this import is included
|
| 32 |
|
| 33 |
+
def image(src_as_string, **style):
|
| 34 |
+
return img(src=src_as_string, style=styles(**style))
|
| 35 |
+
|
| 36 |
+
def link(link, text, **style):
|
| 37 |
+
return a(_href=link, _target="_blank", style=styles(**style))(text)
|
| 38 |
+
|
| 39 |
+
def layout(*args):
|
| 40 |
+
|
| 41 |
+
style = """
|
| 42 |
+
<style>
|
| 43 |
+
# MainMenu {visibility: hidden;}
|
| 44 |
+
footer {visibility: hidden;}
|
| 45 |
+
</style>
|
| 46 |
+
"""
|
| 47 |
+
|
| 48 |
+
style_div = styles(
|
| 49 |
+
left=0,
|
| 50 |
+
bottom=0,
|
| 51 |
+
margin=px(0, 0, 0, 0),
|
| 52 |
+
width=percent(100),
|
| 53 |
+
text_align="center",
|
| 54 |
+
height="60px",
|
| 55 |
+
opacity=0.6
|
| 56 |
+
)
|
| 57 |
+
|
| 58 |
+
style_hr = styles(
|
| 59 |
+
)
|
| 60 |
+
|
| 61 |
+
body = p()
|
| 62 |
+
foot = div(style=style_div)(hr(style=style_hr), body)
|
| 63 |
+
|
| 64 |
+
st.markdown(style, unsafe_allow_html=True)
|
| 65 |
+
|
| 66 |
+
for arg in args:
|
| 67 |
+
if isinstance(arg, str):
|
| 68 |
+
body(arg)
|
| 69 |
+
elif isinstance(arg, HtmlElement):
|
| 70 |
+
body(arg)
|
| 71 |
+
|
| 72 |
+
st.markdown(str(foot), unsafe_allow_html=True)
|
| 73 |
+
|
| 74 |
+
def footer():
|
| 75 |
+
myargs = [
|
| 76 |
+
"<b>Made with</b>: Python 3.8 ",
|
| 77 |
+
link("https://www.python.org/", image('https://i.imgur.com/ml09ccU.png',
|
| 78 |
+
width=px(18), height=px(18), margin= "0em")),
|
| 79 |
+
", Streamlit ",
|
| 80 |
+
link("https://streamlit.io/", image('https://docs.streamlit.io/en/stable/_static/favicon.png',
|
| 81 |
+
width=px(24), height=px(25), margin= "0em")),
|
| 82 |
+
", Docker ",
|
| 83 |
+
link("https://www.docker.com/", image('https://www.docker.com/sites/default/files/d8/styles/role_icon/public/2019-07/Moby-logo.png?itok=sYH_JEaJ',
|
| 84 |
+
width=px(20), height=px(18), margin= "0em")),
|
| 85 |
+
" and Google APP Engine ",
|
| 86 |
+
link("https://cloud.google.com/appengine", image('https://lh3.ggpht.com/_uP6bUdDOWGS6ICpMH7dBAy5LllYc_bBjjXI730L3FQ64uS1q4WltHnse7rgpKiInog2LYM1',
|
| 87 |
+
width=px(19), height=px(19), margin= "0em", align="top")),
|
| 88 |
+
br(),
|
| 89 |
+
]
|
| 90 |
+
layout(*myargs)
|
| 91 |
+
|
| 92 |
|
| 93 |
# 1. Configuration
|
| 94 |
|
|
|
|
| 1489 |
|
| 1490 |
num_columns_text=st.slider(key="num_columns_text", label="Choose Number of Text Columns", min_value=1, max_value=10, value=4)
|
| 1491 |
display_buttons_with_scores(num_columns_text) # Feedback Jump Grid
|
| 1492 |
+
|
| 1493 |
+
|
| 1494 |
+
|
| 1495 |
+
footer()
|