Spaces:
Paused
Paused
Maryam Ilka commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -602,18 +602,46 @@ def attention_check1():
|
|
| 602 |
)
|
| 603 |
|
| 604 |
# 2. ایجاد دکمه سبز با JavaScript
|
| 605 |
-
|
| 606 |
-
|
| 607 |
-
|
| 608 |
-
|
| 609 |
-
|
| 610 |
-
|
| 611 |
-
|
| 612 |
-
|
| 613 |
-
|
| 614 |
-
|
| 615 |
-
|
| 616 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 617 |
|
| 618 |
# 3. منطق اصلی دکمه (مخفی)
|
| 619 |
if st.button("ادامه", key="att1_real_btn", type="primary"):
|
|
|
|
| 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()"
|
| 614 |
+
style="
|
| 615 |
+
background-color: #28a745;
|
| 616 |
+
color: white;
|
| 617 |
+
border: none;
|
| 618 |
+
border-radius: 8px;
|
| 619 |
+
padding: 12px 24px;
|
| 620 |
+
font-weight: bold;
|
| 621 |
+
width: 100%;
|
| 622 |
+
cursor: pointer;
|
| 623 |
+
font-family: 'Vazir', sans-serif;
|
| 624 |
+
text-align: center;
|
| 625 |
+
transition: all 0.3s ease;
|
| 626 |
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
| 627 |
+
margin: 15px 0;
|
| 628 |
+
font-size: 16px;
|
| 629 |
+
display: flex;
|
| 630 |
+
align-items: center;
|
| 631 |
+
justify-content: center;
|
| 632 |
+
"
|
| 633 |
+
onmouseover="this.style.backgroundColor='#218838'; this.style.boxShadow='0 4px 8px rgba(0,0,0,0.15)';"
|
| 634 |
+
onmouseout="this.style.backgroundColor='#28a745'; this.style.boxShadow='0 2px 4px rgba(0,0,0,0.1)';"
|
| 635 |
+
onmousedown="this.style.transform='translateY(1px)';"
|
| 636 |
+
onmouseup="this.style.transform='translateY(0)';">
|
| 637 |
+
|
| 638 |
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="margin-left: 8px;">
|
| 639 |
+
<path d="M5 12H19M19 12L12 5M19 12L12 19" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
| 640 |
+
</svg>
|
| 641 |
+
ادامه
|
| 642 |
+
</button>
|
| 643 |
+
""", height=80)
|
| 644 |
+
|
| 645 |
|
| 646 |
# 3. منطق اصلی دکمه (مخفی)
|
| 647 |
if st.button("ادامه", key="att1_real_btn", type="primary"):
|