Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,124 +12,85 @@ st.set_page_config(
|
|
| 12 |
layout="wide",
|
| 13 |
initial_sidebar_state="expanded"
|
| 14 |
)
|
| 15 |
-
|
| 16 |
-
# FIXED CSS - Much better colors and visibility!
|
| 17 |
st.markdown("""
|
| 18 |
<style>
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
border-radius: 8px;
|
| 92 |
-
margin: 1rem 0;
|
| 93 |
-
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
| 94 |
-
color: #084298 !important;
|
| 95 |
-
}
|
| 96 |
-
|
| 97 |
-
.verdict-unverified h3, .verdict-unverified p, .verdict-unverified strong {
|
| 98 |
-
color: #084298 !important;
|
| 99 |
-
}
|
| 100 |
-
|
| 101 |
-
/* Links */
|
| 102 |
-
.verdict-true a, .verdict-false a, .verdict-mixed a, .verdict-unverified a {
|
| 103 |
-
color: #0066cc !important;
|
| 104 |
-
text-decoration: underline;
|
| 105 |
-
font-weight: bold;
|
| 106 |
-
}
|
| 107 |
-
|
| 108 |
-
/* Stats boxes */
|
| 109 |
-
.stat-box {
|
| 110 |
-
background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
|
| 111 |
-
padding: 2rem 1rem;
|
| 112 |
-
border-radius: 12px;
|
| 113 |
-
text-align: center;
|
| 114 |
-
margin: 0.5rem;
|
| 115 |
-
border: 2px solid #dee2e6;
|
| 116 |
-
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
| 117 |
-
}
|
| 118 |
-
|
| 119 |
-
.stat-box h2 {
|
| 120 |
-
margin: 0 !important;
|
| 121 |
-
font-size: 2.5rem !important;
|
| 122 |
-
}
|
| 123 |
-
|
| 124 |
-
.stat-box p {
|
| 125 |
-
color: #495057 !important;
|
| 126 |
-
font-weight: 600;
|
| 127 |
-
font-size: 0.9rem;
|
| 128 |
-
}
|
| 129 |
</style>
|
| 130 |
""", unsafe_allow_html=True)
|
| 131 |
|
| 132 |
|
|
|
|
| 133 |
class GoogleFactCheckAPI:
|
| 134 |
"""Google Fact Check Tools API Integration - IMPROVED VERSION"""
|
| 135 |
|
|
|
|
| 12 |
layout="wide",
|
| 13 |
initial_sidebar_state="expanded"
|
| 14 |
)
|
|
|
|
|
|
|
| 15 |
st.markdown("""
|
| 16 |
<style>
|
| 17 |
+
/* Page background */
|
| 18 |
+
[data-testid="stAppViewContainer"] {
|
| 19 |
+
background: #f7fafc; /* soft off-white so cards stand out */
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
/* Header */
|
| 23 |
+
.main-header {
|
| 24 |
+
font-size: 2.6rem;
|
| 25 |
+
font-weight: 700;
|
| 26 |
+
color: #111827;
|
| 27 |
+
text-align: center;
|
| 28 |
+
margin-bottom: 0.25rem;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
/* Sub header */
|
| 32 |
+
.sub-header {
|
| 33 |
+
text-align: center;
|
| 34 |
+
color: #334155;
|
| 35 |
+
margin-bottom: 1.5rem;
|
| 36 |
+
font-size: 1.05rem;
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
/* Make sure Streamlit text inputs / textareas are visible */
|
| 40 |
+
.stTextInput > div > input,
|
| 41 |
+
.stTextArea > div > textarea,
|
| 42 |
+
textarea,
|
| 43 |
+
input[type="text"],
|
| 44 |
+
input[type="password"] {
|
| 45 |
+
background-color: #ffffff !important;
|
| 46 |
+
color: #0f172a !important;
|
| 47 |
+
border: 1px solid #cbd5e1 !important;
|
| 48 |
+
border-radius: 6px !important;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
/* Label color */
|
| 52 |
+
label {
|
| 53 |
+
color: #0f172a !important;
|
| 54 |
+
font-weight: 600;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
/* Buttons */
|
| 58 |
+
.stButton > button {
|
| 59 |
+
background-color: #0d6efd !important;
|
| 60 |
+
color: #ffffff !important;
|
| 61 |
+
border-radius: 6px !important;
|
| 62 |
+
padding: 0.55rem 0.8rem;
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
/* Stat boxes (kept subtle and readable) */
|
| 66 |
+
.stat-box {
|
| 67 |
+
background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
|
| 68 |
+
padding: 1.4rem 1rem;
|
| 69 |
+
border-radius: 10px;
|
| 70 |
+
text-align: center;
|
| 71 |
+
margin: 0.5rem;
|
| 72 |
+
border: 1px solid #e2e8f0;
|
| 73 |
+
box-shadow: 0 6px 12px rgba(2,6,23,0.04);
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
/* Verdict boxes: keep colors but ensure text contrast */
|
| 77 |
+
.verdict-true, .verdict-false, .verdict-mixed, .verdict-unverified {
|
| 78 |
+
padding: 1rem;
|
| 79 |
+
border-radius: 8px;
|
| 80 |
+
margin: 0.8rem 0;
|
| 81 |
+
}
|
| 82 |
+
.verdict-true { border-left: 6px solid #16a34a; background: #f0fdf4; color: #064e3b; }
|
| 83 |
+
.verdict-false { border-left: 6px solid #dc3545; background: #fff1f2; color: #641220; }
|
| 84 |
+
.verdict-mixed { border-left: 6px solid #f59e0b; background: #fffbeb; color: #78350f; }
|
| 85 |
+
.verdict-unverified { border-left: 6px solid #0d6efd; background: #e7f3ff; color: #08306b; }
|
| 86 |
+
|
| 87 |
+
/* Footer small text */
|
| 88 |
+
footer, .footer { color: #64748b !important; font-size: 0.9rem; text-align:center; padding: 1rem 0; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
</style>
|
| 90 |
""", unsafe_allow_html=True)
|
| 91 |
|
| 92 |
|
| 93 |
+
|
| 94 |
class GoogleFactCheckAPI:
|
| 95 |
"""Google Fact Check Tools API Integration - IMPROVED VERSION"""
|
| 96 |
|