Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -24,18 +24,17 @@ repo.git_pull() # Pull the latest changes (if any)
|
|
24 |
pdf_file_path = "Private_Book/KOMBI_all2.pdf" # Replace with your PDF file path
|
25 |
|
26 |
|
27 |
-
def cloud_button(label, key=None, color=None):
|
28 |
button_id = f"cloud-button-{key or label}"
|
29 |
color_class = f"color-{color}" if color else ""
|
30 |
num_circles = max(3, min(12, len(label) // 4))
|
31 |
circle_size = 60
|
32 |
-
|
33 |
-
text_size = 14 # Adjust the text font size as needed
|
34 |
|
35 |
# Create circles with overlap
|
36 |
circles_html = ''.join([
|
37 |
-
f'<div class="circle {color_class}" style="margin-left: -{
|
38 |
-
for
|
39 |
])
|
40 |
|
41 |
cloud_button_html = f"""
|
@@ -93,10 +92,10 @@ def cloud_button(label, key=None, color=None):
|
|
93 |
"""
|
94 |
st.markdown(cloud_button_html, unsafe_allow_html=True)
|
95 |
|
96 |
-
# Example usage
|
97 |
-
cloud_button("Short Text", color="1")
|
98 |
-
cloud_button("This is a longer piece of text", color="2")
|
99 |
-
cloud_button("This is an even longer piece of text to test the cloud button", color="3")
|
100 |
|
101 |
|
102 |
def load_pdf(file_path):
|
|
|
24 |
pdf_file_path = "Private_Book/KOMBI_all2.pdf" # Replace with your PDF file path
|
25 |
|
26 |
|
27 |
+
def cloud_button(label, key=None, color=None, overlap=20):
|
28 |
button_id = f"cloud-button-{key or label}"
|
29 |
color_class = f"color-{color}" if color else ""
|
30 |
num_circles = max(3, min(12, len(label) // 4))
|
31 |
circle_size = 60
|
32 |
+
#text_size = 14 # Adjust the text font size as needed
|
|
|
33 |
|
34 |
# Create circles with overlap
|
35 |
circles_html = ''.join([
|
36 |
+
f'<div class="circle {color_class}" style="margin-left: -{overlap * i}px;"></div>'
|
37 |
+
for i in range(num_circles)
|
38 |
])
|
39 |
|
40 |
cloud_button_html = f"""
|
|
|
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=40)
|
97 |
+
cloud_button("This is a longer piece of text", color="2", overlap=60)
|
98 |
+
cloud_button("This is an even longer piece of text to test the cloud button", color="3", overlap=80)
|
99 |
|
100 |
|
101 |
def load_pdf(file_path):
|