Wajahat698 commited on
Commit
546b9d7
·
verified ·
1 Parent(s): 446ba55

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +31 -31
app.py CHANGED
@@ -838,59 +838,63 @@ def side():
838
  # CSS for "AI Allocate" Button with Tooltip
839
  tooltip_css = """
840
  <style>
841
- .tooltip {
 
842
  position: relative;
843
  display: inline-block;
844
- margin: 0;
845
- text-align: center;
846
  }
847
- .tooltip .tooltiptext {
 
 
848
  visibility: hidden;
849
- width: 300px; /* Tooltip width */
850
  background-color: #f9f9f9;
851
  color: #333;
852
  text-align: left;
853
  border-radius: 8px;
854
  padding: 10px;
855
- box-shadow: 0px 4px 8px rgba(0,0,0,0.1);
856
  position: absolute;
857
  z-index: 1;
858
- bottom: 125%; /* Position tooltip above the button */
859
  left: 50%;
860
  transform: translateX(-50%);
861
  opacity: 0;
862
  transition: opacity 0.3s;
863
  }
864
- .tooltip:hover .tooltiptext {
 
 
865
  visibility: visible;
866
  opacity: 1;
867
  }
868
- .tooltip button {
869
- all: unset;
870
- background-color: rgb(82, 129, 134); /* Custom button background */
871
- color: white; /* White text */
 
872
  border: none;
873
- padding: 10px 20px;
874
- font-size: 16px;
875
- font-family: Arial, sans-serif;
876
- border-radius: 8px;
877
  cursor: pointer;
878
- box-shadow: 0px 4px 8px rgba(0,0,0,0.1);
879
- text-align: center;
880
  }
881
- .tooltip button:hover {
882
- background-color: rgb(70, 115, 119); /* Darker shade for hover effect */
 
883
  }
884
  </style>
885
  """
886
-
887
- # Inject the tooltip CSS
888
  st.markdown(tooltip_css, unsafe_allow_html=True)
889
-
890
- # Tooltip button
891
  tooltip_html = """
892
- <div class="tooltip">
893
- <button>AI Allocate</button>
894
  <span class="tooltiptext">
895
  <b>Let AI help you allocate the TrustBuilder®:</b><br><br>
896
  1. AI will analyze the TrustBuilder® text.<br>
@@ -900,12 +904,8 @@ def side():
900
  </div>
901
  """
902
  st.markdown(tooltip_html, unsafe_allow_html=True)
 
903
 
904
-
905
-
906
-
907
-
908
-
909
 
910
 
911
 
 
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>
 
904
  </div>
905
  """
906
  st.markdown(tooltip_html, unsafe_allow_html=True)
907
+
908
 
 
 
 
 
 
909
 
910
 
911