Wajahat698 commited on
Commit
25c3fbe
·
verified ·
1 Parent(s): 546b9d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +68 -62
app.py CHANGED
@@ -835,78 +835,84 @@ def side():
835
  st.warning("Please fill all fields")
836
 
837
  with col2:
838
- # CSS for "AI Allocate" Button with Tooltip
839
  tooltip_css = """
840
- <style>
841
- /* Container for tooltip and button */
842
- .tooltip-container {
843
- position: relative;
844
- display: inline-block;
845
- vertical-align: top; /* Aligns with st.button */
846
- margin-top: -5px; /* Adjust alignment with st.button */
847
- }
848
-
849
- /* Tooltip text */
850
- .tooltip-container .tooltiptext {
851
- visibility: hidden;
852
- max-width: 250px; /* Tooltip width */
853
- background-color: #f9f9f9;
854
- color: #333;
855
- text-align: left;
856
- border-radius: 8px;
857
- padding: 10px;
858
- box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
859
- position: absolute;
860
- z-index: 1;
861
- bottom: 120%; /* Position above the button */
862
- left: 50%;
863
- transform: translateX(-50%);
864
- opacity: 0;
865
- transition: opacity 0.3s;
866
- }
867
-
868
- /* Show tooltip on hover */
869
- .tooltip-container:hover .tooltiptext {
870
- visibility: visible;
871
- opacity: 1;
872
- }
873
-
874
- /* "LetAI Allocate" Button */
875
- .tooltip-container button {
876
- background-color: rgb(82, 129, 134);
877
- color: white;
878
- border: none;
879
- padding: 8px 16px;
880
- font-size: 14px;
881
- border-radius: 5px;
882
- cursor: pointer;
883
- box-shadow: 0px 4px 8px rgba(0,0,0,0.2);
884
- font-family: Arial, sans-serif;
885
- }
886
-
887
- .tooltip-container button:hover {
888
- background-color: rgb(70, 115, 119);
889
- }
890
- </style>
891
- """
892
-
893
- # Inject the CSS
 
 
894
  st.markdown(tooltip_css, unsafe_allow_html=True)
895
  tooltip_html = """
896
  <div class="tooltip-container">
897
  <button>LetAI Allocate</button>
898
  <span class="tooltiptext">
899
- <b>Let AI help you allocate the TrustBuilder®:</b><br><br>
900
- 1. AI will analyze the TrustBuilder® text.<br>
901
- 2. It will suggest the most appropriate TrustBucket®.<br>
902
- 3. Confirm or edit the bucket and save the result.<br>
 
 
 
 
903
  </span>
904
  </div>
905
  """
906
  st.markdown(tooltip_html, unsafe_allow_html=True)
907
-
908
-
909
-
 
910
 
911
 
912
  side()
 
835
  st.warning("Please fill all fields")
836
 
837
  with col2:
 
838
  tooltip_css = """
839
+ <style>
840
+ /* Align buttons in the same row and size */
841
+ .tooltip-container {
842
+ position: relative;
843
+ display: inline-block;
844
+ vertical-align: top; /* Align with st.button */
845
+ margin-top: -4px; /* Fine-tune alignment */
846
+ }
847
+
848
+ /* Tooltip text styling */
849
+ .tooltip-container .tooltiptext {
850
+ visibility: hidden;
851
+ max-width: 300px; /* Ensure tooltip fits */
852
+ background-color: #f9f9f9;
853
+ color: #333;
854
+ text-align: left;
855
+ border-radius: 8px;
856
+ padding: 10px;
857
+ box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
858
+ position: absolute;
859
+ z-index: 1;
860
+ bottom: 120%; /* Position tooltip above the button */
861
+ left: 50%;
862
+ transform: translateX(-50%);
863
+ opacity: 0;
864
+ transition: opacity 0.3s ease-in-out;
865
+ }
866
+
867
+ /* Show tooltip on hover */
868
+ .tooltip-container:hover .tooltiptext {
869
+ visibility: visible;
870
+ opacity: 1;
871
+ }
872
+
873
+ /* Button styling (match Allocate button) */
874
+ .tooltip-container button {
875
+ background-color: rgb(82, 129, 134); /* Match Allocate button */
876
+ color: white;
877
+ border: none;
878
+ padding: 8px 16px;
879
+ font-size: 14px;
880
+ border-radius: 5px;
881
+ cursor: pointer;
882
+ box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
883
+ font-family: Arial, sans-serif;
884
+ display: inline-block;
885
+ vertical-align: middle;
886
+ }
887
+
888
+ .tooltip-container button:hover {
889
+ background-color: rgb(70, 115, 119); /* Slightly darker on hover */
890
+ }
891
+ </style>
892
+ """
893
+
894
+ # Inject CSS
895
  st.markdown(tooltip_css, unsafe_allow_html=True)
896
  tooltip_html = """
897
  <div class="tooltip-container">
898
  <button>LetAI Allocate</button>
899
  <span class="tooltiptext">
900
+ <b>Here’s how you can save your TrustBuilder®:</b><br><br>
901
+ 1. Type your TrustBuilder® in the chat.<br>
902
+ 2. If unsure of the TrustBucket®, ask the AI:<br>
903
+ <i>"Hey, which TrustBucket does this TrustBuilder® belong to?"</i><br><br>
904
+ 3. Save it using the following format:<br>
905
+ <code>Save this as a TrustBuilder. [BucketName]. [TrustBuilder Text]</code><br><br>
906
+ Example:<br>
907
+ <code>Save this as a TrustBuilder. Stability. We focus on keeping and nurturing our team.</code>
908
  </span>
909
  </div>
910
  """
911
  st.markdown(tooltip_html, unsafe_allow_html=True)
912
+
913
+
914
+
915
+
916
 
917
 
918
  side()