GSMEthesis commited on
Commit
bcf89aa
·
verified ·
1 Parent(s): b995d5a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -17
app.py CHANGED
@@ -752,29 +752,33 @@ def enhanced_likert_scale(question_data):
752
  # استایل‌دهی با HTML - غیرفعال کردن استایل‌های پیش‌فرض دکمه‌ها
753
  st.markdown(f"""
754
  <style>
755
- /* غیرفعال کردن استایل‌های پیش‌فرض دکمه‌های streamlit */
756
- .stButton>button {{
757
  all: unset;
758
- background: none;
759
- border: none;
760
- padding: 0;
761
- margin: 0;
762
- font: inherit;
763
- color: inherit;
 
 
 
 
764
  cursor: pointer;
 
 
765
  }}
766
 
767
- /* غیرفعال کردن افکت‌های hover و active پیش‌فرض */
768
- .stButton>button:hover,
769
- .stButton>button:active {{
770
- background: none !important;
771
- border: none !important;
772
- box-shadow: none !important;
773
  }}
774
 
775
- /* مخفی کردن label دکمه‌ها */
776
- .stButton>button>div>p {{
777
- display: none;
 
778
  }}
779
  </style>
780
  """, unsafe_allow_html=True)
 
752
  # استایل‌دهی با HTML - غیرفعال کردن استایل‌های پیش‌فرض دکمه‌ها
753
  st.markdown(f"""
754
  <style>
755
+ /* استایل‌های اختصاصی فقط برای دکمه‌های لیکرت */
756
+ div[data-testid="column"] .stButton > button {{
757
  all: unset;
758
+ width: 40px;
759
+ height: 40px;
760
+ border-radius: 50%;
761
+ border: 2px solid #6a0dad !important;
762
+ background: { "#6a0dad" if st.session_state[key] is not None else "white" } !important;
763
+ color: { "white" if st.session_state[key] is not None else "#6a0dad" } !important;
764
+ font-weight: bold;
765
+ display: flex;
766
+ align-items: center;
767
+ justify-content: center;
768
  cursor: pointer;
769
+ transition: all 0.3s;
770
+ margin: 0 auto;
771
  }}
772
 
773
+ div[data-testid="column"] .stButton > button:hover {{
774
+ transform: scale(1.1);
775
+ background: #f0e6ff !important;
 
 
 
776
  }}
777
 
778
+ /* فقط برای دکمه‌های انتخاب شده */
779
+ div[data-testid="column"] .stButton > button:has(> div > p:contains('•')) {{
780
+ background: #6a0dad !important;
781
+ color: white !important;
782
  }}
783
  </style>
784
  """, unsafe_allow_html=True)