Maryam Ilka commited on
Commit
cba0734
·
verified ·
1 Parent(s): 37c7d70

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -15
app.py CHANGED
@@ -476,10 +476,10 @@ def demographic_form():
476
  """فرم اطلاعات دموگرافیک"""
477
  st.markdown("""
478
  <style>
479
- /* استایل کلی تمام inputها */
480
- .stNumberInput input,
481
- .stSelectbox select,
482
- .stTextInput input {
483
  color: #333333 !important;
484
  background-color: white !important;
485
  border: 1px solid #6a0dad !important;
@@ -489,20 +489,19 @@ def demographic_form():
489
  }
490
 
491
  /* استایل placeholder */
492
- .stNumberInput input::placeholder,
493
- .stTextInput input::placeholder {
494
  color: #333333 !important;
495
  opacity: 1 !important;
496
  }
497
 
498
  /* استایل dropdown options */
499
- .stSelectbox select option {
500
  color: #333333 !important;
501
  background-color: white !important;
502
  }
503
 
504
  /* استایل دکمه submit */
505
- .stFormSubmitButton button {
506
  background-color: #6a0dad !important;
507
  color: white !important;
508
  border: none !important;
@@ -511,23 +510,31 @@ def demographic_form():
511
  font-family: 'Vazir' !important;
512
  font-weight: bold !important;
513
  transition: all 0.3s ease !important;
 
514
  }
515
 
516
- .stFormSubmitButton button:hover {
517
  background-color: #7b1fa2 !important;
518
  transform: translateY(-2px);
519
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
520
  }
521
 
522
  /* استایل hover برای inputها */
523
- .stNumberInput input:focus,
524
- .stSelectbox select:focus {
525
  border-color: #8e44ad !important;
526
  box-shadow: 0 0 0 2px rgba(106, 13, 173, 0.2) !important;
527
  outline: none !important;
528
  }
 
 
 
 
 
 
529
  </style>
530
  """, unsafe_allow_html=True)
 
531
  with st.form("demographic"):
532
  st.header("📝 اطلاعات دموگرافیک")
533
 
@@ -541,9 +548,7 @@ def demographic_form():
541
  ride_frequency = st.selectbox("دفعات استفاده از سرویس‌های اشتراک سفر در ماه",
542
  ["کمتر از 5 بار", "5-10 بار", "بیش از 10 بار"])
543
 
544
- submit_button = st.form_submit_button("ادامه")
545
-
546
- if submit_button:
547
  st.session_state.demographic_data = {
548
  "age": age,
549
  "gender": gender,
@@ -552,7 +557,7 @@ def demographic_form():
552
  }
553
  st.session_state.current_page = "scenario_explanation"
554
  st.rerun()
555
-
556
  def scenario_explanation():
557
  """توضیح سناریو"""
558
  col1, col2 = st.columns([1, 4])
 
476
  """فرم اطلاعات دموگرافیک"""
477
  st.markdown("""
478
  <style>
479
+ /* استایل کلی تمام inputها و selectها */
480
+ div[data-baseweb="input"] input,
481
+ div[data-baseweb="select"] select,
482
+ div[data-baseweb="textarea"] textarea {
483
  color: #333333 !important;
484
  background-color: white !important;
485
  border: 1px solid #6a0dad !important;
 
489
  }
490
 
491
  /* استایل placeholder */
492
+ div[data-baseweb="input"] input::placeholder {
 
493
  color: #333333 !important;
494
  opacity: 1 !important;
495
  }
496
 
497
  /* استایل dropdown options */
498
+ div[data-baseweb="select"] option {
499
  color: #333333 !important;
500
  background-color: white !important;
501
  }
502
 
503
  /* استایل دکمه submit */
504
+ div[data-testid="stFormSubmitButton"] button {
505
  background-color: #6a0dad !important;
506
  color: white !important;
507
  border: none !important;
 
510
  font-family: 'Vazir' !important;
511
  font-weight: bold !important;
512
  transition: all 0.3s ease !important;
513
+ width: 100% !important;
514
  }
515
 
516
+ div[data-testid="stFormSubmitButton"] button:hover {
517
  background-color: #7b1fa2 !important;
518
  transform: translateY(-2px);
519
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
520
  }
521
 
522
  /* استایل hover برای inputها */
523
+ div[data-baseweb="input"] input:focus,
524
+ div[data-baseweb="select"] select:focus {
525
  border-color: #8e44ad !important;
526
  box-shadow: 0 0 0 2px rgba(106, 13, 173, 0.2) !important;
527
  outline: none !important;
528
  }
529
+
530
+ /* استایل لیبل‌ها */
531
+ .st-emotion-cache-1v0mbdj p {
532
+ color: #333333 !important;
533
+ font-family: 'Vazir' !important;
534
+ }
535
  </style>
536
  """, unsafe_allow_html=True)
537
+
538
  with st.form("demographic"):
539
  st.header("📝 اطلاعات دموگرافیک")
540
 
 
548
  ride_frequency = st.selectbox("دفعات استفاده از سرویس‌های اشتراک سفر در ماه",
549
  ["کمتر از 5 بار", "5-10 بار", "بیش از 10 بار"])
550
 
551
+ if st.button("ادامه", key="continue_btn", type="primary"):
 
 
552
  st.session_state.demographic_data = {
553
  "age": age,
554
  "gender": gender,
 
557
  }
558
  st.session_state.current_page = "scenario_explanation"
559
  st.rerun()
560
+
561
  def scenario_explanation():
562
  """توضیح سناریو"""
563
  col1, col2 = st.columns([1, 4])