Spaces:
Running
Running
Update all UI elements to use page background color with white text
Browse files
app.py
CHANGED
@@ -473,9 +473,9 @@ with main_tab1:
|
|
473 |
# Add enhanced CSS to fix the vertical text and improve the drag and drop area visually
|
474 |
st.markdown("""
|
475 |
<style>
|
476 |
-
/* Fix color and text orientation */
|
477 |
.uploadedFile, .uploadedFileData, .stFileUploader {
|
478 |
-
color: #
|
479 |
}
|
480 |
|
481 |
/* Fix the text orientation for all elements in the uploader */
|
@@ -493,11 +493,11 @@ with main_tab1:
|
|
493 |
writing-mode: horizontal-tb !important;
|
494 |
width: auto !important;
|
495 |
text-align: center !important;
|
496 |
-
color: #
|
497 |
font-weight: 400 !important;
|
498 |
}
|
499 |
|
500 |
-
/* Enhance the drop zone appearance */
|
501 |
.stFileUploader > section > div,
|
502 |
.stFileUploader div[data-testid="stFileUploadDropzone"] {
|
503 |
display: flex !important;
|
@@ -507,19 +507,19 @@ with main_tab1:
|
|
507 |
text-align: center !important;
|
508 |
height: auto !important;
|
509 |
min-height: 180px !important;
|
510 |
-
background-color: #
|
511 |
-
border: 2px dashed #
|
512 |
border-radius: 8px !important;
|
513 |
transition: background-color 0.3s, border-color 0.3s !important;
|
514 |
padding: 20px !important;
|
515 |
margin-bottom: 20px !important;
|
516 |
}
|
517 |
|
518 |
-
/* Hover effect for better user feedback */
|
519 |
.stFileUploader > section > div:hover,
|
520 |
.stFileUploader div[data-testid="stFileUploadDropzone"]:hover {
|
521 |
-
background-color: #
|
522 |
-
border-color: #
|
523 |
}
|
524 |
|
525 |
/* Add visual icon for upload */
|
@@ -532,8 +532,8 @@ with main_tab1:
|
|
532 |
</style>
|
533 |
""", unsafe_allow_html=True)
|
534 |
|
535 |
-
# Add visual label above the file uploader
|
536 |
-
st.markdown('<div style="margin-bottom:8px; font-weight:500; color:#
|
537 |
|
538 |
# Enhanced file uploader with better help text
|
539 |
uploaded_file = st.file_uploader("Drag and drop PDFs or images here", type=["pdf", "png", "jpg", "jpeg"],
|
@@ -1223,18 +1223,18 @@ with main_tab1:
|
|
1223 |
# Document results will be shown in the right column
|
1224 |
with right_col:
|
1225 |
|
1226 |
-
# Add Document Metadata section - use
|
1227 |
-
st.markdown('<h3 style="margin-bottom:0; padding-bottom:0; color:#ffffff; background-color:#
|
1228 |
|
1229 |
-
# Create metadata card with clean styling -
|
1230 |
-
metadata_html = '<div class="metadata-card" style="background:#
|
1231 |
|
1232 |
# File info
|
1233 |
metadata_html += f'<p><strong>File Name:</strong> {result.get("file_name", uploaded_file.name)}</p>'
|
1234 |
|
1235 |
-
# Info about limited pages -
|
1236 |
if 'limited_pages' in result:
|
1237 |
-
metadata_html += f'<p style="background:#
|
1238 |
|
1239 |
# Languages
|
1240 |
if 'languages' in result:
|
@@ -1257,8 +1257,8 @@ with main_tab1:
|
|
1257 |
# Render the metadata HTML
|
1258 |
st.markdown(metadata_html, unsafe_allow_html=True)
|
1259 |
|
1260 |
-
# Add content section heading -
|
1261 |
-
st.markdown('<h3 style="margin-top:20px; margin-bottom:0; padding-bottom:0; color:#ffffff; background-color:#
|
1262 |
|
1263 |
# Start document content div with consistent styling class
|
1264 |
st.markdown('<div class="document-content" style="margin-top:10px;">', unsafe_allow_html=True)
|
|
|
473 |
# Add enhanced CSS to fix the vertical text and improve the drag and drop area visually
|
474 |
st.markdown("""
|
475 |
<style>
|
476 |
+
/* Fix color and text orientation - use white text */
|
477 |
.uploadedFile, .uploadedFileData, .stFileUploader {
|
478 |
+
color: #ffffff !important;
|
479 |
}
|
480 |
|
481 |
/* Fix the text orientation for all elements in the uploader */
|
|
|
493 |
writing-mode: horizontal-tb !important;
|
494 |
width: auto !important;
|
495 |
text-align: center !important;
|
496 |
+
color: #ffffff !important;
|
497 |
font-weight: 400 !important;
|
498 |
}
|
499 |
|
500 |
+
/* Enhance the drop zone appearance with page background color */
|
501 |
.stFileUploader > section > div,
|
502 |
.stFileUploader div[data-testid="stFileUploadDropzone"] {
|
503 |
display: flex !important;
|
|
|
507 |
text-align: center !important;
|
508 |
height: auto !important;
|
509 |
min-height: 180px !important;
|
510 |
+
background-color: #f0f2f6 !important;
|
511 |
+
border: 2px dashed #ffffff !important;
|
512 |
border-radius: 8px !important;
|
513 |
transition: background-color 0.3s, border-color 0.3s !important;
|
514 |
padding: 20px !important;
|
515 |
margin-bottom: 20px !important;
|
516 |
}
|
517 |
|
518 |
+
/* Hover effect for better user feedback - still using page background */
|
519 |
.stFileUploader > section > div:hover,
|
520 |
.stFileUploader div[data-testid="stFileUploadDropzone"]:hover {
|
521 |
+
background-color: #f0f2f6 !important;
|
522 |
+
border-color: #ffffff !important;
|
523 |
}
|
524 |
|
525 |
/* Add visual icon for upload */
|
|
|
532 |
</style>
|
533 |
""", unsafe_allow_html=True)
|
534 |
|
535 |
+
# Add visual label above the file uploader with white text on page background
|
536 |
+
st.markdown('<div style="margin-bottom:8px; font-weight:500; color:#ffffff; background-color:#f0f2f6; padding:8px; border-radius:4px; font-size:16px;">π Upload Historical Document</div>', unsafe_allow_html=True)
|
537 |
|
538 |
# Enhanced file uploader with better help text
|
539 |
uploaded_file = st.file_uploader("Drag and drop PDFs or images here", type=["pdf", "png", "jpg", "jpeg"],
|
|
|
1223 |
# Document results will be shown in the right column
|
1224 |
with right_col:
|
1225 |
|
1226 |
+
# Add Document Metadata section - use page background color with white text
|
1227 |
+
st.markdown('<h3 style="margin-bottom:0; padding-bottom:0; color:#ffffff; background-color:#f0f2f6; padding:10px; border-radius:4px 4px 0 0;">Document Metadata</h3>', unsafe_allow_html=True)
|
1228 |
|
1229 |
+
# Create metadata card with clean styling - page background with white text
|
1230 |
+
metadata_html = '<div class="metadata-card" style="background:#f0f2f6; color:#ffffff; border:1px solid #f0f2f6; border-radius:0 0 4px 4px; padding:15px; margin-bottom:20px;">'
|
1231 |
|
1232 |
# File info
|
1233 |
metadata_html += f'<p><strong>File Name:</strong> {result.get("file_name", uploaded_file.name)}</p>'
|
1234 |
|
1235 |
+
# Info about limited pages - match page background
|
1236 |
if 'limited_pages' in result:
|
1237 |
+
metadata_html += f'<p style="background:#f0f2f6; padding:8px; border-radius:4px; color:#ffffff;"><strong>Pages:</strong> {result["limited_pages"]["processed"]} of {result["limited_pages"]["total"]} processed</p>'
|
1238 |
|
1239 |
# Languages
|
1240 |
if 'languages' in result:
|
|
|
1257 |
# Render the metadata HTML
|
1258 |
st.markdown(metadata_html, unsafe_allow_html=True)
|
1259 |
|
1260 |
+
# Add content section heading - match page background color
|
1261 |
+
st.markdown('<h3 style="margin-top:20px; margin-bottom:0; padding-bottom:0; color:#ffffff; background-color:#f0f2f6; padding:10px; border-radius:4px;">Document Content</h3>', unsafe_allow_html=True)
|
1262 |
|
1263 |
# Start document content div with consistent styling class
|
1264 |
st.markdown('<div class="document-content" style="margin-top:10px;">', unsafe_allow_html=True)
|