Anne31415 commited on
Commit
455831a
·
1 Parent(s): bdde277

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -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}"></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;
@@ -93,6 +93,7 @@ def cloud_button(label, key=None, color=None, overlap=30):
93
  st.markdown(cloud_button_html, unsafe_allow_html=True)
94
 
95
 
 
96
  # Example usage with a specified overlap value
97
  cloud_button("Short Text", color="1", overlap=30)
98
  cloud_button("This is a longer piece of text", color="2", 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
  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;
 
93
  st.markdown(cloud_button_html, unsafe_allow_html=True)
94
 
95
 
96
+
97
  # Example usage with a specified overlap value
98
  cloud_button("Short Text", color="1", overlap=30)
99
  cloud_button("This is a longer piece of text", color="2", overlap=30)