GSMEthesis commited on
Commit
100abeb
·
verified ·
1 Parent(s): ece7f3b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +37 -17
app.py CHANGED
@@ -752,7 +752,7 @@ def enhanced_likert_scale(question_data):
752
  # استایل‌دهی با HTML - غیرفعال کردن استایل‌های پیش‌فرض دکمه‌ها
753
  st.markdown(f"""
754
  <style>
755
- /* غیرفعال کردن تمام استایل‌های قبلی فقط برای دکمه‌های لیکرت */
756
  div[data-testid="column"] .stButton > button {{
757
  all: unset !important;
758
  min-height: 0 !important;
@@ -762,34 +762,54 @@ def enhanced_likert_scale(question_data):
762
  box-shadow: none !important;
763
  background: none !important;
764
  border: none !important;
 
 
 
765
  }}
766
- /* استایل‌های اختصاصی فقط برای دکمه‌های لیکرت */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
767
  div[data-testid="column"] .stButton > button {{
768
- all: unset;
769
- width: 40px;
770
- height: 40px;
771
- border-radius: 50%;
772
  border: 2px solid #6a0dad !important;
773
- background: { "#6a0dad" if st.session_state[key] is not None else "white" } !important;
774
- color: { "white" if st.session_state[key] is not None else "#6a0dad" } !important;
775
- font-weight: bold;
776
- display: flex;
777
- align-items: center;
778
- justify-content: center;
779
- cursor: pointer;
780
- transition: all 0.3s;
781
- margin: 0 auto;
782
  }}
783
 
 
784
  div[data-testid="column"] .stButton > button:hover {{
785
- transform: scale(1.1);
786
  background: #f0e6ff !important;
 
787
  }}
788
 
789
- /* فقط برای دکمه‌های انتخاب شده */
790
  div[data-testid="column"] .stButton > button:has(> div > p:contains('•')) {{
791
  background: #6a0dad !important;
792
  color: white !important;
 
793
  }}
794
  </style>
795
  """, unsafe_allow_html=True)
 
752
  # استایل‌دهی با HTML - غیرفعال کردن استایل‌های پیش‌فرض دکمه‌ها
753
  st.markdown(f"""
754
  <style>
755
+ /* غیرفعال کردن کامل تمام استایل‌های قبلی فقط برای دکمه‌های لیکرت */
756
  div[data-testid="column"] .stButton > button {{
757
  all: unset !important;
758
  min-height: 0 !important;
 
762
  box-shadow: none !important;
763
  background: none !important;
764
  border: none !important;
765
+ color: inherit !important;
766
+ font: inherit !important;
767
+ cursor: pointer !important;
768
  }}
769
+
770
+ /* حذف افکت‌های hover و active پیشفرض */
771
+ div[data-testid="column"] .stButton > button:hover,
772
+ div[data-testid="column"] .stButton > button:active,
773
+ div[data-testid="column"] .stButton > button:focus {{
774
+ background: none !important;
775
+ border: none !important;
776
+ box-shadow: none !important;
777
+ transform: none !important;
778
+ }}
779
+
780
+ /* مخفی کردن label دکمه‌ها */
781
+ div[data-testid="column"] .stButton > button > div > p {{
782
+ display: none !important;
783
+ }}
784
+
785
+ /* استایل‌های جدید فقط برای دکمه‌های لیکرت */
786
  div[data-testid="column"] .stButton > button {{
787
+ width: 40px !important;
788
+ height: 40px !important;
789
+ border-radius: 50% !important;
 
790
  border: 2px solid #6a0dad !important;
791
+ background: white !important;
792
+ color: #6a0dad !important;
793
+ font-weight: bold !important;
794
+ display: flex !important;
795
+ align-items: center !important;
796
+ justify-content: center !important;
797
+ cursor: pointer !important;
798
+ transition: all 0.3s !important;
799
+ margin: 0 auto !important;
800
  }}
801
 
802
+ /* استایل hover برای دکمه‌های لیکرت */
803
  div[data-testid="column"] .stButton > button:hover {{
 
804
  background: #f0e6ff !important;
805
+ transform: scale(1.1) !important;
806
  }}
807
 
808
+ /* استایل دکمه انتخاب شده */
809
  div[data-testid="column"] .stButton > button:has(> div > p:contains('•')) {{
810
  background: #6a0dad !important;
811
  color: white !important;
812
+ box-shadow: 0 0 10px rgba(106,13,173,0.5) !important;
813
  }}
814
  </style>
815
  """, unsafe_allow_html=True)