Wajahat698 commited on
Commit
5a2965f
·
verified ·
1 Parent(s): 2b1dc8c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +59 -2
app.py CHANGED
@@ -824,15 +824,72 @@ def side():
824
  brand_save = st.text_input("Brand/Product/Person", key="brand_input_save")
825
  trust_builder_text = st.text_area("Type/paste Trust Builder®", key="trust_builder_text")
826
  trust_buckets = ["Stability", "Development", "Relationship", "Benefit", "Vision", "Competence"]
827
- selected_save_bucket = st.selectbox("Choose Trust Bucket to Save", trust_buckets, key="save_bucket")
828
 
829
- if st.button("Save TrustBuilder", key="save_trustbuilder"):
830
  if trust_builder_text.strip() and selected_save_bucket:
831
  content_to_save = f"{selected_save_bucket}: Brand: {brand_save.strip()} | {trust_builder_text.strip()}"
832
  save_content(st.session_state.get("wix_user_id"), content_to_save)
833
  else:
834
  st.warning("Please fill all fields")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
835
 
 
 
 
836
 
837
 
838
 
 
824
  brand_save = st.text_input("Brand/Product/Person", key="brand_input_save")
825
  trust_builder_text = st.text_area("Type/paste Trust Builder®", key="trust_builder_text")
826
  trust_buckets = ["Stability", "Development", "Relationship", "Benefit", "Vision", "Competence"]
827
+ selected_save_bucket = st.selectbox("Allocate to®", trust_buckets, key="save_bucket")
828
 
829
+ if st.button("Allocate", key="save_trustbuilder"):
830
  if trust_builder_text.strip() and selected_save_bucket:
831
  content_to_save = f"{selected_save_bucket}: Brand: {brand_save.strip()} | {trust_builder_text.strip()}"
832
  save_content(st.session_state.get("wix_user_id"), content_to_save)
833
  else:
834
  st.warning("Please fill all fields")
835
+
836
+
837
+ tooltip_css = """
838
+ <style>
839
+ .tooltip {
840
+ position: relative;
841
+ display: inline-block;
842
+ }
843
+
844
+ .tooltip .tooltiptext {
845
+ visibility: hidden;
846
+ width: 250px;
847
+ background-color: #f9f9f9;
848
+ color: #333;
849
+ text-align: center;
850
+ border-radius: 8px;
851
+ padding: 10px;
852
+ box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
853
+ position: absolute;
854
+ z-index: 1;
855
+ bottom: 125%; /* Position above the button */
856
+ left: 50%;
857
+ margin-left: -125px;
858
+ opacity: 0;
859
+ transition: opacity 0.3s;
860
+ }
861
+
862
+ .tooltip:hover .tooltiptext {
863
+ visibility: visible;
864
+ opacity: 1;
865
+ }
866
+ </style>
867
+ """
868
+
869
+ # Inject CSS
870
+ st.markdown(tooltip_css, unsafe_allow_html=True)
871
+
872
+ # Button with tooltip
873
+ tooltip_html = """
874
+ <div class="tooltip">
875
+ <button style="padding: 10px 20px; font-size: 16px; cursor: pointer;">LetAI Allocate</button>
876
+ <span class="tooltiptext">
877
+ <b>Here's how to save your TrustBuilder:</b><br><br>
878
+ 1. If you already know the TrustBucket, write your command in this format:<br>
879
+ <code>Save this as a TrustBuilder. Stability. This is the text.</code><br><br>
880
+ 2. If unsure, ask AI:<br>
881
+ <i>"Hey, which TrustBucket does this TrustBuilder belong to?"</i><br><br>
882
+ 3. Save it using:<br>
883
+ <code>Save this as a TrustBuilder. [BucketName]. [TrustBuilder Text]</code><br><br>
884
+ Example:<br>
885
+ <code>Save this as a TrustBuilder. Stability. We focus on keeping and nurturing our team.</code>
886
+ </span>
887
+ </div>
888
+ """
889
 
890
+ # Display tooltip button
891
+ st.markdown(tooltip_html, unsafe_allow_html=True)
892
+
893
 
894
 
895