GSMEthesis commited on
Commit
7b9125d
·
verified ·
1 Parent(s): ca68bb2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -5
app.py CHANGED
@@ -773,8 +773,10 @@ body, .stApp {
773
  """, unsafe_allow_html=True)
774
 
775
  # ========== توابع اصلی ==========
 
 
776
  def enhanced_likert_scale(question_data):
777
- """لیکرت اسکیل با st.radio و استایل ساده بدون کادر بنفش"""
778
  question = question_data["question"]
779
  key = question_data["key"]
780
  scale = question_data["scale"]
@@ -843,12 +845,17 @@ def enhanced_likert_scale(question_data):
843
  max-width: 475px;
844
  margin: 0 auto;
845
  padding: 0;
846
- background: none; /* حذف کادر بنفش */
847
- height: 0; /* حذف ارتفاع خط */
848
  }
849
  [data-testid="stRadio"] input[type="radio"] {
850
- display: none !important; /* مخفی کردن دایره سفید */
 
 
 
 
851
  }
 
852
  [data-testid="stRadio"] label {
853
  width: 18px !important;
854
  height: 18px !important;
@@ -857,7 +864,7 @@ def enhanced_likert_scale(question_data):
857
  border: 2px solid #6a0dad !important;
858
  margin: 0 !important;
859
  position: relative;
860
- top: 0; /* تنظیم موقعیت برای وسط بودن */
861
  cursor: pointer;
862
  transition: background-color 0.1s;
863
  }
 
773
  """, unsafe_allow_html=True)
774
 
775
  # ========== توابع اصلی ==========
776
+ import streamlit as st
777
+
778
  def enhanced_likert_scale(question_data):
779
+ """لیکرت اسکیل با st.radio و استایل ساده بدون دکمه‌های اضافی"""
780
  question = question_data["question"]
781
  key = question_data["key"]
782
  scale = question_data["scale"]
 
845
  max-width: 475px;
846
  margin: 0 auto;
847
  padding: 0;
848
+ background: none;
849
+ height: 0;
850
  }
851
  [data-testid="stRadio"] input[type="radio"] {
852
+ display: none !important;
853
+ }
854
+ /* مخفی کردن همه labelهای پیش‌فرض که استایل سفارشی ندارن */
855
+ [data-testid="stRadio"] label:not([style*="width: 18px"]) {
856
+ display: none !important;
857
  }
858
+ /* استایل نقاط سفارشی */
859
  [data-testid="stRadio"] label {
860
  width: 18px !important;
861
  height: 18px !important;
 
864
  border: 2px solid #6a0dad !important;
865
  margin: 0 !important;
866
  position: relative;
867
+ top: 0;
868
  cursor: pointer;
869
  transition: background-color 0.1s;
870
  }