Anne31415 commited on
Commit
744d5b3
·
1 Parent(s): d8aed6a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -16
app.py CHANGED
@@ -29,14 +29,10 @@ def cloud_button(label, key=None, color=None):
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
- # Create circles for left, middle, and right
34
  circles_html = ''.join([
35
- f'<div class="circle left {color_class}"></div>' for _ in range(num_circles // 2)
36
- ])
37
- circles_html += f'<div class="text">{label}</div>'
38
- circles_html += ''.join([
39
- f'<div class="circle right {color_class}"></div>' for _ in range(num_circles // 2)
40
  ])
41
 
42
  cloud_button_html = f"""
@@ -59,11 +55,6 @@ def cloud_button(label, key=None, color=None):
59
  position: relative;
60
  padding: 10px 20px;
61
  }}
62
- .text {{
63
- position: relative;
64
- font-weight: bold;
65
- z-index: 2;
66
- }}
67
  .circle {{
68
  background-color: #FF6347;
69
  border-radius: 50%;
@@ -71,8 +62,13 @@ def cloud_button(label, key=None, color=None):
71
  height: {circle_size}px;
72
  position: relative;
73
  }}
74
- .circle.left, .circle.right {{
75
- margin: 0 5px; /* Adjust the margin as needed */
 
 
 
 
 
76
  }}
77
  .color-1 .circle {{ background-color: #FFA07A; }}
78
  .color-2 .circle {{ background-color: #FF7F50; }}
@@ -92,8 +88,6 @@ cloud_button("This is a longer piece of text", color="2")
92
  cloud_button("This is an even longer piece of text to test the cloud button", color="3")
93
 
94
 
95
-
96
-
97
  def load_pdf(file_path):
98
  pdf_reader = PdfReader(file_path)
99
  text = ""
 
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
+ # Create circles with text enclosed
34
  circles_html = ''.join([
35
+ f'<div class="circle {color_class}"><div class="circle-text">{label}</div></div>' for _ in range(num_circles)
 
 
 
 
36
  ])
37
 
38
  cloud_button_html = f"""
 
55
  position: relative;
56
  padding: 10px 20px;
57
  }}
 
 
 
 
 
58
  .circle {{
59
  background-color: #FF6347;
60
  border-radius: 50%;
 
62
  height: {circle_size}px;
63
  position: relative;
64
  }}
65
+ .circle-text {{
66
+ position: absolute;
67
+ top: 50%;
68
+ left: 50%;
69
+ transform: translate(-50%, -50%);
70
+ font-weight: bold;
71
+ z-index: 2;
72
  }}
73
  .color-1 .circle {{ background-color: #FFA07A; }}
74
  .color-2 .circle {{ background-color: #FF7F50; }}
 
88
  cloud_button("This is an even longer piece of text to test the cloud button", color="3")
89
 
90
 
 
 
91
  def load_pdf(file_path):
92
  pdf_reader = PdfReader(file_path)
93
  text = ""