Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -141,7 +141,36 @@ if (summ_text is not None) or ('summ_text' in st.session_state):
|
|
| 141 |
|
| 142 |
st.subheader('Generated slides content')
|
| 143 |
# Display editable text box
|
| 144 |
-
text = st.text_area("Edit Text", st.session_state.current_text, height=200, key="text_area_value", on_change=update_text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
|
| 146 |
# Display page turner controls
|
| 147 |
col1, col2, col3 = st.columns([2.25, 12, 1.7])
|
|
@@ -151,20 +180,13 @@ if (summ_text is not None) or ('summ_text' in st.session_state):
|
|
| 151 |
st.button("Previous", on_click=turn_page, args=("prev",))
|
| 152 |
|
| 153 |
# Center aligned text in col2
|
| 154 |
-
# with col2:
|
| 155 |
-
# st.markdown(
|
| 156 |
-
# f'<div style="display: flex; justify-content: center; align-items: center; height: 100%;">'
|
| 157 |
-
# f'Page {st.session_state.page_index + 1} of {len(st.session_state.summ_text)}'
|
| 158 |
-
# f'</div>',
|
| 159 |
-
# unsafe_allow_html=True
|
| 160 |
-
# )
|
| 161 |
with col2:
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
|
| 169 |
# Next button in col3, right aligned
|
| 170 |
with col3:
|
|
|
|
| 141 |
|
| 142 |
st.subheader('Generated slides content')
|
| 143 |
# Display editable text box
|
| 144 |
+
# text = st.text_area("Edit Text", st.session_state.current_text, height=200, key="text_area_value", on_change=update_text)
|
| 145 |
+
st.markdown("""
|
| 146 |
+
<style>
|
| 147 |
+
.framed-text-area {
|
| 148 |
+
border: 2px solid #cccccc;
|
| 149 |
+
border-radius: 5px;
|
| 150 |
+
padding: 10px;
|
| 151 |
+
margin-bottom: 10px;
|
| 152 |
+
}
|
| 153 |
+
.framed-text-area label {
|
| 154 |
+
font-weight: bold;
|
| 155 |
+
}
|
| 156 |
+
</style>
|
| 157 |
+
""", unsafe_allow_html=True)
|
| 158 |
+
|
| 159 |
+
# Function to update text (assuming you have this defined)
|
| 160 |
+
def update_text():
|
| 161 |
+
st.session_state.current_text = st.session_state.text_area_value
|
| 162 |
+
|
| 163 |
+
# Display the framed text area
|
| 164 |
+
st.markdown('<div class="framed-text-area">', unsafe_allow_html=True)
|
| 165 |
+
text = st.text_area(
|
| 166 |
+
"Edit Text",
|
| 167 |
+
st.session_state.current_text,
|
| 168 |
+
height=200,
|
| 169 |
+
key="text_area_value",
|
| 170 |
+
on_change=update_text
|
| 171 |
+
)
|
| 172 |
+
st.markdown('</div>', unsafe_allow_html=True)
|
| 173 |
+
|
| 174 |
|
| 175 |
# Display page turner controls
|
| 176 |
col1, col2, col3 = st.columns([2.25, 12, 1.7])
|
|
|
|
| 180 |
st.button("Previous", on_click=turn_page, args=("prev",))
|
| 181 |
|
| 182 |
# Center aligned text in col2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 183 |
with col2:
|
| 184 |
+
st.markdown(
|
| 185 |
+
f'<div style="display: flex; justify-content: center; align-items: center; height: 100%;">'
|
| 186 |
+
f'Page {st.session_state.page_index + 1} of {len(st.session_state.summ_text)}'
|
| 187 |
+
f'</div>',
|
| 188 |
+
unsafe_allow_html=True
|
| 189 |
+
)
|
| 190 |
|
| 191 |
# Next button in col3, right aligned
|
| 192 |
with col3:
|