Maryam Ilka commited on
Commit
d010eef
·
verified ·
1 Parent(s): 704ba24

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -11
app.py CHANGED
@@ -601,33 +601,36 @@ def attention_check1():
601
  key="att1_radio"
602
  )
603
 
604
- # 2. ایجاد دکمه سبز با JavaScript
605
  st.components.v1.html(f"""
606
  <script>
607
  function handleClick() {{
608
- // فعال کردن دکمه مخفی Streamlit
609
- parent.document.querySelector('div[data-testid="stButton"] > button[kind="primary"]').click();
610
  }}
611
  </script>
612
 
613
- <button onclick="handleClick()" class="custom-green-btn">
614
- ادامه
615
- </button>
616
- """, height=60)
617
- st.components.v1.html(f"""
618
  <button onclick="handleClick()"
619
  style="
620
- background: #28a745;
621
  color: white;
622
  border: none;
623
  border-radius: 8px;
624
  padding: 12px 24px;
625
  width: 100%;
626
  cursor: pointer;
627
- ">
 
 
 
 
 
 
 
 
628
  ادامه
629
  </button>
630
- """, height=60)
631
 
632
 
633
  # 3. منطق اصلی دکمه (مخفی)
 
601
  key="att1_radio"
602
  )
603
 
604
+ # کامپوننت HTML با دکمه سبز اصلی
605
  st.components.v1.html(f"""
606
  <script>
607
  function handleClick() {{
608
+ // ارسال سیگنال به Streamlit
609
+ parent.document.dispatchEvent(new CustomEvent('green_btn_clicked'));
610
  }}
611
  </script>
612
 
 
 
 
 
 
613
  <button onclick="handleClick()"
614
  style="
615
+ background-color: #28a745;
616
  color: white;
617
  border: none;
618
  border-radius: 8px;
619
  padding: 12px 24px;
620
  width: 100%;
621
  cursor: pointer;
622
+ font-family: 'Vazir', sans-serif;
623
+ font-size: 16px;
624
+ font-weight: bold;
625
+ margin: 15px 0;
626
+ transition: all 0.3s;
627
+ box-shadow: 0 2px 5px rgba(0,0,0,0.1);
628
+ "
629
+ onmouseover="this.style.backgroundColor='#218838'; this.style.boxShadow='0 4px 8px rgba(0,0,0,0.15)';"
630
+ onmouseout="this.style.backgroundColor='#28a745'; this.style.boxShadow='0 2px 5px rgba(0,0,0,0.1)';">
631
  ادامه
632
  </button>
633
+ """, height=70)
634
 
635
 
636
  # 3. منطق اصلی دکمه (مخفی)