-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathhelpers.py
34 lines (31 loc) · 1.11 KB
/
helpers.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
from streamlit.components.v1 import html
from footer import link
# Footer
footer_content = [
"Made with ❤️ by ",
link("https://github.com/kairess", "kairess", color="inherit"),
" / ",
link("https://www.youtube.com/@bbanghyong", "빵형의 개발도상국", color="inherit"),
"<br/>",
"Supported by AIFrenz ",
link("https://aifrenz.notion.site/AI-4fe1e334ffbe4cb4924d1caa3f7cd8b0", "창의AI연구회", color="inherit"),
" / ",
link("https://www.m47rix.com", "주식회사 더매트릭스", color="inherit"),
]
def focus():
html(f"""<script>
var input = window.parent.document.querySelectorAll("input[type=text]");
for (var i = 0; i < input.length; ++i) {{
input[i].focus();
}}
</script>""", height=0)
def toggle_diabled(disabled=True):
disabled_text = "false"
if disabled:
disabled_text = "true"
html(f"""<script>
var input = window.parent.document.querySelectorAll("input[type=text]");
for (var i = 0; i < input.length; ++i) {{
input[i].disabled = {disabled_text};
}}
</script>""", height=0)