Spaces:
Sleeping
Sleeping
app updated
Browse files
app.py
CHANGED
|
@@ -117,17 +117,42 @@ else:
|
|
| 117 |
# st.image(shelter["image_url"])
|
| 118 |
st.json(shelter["info"])
|
| 119 |
|
| 120 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
col1, col2 = st.columns([1, 1])
|
| 122 |
|
| 123 |
with col1:
|
| 124 |
-
if st.button("Previous"):
|
| 125 |
if st.session_state.shelter_index > 0:
|
| 126 |
st.session_state.shelter_index -= 1
|
| 127 |
st.experimental_rerun()
|
| 128 |
|
| 129 |
with col2:
|
| 130 |
-
if st.button("Next"):
|
| 131 |
if st.session_state.shelter_index < len(shelters) - 1:
|
| 132 |
st.session_state.shelter_index += 1
|
| 133 |
st.experimental_rerun()
|
|
|
|
| 117 |
# st.image(shelter["image_url"])
|
| 118 |
st.json(shelter["info"])
|
| 119 |
|
| 120 |
+
# Custom HTML for buttons
|
| 121 |
+
st.markdown("""
|
| 122 |
+
<style>
|
| 123 |
+
.button-container {
|
| 124 |
+
display: flex;
|
| 125 |
+
justify-content: center;
|
| 126 |
+
gap: 20px;
|
| 127 |
+
position: fixed;
|
| 128 |
+
bottom: 10px;
|
| 129 |
+
width: 100%;
|
| 130 |
+
}
|
| 131 |
+
.stButton button {
|
| 132 |
+
background-color: #4CAF50;
|
| 133 |
+
color: white;
|
| 134 |
+
padding: 10px 20px;
|
| 135 |
+
border: none;
|
| 136 |
+
cursor: pointer;
|
| 137 |
+
font-size: 16px;
|
| 138 |
+
}
|
| 139 |
+
</style>
|
| 140 |
+
<div class="button-container">
|
| 141 |
+
<button onclick="document.querySelector('button[aria-label=Previous]').click()">Previous</button>
|
| 142 |
+
<button onclick="document.querySelector('button[aria-label=Next]').click()">Next</button>
|
| 143 |
+
</div>
|
| 144 |
+
""", unsafe_allow_html=True)
|
| 145 |
+
|
| 146 |
col1, col2 = st.columns([1, 1])
|
| 147 |
|
| 148 |
with col1:
|
| 149 |
+
if st.button("Previous", key="previous"):
|
| 150 |
if st.session_state.shelter_index > 0:
|
| 151 |
st.session_state.shelter_index -= 1
|
| 152 |
st.experimental_rerun()
|
| 153 |
|
| 154 |
with col2:
|
| 155 |
+
if st.button("Next", key="next"):
|
| 156 |
if st.session_state.shelter_index < len(shelters) - 1:
|
| 157 |
st.session_state.shelter_index += 1
|
| 158 |
st.experimental_rerun()
|