GSMEthesis commited on
Commit
eebc3ed
·
verified ·
1 Parent(s): 84c4e1c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +212 -59
app.py CHANGED
@@ -19,7 +19,218 @@ SHEET_NAME = "Condition1"
19
  # ========== استایل‌های سفارشی یکپارچه ==========
20
  st.markdown("""
21
  <style>
22
- /* تنظیمات برای موبایل */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  @media (max-width: 768px) {
24
  /* اجبار نمایش تمام صفحه به اندازه موبایل */
25
  html, body, .stApp {
@@ -33,20 +244,6 @@ st.markdown("""
33
  height: 300px !important; /* ارتفاع نقشه در موبایل */
34
  }
35
 
36
- /* تغییرات برای بخش‌های مختلف برای موبایل */
37
- .stTextInput input,
38
- .stNumberInput input,
39
- .stSelectbox select,
40
- .stTextArea textarea,
41
- .stDateInput input,
42
- .stTimeInput input,
43
- .stMultiSelect div[role="combobox"],
44
- div[data-testid="stVerticalBlock"] > div[data-testid="stHorizontalBlock"] > div > div > div > div > input,
45
- div[data-baseweb="select"] > div:first-child {
46
- font-size: 14px !important;
47
- padding: 12px !important;
48
- }
49
-
50
  /* دکمه‌ها برای موبایل */
51
  .stButton>button,
52
  [data-testid="baseButton-primary"] {
@@ -100,52 +297,8 @@ st.markdown("""
100
  .stSelectbox [role="listbox"] {
101
  font-size: 16px !important;
102
  }
103
-
104
- /* تنظیمات مخصوص موبایل برای آیتم‌ها */
105
- @media (max-width: 768px) {
106
- .stAlert .st-ae {
107
- padding: 12px !important;
108
- font-size: 13px !important;
109
- }
110
-
111
- /* فرم‌ها در موبایل */
112
- .stTextInput>label,
113
- .stNumberInput>label,
114
- .stSelectbox>label {
115
- font-size: 14px !important;
116
- padding: 4px 0 !important;
117
- }
118
-
119
- .stTextInput input,
120
- .stNumberInput input,
121
- .stSelectbox select {
122
- font-size: 16px !important;
123
- padding: 12px !important;
124
- height: auto !important;
125
- }
126
-
127
- .stButton>button {
128
- font-size: 14px !important;
129
- padding: 8px 16px !important;
130
- }
131
-
132
- .stMarkdown h3 {
133
- font-size: 16px !important;
134
- }
135
-
136
- .stMarkdown p {
137
- font-size: 13px !important;
138
- }
139
-
140
- .stSelectbox [role="listbox"] {
141
- font-size: 16px !important;
142
- }
143
- }
144
  }
145
-
146
  </style>
147
-
148
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
149
  """, unsafe_allow_html=True)
150
 
151
 
 
19
  # ========== استایل‌های سفارشی یکپارچه ==========
20
  st.markdown("""
21
  <style>
22
+ @font-face {
23
+ font-family: 'B Nazanin';
24
+ src: url('https://cdn.jsdelivr.net/gh/rastikerdar/fonts@master/fonts/B%20Nazanin/B%20Nazanin.woff') format('woff');
25
+ }
26
+
27
+ :root {
28
+ --primary: #6a0dad;
29
+ --text: #333333;
30
+ --background: #ffffff;
31
+ --border: #dddddd;
32
+ --input-bg: #ffffff;
33
+ --secondary-bg: #f8f9fa;
34
+ --green: #f0ff0;
35
+ --dgreen: #006400;
36
+ }
37
+
38
+ * {
39
+ font-family: 'B Nazanin', 'B Nazanin Bold', sans-serif !important;
40
+ text-align: right !important;
41
+ direction: rtl !important;
42
+ }
43
+
44
+ /* تنظیمات اصلی */
45
+ body, .stApp, [data-testid="stAppViewContainer"] {
46
+ background-color: var(--background) !important;
47
+ color: var(--text) !important;
48
+ }
49
+
50
+ /* هدر راهیار */
51
+ .rahyar-title {
52
+ color: var(--primary) !important;
53
+ margin: 0 !important;
54
+ }
55
+
56
+ .rahyar-subtitle {
57
+ color: var(--primary) !important;
58
+ margin: 0 !important;
59
+ font-size: 14px !important;
60
+ }
61
+
62
+ /* توضیحات */
63
+ .explanation-title {
64
+ color: var(--primary) !important;
65
+ font-weight: bold !important;
66
+ margin: 20px 0 10px 0 !important;
67
+ font-size: 18px !important;
68
+ }
69
+
70
+ .explanation-item {
71
+ background-color: var(--secondary-bg) !important;
72
+ border-radius: 8px !important;
73
+ padding: 12px 15px !important;
74
+ margin: 8px 0 !important;
75
+ border-right: 3px solid var(--primary) !important;
76
+ }
77
+
78
+ /* استایل‌های ورودی */
79
+ .stTextInput input,
80
+ .stNumberInput input,
81
+ .stSelectbox select,
82
+ .stTextArea textarea,
83
+ .stDateInput input,
84
+ .stTimeInput input,
85
+ .stMultiSelect div[role="combobox"],
86
+ div[data-testid="stVerticalBlock"] > div[data-testid="stHorizontalBlock"] > div > div > div > div > input,
87
+ div[data-baseweb="select"] > div:first-child {
88
+ color: var(--text) !important;
89
+ background-color: var(--input-bg) !important;
90
+ border: 1px solid var(--primary) !important;
91
+ border-radius: 6px !important;
92
+ min-height: 40px !important;
93
+ transition: all 0.2s ease !important;
94
+ }
95
+
96
+ /* استایل برای حالت hover و focus */
97
+ .stTextInput input:hover,
98
+ .stNumberInput input:hover,
99
+ .stSelectbox select:hover,
100
+ .stTextArea textarea:hover,
101
+ .stDateInput input:hover,
102
+ .stTimeInput input:hover,
103
+ .stMultiSelect div[role="combobox"]:hover,
104
+ .stTextInput input:focus,
105
+ .stNumberInput input:focus,
106
+ .stSelectbox select:focus,
107
+ .stTextArea textarea:focus,
108
+ .stDateInput input:focus,
109
+ .stTimeInput input:focus {
110
+ border-color: var(--primary) !important;
111
+ box-shadow: 0 0 0 3px rgba(106, 13, 173, 0.15) !important;
112
+ outline: none !important;
113
+ }
114
+
115
+ /* استایل لیبل‌ها */
116
+ .stTextInput > label,
117
+ .stNumberInput > label,
118
+ .stSelectbox > label,
119
+ .stRadio > label,
120
+ .stSlider > label {
121
+ color: var(--text) !important;
122
+ font-weight: bold !important;
123
+ margin-bottom: 8px !important;
124
+ font-size: 14px !important;
125
+ }
126
+
127
+ /* استایل placeholder */
128
+ ::placeholder {
129
+ color: var(--text) !important;
130
+ opacity: 0.5 !important;
131
+ }
132
+
133
+ /* استایل‌های خاص Selectbox */
134
+ div[data-baseweb="select"] > div:first-child {
135
+ -webkit-appearance: none !important;
136
+ -moz-appearance: none !important;
137
+ appearance: none !important;
138
+ background-image: none !important;
139
+ }
140
+
141
+ /* برای اینترنت اکسپلورر */
142
+ div[data-baseweb="select"] > div:first-child::-ms-expand {
143
+ display: none !important;
144
+ }
145
+
146
+ div[data-baseweb="select"] {
147
+ position: relative !important;
148
+ }
149
+
150
+ div[data-baseweb="select"]::after {
151
+ content: "▼";
152
+ position: absolute;
153
+ left: 8px;
154
+ top: 50%;
155
+ transform: translateY(-50%);
156
+ color: var(--primary);
157
+ background-color: white !important;
158
+ font-size: 14px;
159
+ pointer-events: none;
160
+ }
161
+
162
+ /* استایل‌های Number Input */
163
+ .stNumberInput button {
164
+ color: var(--primary) !important;
165
+ background-color: transparent !important;
166
+ border: none !important;
167
+ width: 30px !important;
168
+ font-weight: bold !important;
169
+ }
170
+
171
+ .stNumberInput button:hover {
172
+ background-color: #f0e6ff !important;
173
+ }
174
+
175
+ /* دکمه‌ها */
176
+ .stButton>button,
177
+ [data-testid="baseButton-primary"],
178
+ .accept-btn,
179
+ div[data-testid="stVerticalBlock"] > div[data-testid="stHorizontalBlock"] > div > div > button {
180
+ background-color: var(--primary) !important;
181
+ color: white !important;
182
+ border: none !important;
183
+ border-radius: 8px !important;
184
+ padding: 10px 20px !important;
185
+ font-weight: bold !important;
186
+ transition: all 0.3s ease !important;
187
+ }
188
+
189
+ .stButton>button:hover,
190
+ [data-testid="baseButton-primary"]:hover,
191
+ .accept-btn:hover,
192
+ div[data-testid="stVerticalBlock"] > div[data-testid="stHorizontalBlock"] > div > div > button:hover {
193
+ background-color: #5a0a96 !important;
194
+ transform: translateY(-1px) !important;
195
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
196
+ }
197
+
198
+ /* استایل تضمینی برای رادیو باتن���ها */
199
+ .stRadio > div > div > div > div > div > label,
200
+ .stRadio > div > div > div > div > label,
201
+ .stRadio > div > div > div > label,
202
+ .stRadio > div > div > label,
203
+ .stRadio > div > label,
204
+ .stRadio > label {
205
+ color: #000000 !important;
206
+ }
207
+
208
+ .stRadio span {
209
+ color: #000000 !important;
210
+ }
211
+
212
+ /* استایل برای هشدارها */
213
+ .stAlert .st-ae {
214
+ border-right: 4px solid #ffc107 !important;
215
+ background-color: #fff3cd !important;
216
+ border-radius: 8px !important;
217
+ padding: 16px !important;
218
+ color: #856404 !important;
219
+ }
220
+
221
+ .stAlert .st-af {
222
+ color: #ffc107 !important;
223
+ font-size: 20px !important;
224
+ }
225
+
226
+ .stAlert .st-ag {
227
+ color: #856404 !important;
228
+ font-family: 'B Nazanin' !important;
229
+ font-size: 14px !important;
230
+ margin-right: 8px !important;
231
+ }
232
+
233
+ /* استایل موبایل */
234
  @media (max-width: 768px) {
235
  /* اجبار نمایش تمام صفحه به اندازه موبایل */
236
  html, body, .stApp {
 
244
  height: 300px !important; /* ارتفاع نقشه در موبایل */
245
  }
246
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
247
  /* دکمه‌ها برای موبایل */
248
  .stButton>button,
249
  [data-testid="baseButton-primary"] {
 
297
  .stSelectbox [role="listbox"] {
298
  font-size: 16px !important;
299
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
300
  }
 
301
  </style>
 
 
302
  """, unsafe_allow_html=True)
303
 
304