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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -11
app.py CHANGED
@@ -39,9 +39,7 @@ def cloud_button(label, key=None, color=None, overlap=30):
39
  cloud_button_html = f"""
40
  <div class="cloud" id="{button_id}" style="margin-bottom: 20px;">
41
  <div class="wrapper {color_class}">
42
- <div class="circle-container">
43
- {circles_html}
44
- </div>
45
  </div>
46
  </div>
47
  <style>
@@ -58,15 +56,13 @@ def cloud_button(label, key=None, color=None, overlap=30):
58
  position: relative;
59
  padding: 10px 20px;
60
  }}
61
- .circle-container {{
62
- position: relative;
63
- }}
64
  .circle {{
65
  background-color: #FF6347;
66
  border-radius: 50%;
67
  width: {circle_size}px;
68
  height: {circle_size}px;
69
  position: relative;
 
70
  }}
71
  .circle-text {{
72
  position: absolute;
@@ -79,7 +75,7 @@ def cloud_button(label, key=None, color=None, overlap=30):
79
  text-align: center; /* Center the text horizontally and vertically */
80
  }}
81
  /* Add this CSS for the hover effect and shadow */
82
- .cloud:hover .circle-container {{
83
  transform: scale(1.1); /* Scale up the circles on hover */
84
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Add a shadow on hover */
85
  }}
@@ -96,10 +92,6 @@ def cloud_button(label, key=None, color=None, overlap=30):
96
  """
97
  st.markdown(cloud_button_html, unsafe_allow_html=True)
98
 
99
- # Example usage with a specified overlap value
100
- cloud_button("Short Text", color="1", overlap=30)
101
- cloud_button("This is a longer piece of text", color="2", overlap=30)
102
- cloud_button("This is an even longer piece of text to test the cloud button", color="3", overlap=30)
103
 
104
 
105
 
 
39
  cloud_button_html = f"""
40
  <div class="cloud" id="{button_id}" style="margin-bottom: 20px;">
41
  <div class="wrapper {color_class}">
42
+ {circles_html}
 
 
43
  </div>
44
  </div>
45
  <style>
 
56
  position: relative;
57
  padding: 10px 20px;
58
  }}
 
 
 
59
  .circle {{
60
  background-color: #FF6347;
61
  border-radius: 50%;
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;
 
75
  text-align: center; /* Center the text horizontally and vertically */
76
  }}
77
  /* Add this CSS for the hover effect and shadow */
78
+ .cloud:hover .circle {{
79
  transform: scale(1.1); /* Scale up the circles on hover */
80
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Add a shadow on hover */
81
  }}
 
92
  """
93
  st.markdown(cloud_button_html, unsafe_allow_html=True)
94
 
 
 
 
 
95
 
96
 
97