Maryam Ilka commited on
Commit
e6f1315
·
verified ·
1 Parent(s): 3b3f9b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +81 -13
app.py CHANGED
@@ -163,6 +163,54 @@ st.markdown("""
163
  .stApp {
164
  background-color: white !important;
165
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  </style>
167
  """, unsafe_allow_html=True)
168
 
@@ -427,23 +475,43 @@ def map_view():
427
 
428
  show_explanation(st.session_state.scenario_type)
429
 
430
- # دکمه‌های جدید با استایل‌های سفارشی
431
  col1, col2 = st.columns(2)
432
  with col1:
433
- if st.button("درخواست راهیار", key="accept_btn",
434
- help="برای تایید قیمت و درخواست سفر کلیک کنید",
435
- use_container_width=True):
436
- st.session_state.price_accepted = 1
437
- st.session_state.current_page = "transparency_questions"
438
- st.rerun()
 
 
 
439
 
440
  with col2:
441
- if st.button("رد قیمت", key="reject_btn",
442
- help="برای رد قیمت و ادامه به سوالات کلیک کنید",
443
- use_container_width=True):
444
- st.session_state.price_accepted = 0
445
- st.session_state.current_page = "transparency_questions"
446
- st.rerun()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
447
 
448
  def transparency_questions():
449
  """سوالات شفافیت"""
 
163
  .stApp {
164
  background-color: white !important;
165
  }
166
+ /* استایل دکمه درخواست راهیار */
167
+ .rahyar-request-btn {
168
+ background-color: #6a0dad !important;
169
+ color: white !important;
170
+ border: none !important;
171
+ padding: 14px 28px !important;
172
+ border-radius: 12px !important;
173
+ font-weight: bold !important;
174
+ font-size: 16px !important;
175
+ cursor: pointer;
176
+ transition: all 0.3s ease;
177
+ margin: 10px auto;
178
+ width: 100%;
179
+ box-shadow: 0 4px 8px rgba(0,0,0,0.1);
180
+ background-image: linear-gradient(to right, #8e44ad, #6a0dad);
181
+ border: 2px solid #6a0dad !important;
182
+ }
183
+
184
+ .rahyar-request-btn:hover {
185
+ background-image: linear-gradient(to right, #9b59b6, #7b1fa2) !important;
186
+ transform: translateY(-2px);
187
+ box-shadow: 0 6px 12px rgba(0,0,0,0.15);
188
+ }
189
+
190
+ /* استایل دکمه رد قیمت */
191
+ .rahyar-reject-btn {
192
+ background-color: white !important;
193
+ color: #6a0dad !important;
194
+ border: 2px solid #6a0dad !important;
195
+ padding: 14px 28px !important;
196
+ border-radius: 12px !important;
197
+ font-weight: bold !important;
198
+ font-size: 16px !important;
199
+ cursor: pointer;
200
+ transition: all 0.3s ease;
201
+ margin: 10px auto;
202
+ width: 100%;
203
+ box-shadow: 0 4px 8px rgba(0,0,0,0.1);
204
+ background-image: linear-gradient(to right, #ffffff, #f9f9f9);
205
+ }
206
+
207
+ .rahyar-reject-btn:hover {
208
+ background-image: linear-gradient(to right, #f9f9f9, #f0f0f0) !important;
209
+ color: #8e44ad !important;
210
+ border: 2px solid #8e44ad !important;
211
+ transform: translateY(-2px);
212
+ box-shadow: 0 6px 12px rgba(0,0,0,0.15);
213
+ }
214
  </style>
215
  """, unsafe_allow_html=True)
216
 
 
475
 
476
  show_explanation(st.session_state.scenario_type)
477
 
 
478
  col1, col2 = st.columns(2)
479
  with col1:
480
+ # دکمه درخواست راهیار
481
+ st.markdown("""
482
+ <button class="rahyar-request-btn" onclick="acceptPrice()">
483
+ <span style="display: flex; align-items: center; justify-content: center;">
484
+ <span style="margin-left: 8px;">🚖</span>
485
+ <span>درخواست راهیار</span>
486
+ </span>
487
+ </button>
488
+ """, unsafe_allow_html=True)
489
 
490
  with col2:
491
+ # دکمه رد قیمت
492
+ st.markdown("""
493
+ <button class="rahyar-reject-btn" onclick="rejectPrice()">
494
+ <span style="display: flex; align-items: center; justify-content: center;">
495
+ <span style="margin-left: 8px;">✖</span>
496
+ <span>رد قیمت</span>
497
+ </span>
498
+ </button>
499
+ """, unsafe_allow_html=True)
500
+
501
+ # اسکریپت برای مدیریت کلیک دکمه‌ها
502
+ st.markdown("""
503
+ <script>
504
+ function acceptPrice() {
505
+ window.streamlitSessionState.set({"price_accepted": 1});
506
+ window.streamlitSessionState.set({"current_page": "transparency_questions"});
507
+ }
508
+ function rejectPrice() {
509
+ window.streamlitSessionState.set({"price_accepted": 0});
510
+ window.streamlitSessionState.set({"current_page": "transparency_questions"});
511
+ }
512
+ </script>
513
+ """, unsafe_allow_html=True)
514
+
515
 
516
  def transparency_questions():
517
  """سوالات شفافیت"""