File size: 1,772 Bytes
12d891e
d796104
73d7e50
ea5f78c
73d7e50
 
 
 
 
 
 
 
 
d698e7b
73d7e50
a48e7a7
 
ea5f78c
 
35f13e1
73d7e50
 
ea5f78c
27dbdfd
73d7e50
ea5f78c
d698e7b
73d7e50
 
 
 
 
 
 
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
35
import streamlit as st

def cloud_button(label, key, width):
    button_html = f"""
    <div style="text-align: center; display: inline-block; width: {width}px;">
        <div style="display: inline-flex; position: relative; background-color: #FF6347; border-radius: 50px; padding: 10px;">
            <div style="border-radius: 50%; width: 50px; height: 50px; margin: 5px;"></div>
            <div style="border-radius: 50%; width: 60px; height: 60px; margin: 5px; position: absolute; left: 20px;"></div>
            <div style="border-radius: 50%; width: 70px; height: 70px; margin: 5px; position: absolute; left: 50px;"></div>
            <div style="border-radius: 50%; width: 80px; height: 80px; margin: 5px; position: absolute; left: 90px;"></div>
            <div style="border-radius: 50%; width: 70px; height: 70px; margin: 5px; position: absolute; left: 140px;"></div>
            <div style="border-radius: 50%; width: 60px; height: 60px; margin: 5px; position: absolute; left: 180px;"></div>
            <div style="border-radius: 50%; width: 50px; height: 50px; margin: 5px; position: absolute; left: 210px;"></div>
        </div>
        <div style="margin-top: -40px; color: white; font-weight: bold;">{label}</div>
    </div>
    """
    st.markdown(button_html, unsafe_allow_html=True)
    return st.button("", key=key, use_container_width=True)

width = 300
if cloud_button("Click Me!", "button1", width):
    st.success("Button 1 clicked!")

if cloud_button("Another Button", "button2", width):
    st.success("Button 2 clicked!")

st.markdown(f"""
    <div style="background-color: #FF6347; border-radius: 10px; padding: 10px; width: {width}px; color: white; text-align: center;">
        This is a text field
    </div>
""", unsafe_allow_html=True)