Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -72,25 +72,30 @@ html, body, .stApp {
|
|
| 72 |
width: 475px !important;
|
| 73 |
height: 667px !important;
|
| 74 |
margin: 0 auto !important;
|
| 75 |
-
padding: 15px
|
| 76 |
border: 12px solid #000 !important;
|
| 77 |
border-radius: 40px !important;
|
| 78 |
-
box-shadow: 0 0 0 6px #666,
|
| 79 |
-
0 0 30px rgba(0,0,0,0.5) !important;
|
| 80 |
-
position: relative !important;
|
| 81 |
-
overflow: hidden !important;
|
| 82 |
background-color: var(--background) !important;
|
|
|
|
| 83 |
}
|
| 84 |
-
|
| 85 |
-
/*
|
| 86 |
-
[data-testid="stAppViewContainer"],
|
| 87 |
[data-testid="stAppViewContainer"] > div,
|
| 88 |
-
[data-testid="
|
| 89 |
-
[data-testid="
|
| 90 |
padding-left: 0 !important;
|
| 91 |
padding-right: 0 !important;
|
|
|
|
|
|
|
| 92 |
}
|
| 93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
/* دکمه هوم مجازی */
|
| 95 |
[data-testid="stAppViewContainer"]::after {
|
| 96 |
content: "";
|
|
@@ -115,7 +120,7 @@ html, body, .stApp {
|
|
| 115 |
[data-testid="stAppViewContainer"] {
|
| 116 |
background-color: var(--background) !important;
|
| 117 |
color: var(--text) !important;
|
| 118 |
-
padding: 10px
|
| 119 |
}
|
| 120 |
|
| 121 |
/* تنظیمات اصلی */
|
|
@@ -543,44 +548,6 @@ h3 {
|
|
| 543 |
</style>
|
| 544 |
""", unsafe_allow_html=True)
|
| 545 |
|
| 546 |
-
st.components.v1.html("""
|
| 547 |
-
<script>
|
| 548 |
-
setTimeout(() => {
|
| 549 |
-
const forceRemoveSidePadding = () => {
|
| 550 |
-
const containers = [
|
| 551 |
-
...document.querySelectorAll('[data-testid="stAppViewContainer"], [data-testid="stAppViewContainer"] > div, [data-testid="stVerticalBlock"]'),
|
| 552 |
-
...document.querySelectorAll('.stMarkdown, .stTextInput, .stNumberInput, .stSelectbox, .stButton')
|
| 553 |
-
];
|
| 554 |
-
|
| 555 |
-
containers.forEach(el => {
|
| 556 |
-
el.style.paddingLeft = '0';
|
| 557 |
-
el.style.paddingRight = '0';
|
| 558 |
-
el.style.marginLeft = '0';
|
| 559 |
-
el.style.marginRight = '0';
|
| 560 |
-
});
|
| 561 |
-
|
| 562 |
-
// تنظیمات ویژه برای نقشه
|
| 563 |
-
const maps = document.querySelectorAll('.folium-map');
|
| 564 |
-
maps.forEach(map => {
|
| 565 |
-
map.style.width = '100%';
|
| 566 |
-
map.style.marginLeft = '0';
|
| 567 |
-
map.style.marginRight = '0';
|
| 568 |
-
});
|
| 569 |
-
};
|
| 570 |
-
|
| 571 |
-
// اجرای اولیه
|
| 572 |
-
forceRemoveSidePadding();
|
| 573 |
-
|
| 574 |
-
// اجرای مجدد پس از تغییرات دینامیک
|
| 575 |
-
new MutationObserver(forceRemoveSidePadding).observe(document.body, {
|
| 576 |
-
childList: true,
|
| 577 |
-
subtree: true
|
| 578 |
-
});
|
| 579 |
-
}, 100);
|
| 580 |
-
</script>
|
| 581 |
-
""")
|
| 582 |
-
|
| 583 |
-
|
| 584 |
# ========== توابع اصلی ==========
|
| 585 |
def create_ride_map():
|
| 586 |
"""ایجاد نقشه سفر با Folium - نسخه اصلاح شده با مناطق عمومی"""
|
|
|
|
| 72 |
width: 475px !important;
|
| 73 |
height: 667px !important;
|
| 74 |
margin: 0 auto !important;
|
| 75 |
+
padding: 15px 0 !important; /* تغییر از 1px به 0 */
|
| 76 |
border: 12px solid #000 !important;
|
| 77 |
border-radius: 40px !important;
|
| 78 |
+
box-shadow: 0 0 0 6px #666, 0 0 30px rgba(0,0,0,0.5) !important;
|
|
|
|
|
|
|
|
|
|
| 79 |
background-color: var(--background) !important;
|
| 80 |
+
overflow: hidden !important;
|
| 81 |
}
|
| 82 |
+
|
| 83 |
+
/* اضافه کردن این بخش جدید */
|
|
|
|
| 84 |
[data-testid="stAppViewContainer"] > div,
|
| 85 |
+
[data-testid="stVerticalBlock"],
|
| 86 |
+
[data-testid="stHorizontalBlock"] {
|
| 87 |
padding-left: 0 !important;
|
| 88 |
padding-right: 0 !important;
|
| 89 |
+
margin-left: 0 !important;
|
| 90 |
+
margin-right: 0 !important;
|
| 91 |
}
|
| 92 |
+
|
| 93 |
+
/* تنظیمات نقشه */
|
| 94 |
+
.folium-map {
|
| 95 |
+
width: calc(100% + 24px) !important;
|
| 96 |
+
margin-left: -12px !important;
|
| 97 |
+
}
|
| 98 |
+
}
|
| 99 |
/* دکمه هوم مجازی */
|
| 100 |
[data-testid="stAppViewContainer"]::after {
|
| 101 |
content: "";
|
|
|
|
| 120 |
[data-testid="stAppViewContainer"] {
|
| 121 |
background-color: var(--background) !important;
|
| 122 |
color: var(--text) !important;
|
| 123 |
+
padding: 10px !important;
|
| 124 |
}
|
| 125 |
|
| 126 |
/* تنظیمات اصلی */
|
|
|
|
| 548 |
</style>
|
| 549 |
""", unsafe_allow_html=True)
|
| 550 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 551 |
# ========== توابع اصلی ==========
|
| 552 |
def create_ride_map():
|
| 553 |
"""ایجاد نقشه سفر با Folium - نسخه اصلاح شده با مناطق عمومی"""
|