Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -31,15 +31,17 @@ 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}"
|
35 |
for _ in range(num_circles)
|
36 |
])
|
37 |
-
circles_html += f'<div class="circle-text">{label}</div>' # Add the text after the circles
|
38 |
|
39 |
cloud_button_html = f"""
|
40 |
<div class="cloud" id="{button_id}" style="margin-bottom: 20px;">
|
41 |
<div class="wrapper {color_class}">
|
42 |
-
|
|
|
|
|
|
|
43 |
</div>
|
44 |
</div>
|
45 |
<style>
|
@@ -56,26 +58,45 @@ def cloud_button(label, key=None, color=None, overlap=30):
|
|
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:
|
65 |
-
margin-right: {overlap}px; /* Adjust the margin for overlapping effect */
|
66 |
}}
|
67 |
.circle-text {{
|
68 |
-
position:
|
69 |
-
top: 50%;
|
70 |
-
left: 50%;
|
71 |
-
transform: translate(-50%, -50%);
|
72 |
-
font-weight: bold;
|
73 |
z-index: 2;
|
74 |
white-space: nowrap; /* Prevent line breaks */
|
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 |
}}
|
|
|
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 |
|
38 |
cloud_button_html = f"""
|
39 |
<div class="cloud" id="{button_id}" style="margin-bottom: 20px;">
|
40 |
<div class="wrapper {color_class}">
|
41 |
+
<div class="circle-container">
|
42 |
+
{circles_html}
|
43 |
+
</div>
|
44 |
+
<div class="circle-text">{label}</div> <!-- Text goes here -->
|
45 |
</div>
|
46 |
</div>
|
47 |
<style>
|
|
|
58 |
position: relative;
|
59 |
padding: 10px 20px;
|
60 |
}}
|
61 |
+
.circle-container {{
|
62 |
+
position: relative;
|
63 |
+
z-index: 1;
|
64 |
+
}}
|
65 |
.circle {{
|
66 |
background-color: #FF6347;
|
67 |
border-radius: 50%;
|
68 |
width: {circle_size}px;
|
69 |
height: {circle_size}px;
|
70 |
+
position: absolute;
|
71 |
+
margin-right: -{overlap}px; /* Adjust the margin for overlapping effect */
|
72 |
}}
|
73 |
.circle-text {{
|
74 |
+
position: relative;
|
|
|
|
|
|
|
|
|
75 |
z-index: 2;
|
76 |
white-space: nowrap; /* Prevent line breaks */
|
77 |
text-align: center; /* Center the text horizontally and vertically */
|
78 |
+
font-weight: bold;
|
79 |
+
}}
|
80 |
+
.cloud::before,
|
81 |
+
.cloud::after {{
|
82 |
+
content: '';
|
83 |
+
background-color: #FF6347;
|
84 |
+
border-radius: 50%;
|
85 |
+
width: {circle_size * 2}px;
|
86 |
+
height: {circle_size * 2}px;
|
87 |
+
position: absolute;
|
88 |
+
z-index: 0;
|
89 |
+
}}
|
90 |
+
.cloud::before {{
|
91 |
+
left: -{circle_size}px;
|
92 |
+
top: -{circle_size}px;
|
93 |
+
}}
|
94 |
+
.cloud::after {{
|
95 |
+
right: -{circle_size}px;
|
96 |
+
top: -{circle_size}px;
|
97 |
}}
|
98 |
/* Add this CSS for the hover effect and shadow */
|
99 |
+
.cloud:hover .circle-container {{
|
100 |
transform: scale(1.1); /* Scale up the circles on hover */
|
101 |
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Add a shadow on hover */
|
102 |
}}
|