Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,22 +1,34 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
-
def cloud_button(label, key):
|
4 |
button_html = f"""
|
5 |
-
<div style="text-align: center; display: inline-block;">
|
6 |
-
<div style="display: inline-flex; position: relative;">
|
7 |
-
<div style="
|
8 |
-
<div style="
|
9 |
-
<div style="
|
|
|
|
|
|
|
|
|
10 |
</div>
|
11 |
-
<div style="margin-top: -
|
12 |
</div>
|
13 |
"""
|
14 |
st.markdown(button_html, unsafe_allow_html=True)
|
15 |
return st.button("", key=key, use_container_width=True)
|
16 |
|
17 |
-
|
|
|
18 |
st.success("Button 1 clicked!")
|
19 |
|
20 |
-
if cloud_button("Another Button", "button2"):
|
21 |
st.success("Button 2 clicked!")
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
+
def cloud_button(label, key, width):
|
4 |
button_html = f"""
|
5 |
+
<div style="text-align: center; display: inline-block; width: {width}px;">
|
6 |
+
<div style="display: inline-flex; position: relative; background-color: #FF6347; border-radius: 50px; padding: 10px;">
|
7 |
+
<div style="border-radius: 50%; width: 50px; height: 50px; margin: 5px;"></div>
|
8 |
+
<div style="border-radius: 50%; width: 60px; height: 60px; margin: 5px; position: absolute; left: 20px;"></div>
|
9 |
+
<div style="border-radius: 50%; width: 70px; height: 70px; margin: 5px; position: absolute; left: 50px;"></div>
|
10 |
+
<div style="border-radius: 50%; width: 80px; height: 80px; margin: 5px; position: absolute; left: 90px;"></div>
|
11 |
+
<div style="border-radius: 50%; width: 70px; height: 70px; margin: 5px; position: absolute; left: 140px;"></div>
|
12 |
+
<div style="border-radius: 50%; width: 60px; height: 60px; margin: 5px; position: absolute; left: 180px;"></div>
|
13 |
+
<div style="border-radius: 50%; width: 50px; height: 50px; margin: 5px; position: absolute; left: 210px;"></div>
|
14 |
</div>
|
15 |
+
<div style="margin-top: -40px; color: white; font-weight: bold;">{label}</div>
|
16 |
</div>
|
17 |
"""
|
18 |
st.markdown(button_html, unsafe_allow_html=True)
|
19 |
return st.button("", key=key, use_container_width=True)
|
20 |
|
21 |
+
width = 300
|
22 |
+
if cloud_button("Click Me!", "button1", width):
|
23 |
st.success("Button 1 clicked!")
|
24 |
|
25 |
+
if cloud_button("Another Button", "button2", width):
|
26 |
st.success("Button 2 clicked!")
|
27 |
|
28 |
+
st.markdown(f"""
|
29 |
+
<div style="background-color: #FF6347; border-radius: 10px; padding: 10px; width: {width}px; color: white; text-align: center;">
|
30 |
+
This is a text field
|
31 |
+
</div>
|
32 |
+
""", unsafe_allow_html=True)
|
33 |
+
|
34 |
+
|