Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -771,67 +771,65 @@ def create_likert_question(question, key, scale_type="5point"):
|
|
| 771 |
""",
|
| 772 |
unsafe_allow_html=True
|
| 773 |
)
|
|
|
|
| 774 |
|
|
|
|
|
|
|
| 775 |
st.markdown("""
|
| 776 |
<style>
|
| 777 |
-
|
| 778 |
-
|
| 779 |
-
|
| 780 |
-
|
| 781 |
-
|
| 782 |
-
|
| 783 |
-
|
| 784 |
-
|
| 785 |
-
|
| 786 |
-
|
| 787 |
-
|
| 788 |
-
|
| 789 |
-
|
| 790 |
-
|
| 791 |
-
|
| 792 |
-
|
| 793 |
-
|
| 794 |
-
|
| 795 |
-
|
| 796 |
-
|
| 797 |
-
|
| 798 |
-
|
| 799 |
-
|
| 800 |
-
|
| 801 |
-
|
| 802 |
-
|
| 803 |
-
|
| 804 |
-
|
| 805 |
-
|
| 806 |
-
|
| 807 |
-
|
| 808 |
-
|
| 809 |
-
|
| 810 |
-
|
| 811 |
-
|
| 812 |
-
|
| 813 |
-
|
| 814 |
-
|
| 815 |
-
|
| 816 |
-
|
| 817 |
-
|
| 818 |
-
|
| 819 |
-
|
| 820 |
-
|
| 821 |
-
|
| 822 |
-
|
| 823 |
-
|
| 824 |
-
|
| 825 |
-
|
| 826 |
-
|
| 827 |
-
|
| 828 |
-
}
|
| 829 |
</style>
|
| 830 |
""", unsafe_allow_html=True)
|
| 831 |
-
|
| 832 |
-
return value
|
| 833 |
-
|
| 834 |
-
# ========== توابع مدیریت دادهها ==========
|
| 835 |
def get_credentials():
|
| 836 |
"""دریافت اعتبارنامه از Secrets"""
|
| 837 |
try:
|
|
@@ -1425,6 +1423,8 @@ def thank_you_page():
|
|
| 1425 |
|
| 1426 |
# ========== مدیریت وضعیت و صفحهبندی ==========
|
| 1427 |
def main():
|
|
|
|
|
|
|
| 1428 |
# تشخیص دستگاه
|
| 1429 |
user_agent = st.query_params.get("user_agent", [""])[0]
|
| 1430 |
st.session_state.is_desktop = "mobile" not in user_agent.lower()
|
|
|
|
| 771 |
""",
|
| 772 |
unsafe_allow_html=True
|
| 773 |
)
|
| 774 |
+
return value
|
| 775 |
|
| 776 |
+
# ========== توابع مدیریت دادهها ==========
|
| 777 |
+
def apply_global_styles():
|
| 778 |
st.markdown("""
|
| 779 |
<style>
|
| 780 |
+
/* ===== بازنویسی کامل استایلهای پیشفرض ===== */
|
| 781 |
+
|
| 782 |
+
/* پایهترین سطوح */
|
| 783 |
+
html, body, #root, .stApp {
|
| 784 |
+
direction: rtl !important;
|
| 785 |
+
text-align: right !important;
|
| 786 |
+
font-family: 'B Nazanin' !important;
|
| 787 |
+
overflow-x: hidden !important;
|
| 788 |
+
}
|
| 789 |
+
|
| 790 |
+
/* دکمهها - بالاترین سطح Specificity */
|
| 791 |
+
body .stButton>button,
|
| 792 |
+
body .stButton>button:hover,
|
| 793 |
+
body .stButton>button:focus {
|
| 794 |
+
margin-right: auto !important;
|
| 795 |
+
margin-left: 0 !important;
|
| 796 |
+
float: right !important;
|
| 797 |
+
transform: none !important;
|
| 798 |
+
}
|
| 799 |
+
|
| 800 |
+
/* اسلایدرها - بازنویسی کامل */
|
| 801 |
+
body div[data-testid="stSlider"] > div:first-child,
|
| 802 |
+
body div[data-testid="stSlider"] > div:first-child > div {
|
| 803 |
+
direction: ltr !important;
|
| 804 |
+
background:
|
| 805 |
+
repeating-linear-gradient(
|
| 806 |
+
to right,
|
| 807 |
+
#6a0dad, #6a0dad 3px,
|
| 808 |
+
transparent 3px, transparent calc(20% - 2px),
|
| 809 |
+
#6a0dad calc(20%), #6a0dad calc(20% + 2px),
|
| 810 |
+
transparent calc(20% + 2px), transparent calc(40% - 2px),
|
| 811 |
+
#6a0dad calc(40%), #6a0dad calc(40% + 2px),
|
| 812 |
+
transparent calc(40% + 2px), transparent calc(60% - 2px),
|
| 813 |
+
#6a0dad calc(60%), #6a0dad calc(60% + 2px),
|
| 814 |
+
transparent calc(60% + 2px), transparent calc(80% - 2px),
|
| 815 |
+
#6a0dad calc(80%), #6a0dad calc(80% + 2px)
|
| 816 |
+
),
|
| 817 |
+
linear-gradient(to right, #E6E6FA, #6A0DAD) !important;
|
| 818 |
+
}
|
| 819 |
+
|
| 820 |
+
/* بازنویسی کامل بلوکها */
|
| 821 |
+
body .stHorizontalBlock > div,
|
| 822 |
+
body .stVerticalBlock > div {
|
| 823 |
+
padding-right: 12px !important;
|
| 824 |
+
padding-left: 0 !important;
|
| 825 |
+
}
|
| 826 |
+
|
| 827 |
+
/* مخفی کردن اسکرول افقی */
|
| 828 |
+
body ::-webkit-scrollbar {
|
| 829 |
+
display: none !important;
|
| 830 |
+
}
|
|
|
|
| 831 |
</style>
|
| 832 |
""", unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 833 |
def get_credentials():
|
| 834 |
"""دریافت اعتبارنامه از Secrets"""
|
| 835 |
try:
|
|
|
|
| 1423 |
|
| 1424 |
# ========== مدیریت وضعیت و صفحهبندی ==========
|
| 1425 |
def main():
|
| 1426 |
+
|
| 1427 |
+
apply_global_styles()
|
| 1428 |
# تشخیص دستگاه
|
| 1429 |
user_agent = st.query_params.get("user_agent", [""])[0]
|
| 1430 |
st.session_state.is_desktop = "mobile" not in user_agent.lower()
|