Anne31415 commited on
Commit
65d4f83
·
1 Parent(s): 3e78b14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -31,7 +31,7 @@ def cloud_button(label, key=None, color=None, overlap=30):
31
 
32
  # Create circles with text enclosed
33
  circles_html = ''.join([
34
- f'<div class="circle {color_class}" style="margin-right: -{overlap}px;"></div>'
35
  for _ in range(num_circles)
36
  ])
37
  circles_html += f'<div class="circle-text">{label}</div>' # Add the text after the circles
@@ -62,7 +62,7 @@ def cloud_button(label, key=None, color=None, overlap=30):
62
  width: {circle_size}px;
63
  height: {circle_size}px;
64
  position: relative;
65
- margin-right: {overlap}px; /* Adjust the margin for overlapping effect */
66
  }}
67
  .circle-text {{
68
  position: absolute;
@@ -92,6 +92,10 @@ def cloud_button(label, key=None, color=None, overlap=30):
92
  """
93
  st.markdown(cloud_button_html, unsafe_allow_html=True)
94
 
 
 
 
 
95
 
96
 
97
 
 
31
 
32
  # Create circles with text enclosed
33
  circles_html = ''.join([
34
+ f'<div class="circle {color_class}"></div>'
35
  for _ in range(num_circles)
36
  ])
37
  circles_html += f'<div class="circle-text">{label}</div>' # Add the text after the circles
 
62
  width: {circle_size}px;
63
  height: {circle_size}px;
64
  position: relative;
65
+ margin-right: -{overlap}px; /* Adjust the margin for overlapping effect */
66
  }}
67
  .circle-text {{
68
  position: absolute;
 
92
  """
93
  st.markdown(cloud_button_html, unsafe_allow_html=True)
94
 
95
+ # Example usage with a specified overlap value
96
+ cloud_button("Short Text", color="1", overlap=30)
97
+ cloud_button("This is a longer piece of text", color="2", overlap=30)
98
+ cloud_button("This is an even longer piece of text to test the cloud button", color="3", overlap=30)
99
 
100
 
101