Wajahat698 commited on
Commit
ac0e33e
·
verified ·
1 Parent(s): b5b8856

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +50 -49
app.py CHANGED
@@ -837,55 +837,56 @@ def side():
837
 
838
 
839
  tooltip_css = """
840
- <style>
841
- .tooltip-container {
842
- position: relative;
843
- display: inline-block;
844
- vertical-align: top;
845
- margin-top: -15px;
846
- }
847
-
848
-
849
-
850
- .tooltip-container .tooltiptext {
851
- visibility: hidden;
852
- max-width: auto; /* 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: 1000; /* Ensure tooltip is above other elements */
861
- top: 100%; /* Position below the button */
862
- left: 50%; /* Center horizontally */
863
- transform: translateX(-50%);
864
- opacity: 0;
865
- transition: opacity 0.3s ease-in-out;
866
- }
867
- .tooltip-container:hover .tooltiptext {
868
- visibility: visible;
869
- opacity: 1;
870
- }
871
-
872
- .tooltip-container button {
873
- background-color: rgb(82, 129, 134);
874
- color: white;
875
- border: none;
876
- padding: 8px 16px;
877
- font-size: 14px;
878
- border-radius: 5px;
879
- cursor: pointer;
880
- box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
881
- font-family: Arial, sans-serif;
882
- }
883
-
884
- .tooltip-container button:hover {
885
- background-color: rgb(70, 115, 119);
886
- }
887
- </style>
888
- """
 
889
 
890
  # Inject CSS
891
  st.markdown(tooltip_css, unsafe_allow_html=True)
 
837
 
838
 
839
  tooltip_css = """
840
+ <style>
841
+ .tooltip-container {
842
+ position: relative;
843
+ display: inline-block;
844
+ vertical-align: top;
845
+ margin-top: -15px;
846
+ }
847
+
848
+ .tooltip-container .tooltiptext {
849
+ visibility: hidden;
850
+ max-width: 90%; /* Tooltip width based on parent container */
851
+ width: auto; /* Automatically adjust width */
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: 1000; /* Ensure tooltip is above other elements */
860
+ top: 100%; /* Position below the button */
861
+ left: 50%; /* Center horizontally */
862
+ transform: translateX(-50%);
863
+ opacity: 0;
864
+ transition: opacity 0.3s ease-in-out;
865
+ word-wrap: break-word; /* Ensure long text wraps */
866
+ }
867
+ .tooltip-container:hover .tooltiptext {
868
+ visibility: visible;
869
+ opacity: 1;
870
+ }
871
+
872
+ .tooltip-container button {
873
+ background-color: rgb(82, 129, 134);
874
+ color: white;
875
+ border: none;
876
+ padding: 8px 16px;
877
+ font-size: 14px;
878
+ border-radius: 5px;
879
+ cursor: pointer;
880
+ box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
881
+ font-family: Arial, sans-serif;
882
+ }
883
+
884
+ .tooltip-container button:hover {
885
+ background-color: rgb(70, 115, 119);
886
+ }
887
+ </style>
888
+ """
889
+
890
 
891
  # Inject CSS
892
  st.markdown(tooltip_css, unsafe_allow_html=True)