Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -547,6 +547,40 @@ h3 {
|
|
| 547 |
</style>
|
| 548 |
""", unsafe_allow_html=True)
|
| 549 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 550 |
# ========== توابع اصلی ==========
|
| 551 |
def create_ride_map():
|
| 552 |
"""ایجاد نقشه سفر با Folium - نسخه اصلاح شده با مناطق عمومی"""
|
|
|
|
| 547 |
</style>
|
| 548 |
""", unsafe_allow_html=True)
|
| 549 |
|
| 550 |
+
st.components.v1.html("""
|
| 551 |
+
<script>
|
| 552 |
+
function forceLayout() {
|
| 553 |
+
// هدفگیری تمام عناصر داخلی
|
| 554 |
+
const containers = document.querySelectorAll(`
|
| 555 |
+
[data-testid="stAppViewContainer"] > div,
|
| 556 |
+
[data-testid="stVerticalBlock"],
|
| 557 |
+
[data-testid="stHorizontalBlock"],
|
| 558 |
+
.stTextInput, .stNumberInput, .stSelectbox
|
| 559 |
+
`);
|
| 560 |
+
|
| 561 |
+
containers.forEach(el => {
|
| 562 |
+
el.style.paddingLeft = '0';
|
| 563 |
+
el.style.paddingRight = '0';
|
| 564 |
+
el.style.marginLeft = '0';
|
| 565 |
+
el.style.marginRight = '0';
|
| 566 |
+
el.style.width = '100%';
|
| 567 |
+
});
|
| 568 |
+
|
| 569 |
+
// بازنشانی استایلهای inline
|
| 570 |
+
document.querySelectorAll('[style*="padding"]').forEach(el => {
|
| 571 |
+
el.style.paddingLeft = '0';
|
| 572 |
+
el.style.paddingRight = '0';
|
| 573 |
+
});
|
| 574 |
+
}
|
| 575 |
+
|
| 576 |
+
// اجرای اولیه با تاخیر
|
| 577 |
+
setTimeout(forceLayout, 500);
|
| 578 |
+
|
| 579 |
+
// نظارت مداوم بر تغییرات
|
| 580 |
+
setInterval(forceLayout, 1000);
|
| 581 |
+
</script>
|
| 582 |
+
""")
|
| 583 |
+
|
| 584 |
# ========== توابع اصلی ==========
|
| 585 |
def create_ride_map():
|
| 586 |
"""ایجاد نقشه سفر با Folium - نسخه اصلاح شده با مناطق عمومی"""
|