Anne31415 commited on
Commit
35a5f8c
·
1 Parent(s): 468b1f8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py CHANGED
@@ -24,6 +24,25 @@ 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 ""
 
24
  pdf_file_path = "Private_Book/KOMBI_all2.pdf" # Replace with your PDF file path
25
 
26
 
27
+ # Define a Streamlit component to display cloud-shaped text
28
+ def cloud_text(text_content):
29
+ cloud_html = f"""
30
+ <div style="position: relative; background-color: #FFA07A; border-radius: 20px; padding: 10px; width: fit-content;">
31
+ <div style="position: relative; z-index: 2;">{text_content}</div>
32
+ <div style="position: absolute; top: -5px; left: 10px; width: 0; height: 0; border-left: 20px solid transparent; border-right: 20px solid transparent; border-bottom: 20px solid #FFA07A;"></div>
33
+ </div>
34
+ """
35
+ st.markdown(cloud_html, unsafe_allow_html=True)
36
+
37
+ # Example usage
38
+ text1 = "This is a short text."
39
+ text2 = "This is a longer piece of text to test the cloud shape."
40
+
41
+ cloud_text(text1)
42
+ cloud_text(text2)
43
+
44
+
45
+
46
  def cloud_button(label, key=None, color=None):
47
  button_id = f"cloud-button-{key or label}"
48
  color_class = f"color-{color}" if color else ""