areeba-sloth commited on
Commit
1d1200f
·
verified ·
1 Parent(s): cc19c7c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +155 -57
app.py CHANGED
@@ -12,80 +12,178 @@ st.set_page_config(
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
 
@@ -449,7 +547,7 @@ DETAILED RESULTS:
449
  st.markdown("""
450
  <div style="text-align: center; color: #666; padding: 2rem 0;">
451
  <p style="font-size: 1.1rem;"><strong>VeriFact</strong> | Powered by Google Fact Check Tools API</p>
452
- <p>Built by <strong>Areeba Fatima</strong> (LUMS) with Python & Streamlit</p>
453
  <p style="font-size: 0.85rem; color: #999;">⚠️ Always verify important claims from multiple sources. This tool is for informational purposes.</p>
454
  </div>
455
  """, unsafe_allow_html=True)
 
12
  layout="wide",
13
  initial_sidebar_state="expanded"
14
  )
15
+
16
+ # FIXED CSS - Much better colors and visibility!
17
  st.markdown("""
18
  <style>
19
+ /* Main background */
20
+ .main {
21
+ background-color: #ffffff;
22
+ }
23
+
24
+ /* Headers with good contrast */
25
+ .main-header {
26
+ font-size: 3rem;
27
+ font-weight: bold;
28
+ color: #1a1a1a;
29
+ text-align: center;
30
+ margin-bottom: 0.5rem;
31
+ text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
32
+ }
33
+
34
+ .sub-header {
35
+ text-align: center;
36
+ color: #444444;
37
+ margin-bottom: 2rem;
38
+ font-size: 1.2rem;
39
+ }
40
+
41
+ /* TRUE verdict - Green with dark text */
42
+ .verdict-true {
43
+ background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
44
+ border-left: 6px solid #28a745;
45
+ padding: 1.5rem;
46
+ border-radius: 8px;
47
+ margin: 1rem 0;
48
+ box-shadow: 0 2px 8px rgba(0,0,0,0.1);
49
+ color: #155724 !important;
50
+ }
51
+
52
+ .verdict-true h3, .verdict-true p, .verdict-true strong {
53
+ color: #155724 !important;
54
+ }
55
+
56
+ /* FALSE verdict - Red with dark text */
57
+ .verdict-false {
58
+ background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
59
+ border-left: 6px solid #dc3545;
60
+ padding: 1.5rem;
61
+ border-radius: 8px;
62
+ margin: 1rem 0;
63
+ box-shadow: 0 2px 8px rgba(0,0,0,0.1);
64
+ color: #721c24 !important;
65
+ }
66
+
67
+ .verdict-false h3, .verdict-false p, .verdict-false strong {
68
+ color: #721c24 !important;
69
+ }
70
+
71
+ /* MIXED verdict - Yellow with dark text */
72
+ .verdict-mixed {
73
+ background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
74
+ border-left: 6px solid #ffc107;
75
+ padding: 1.5rem;
76
+ border-radius: 8px;
77
+ margin: 1rem 0;
78
+ box-shadow: 0 2px 8px rgba(0,0,0,0.1);
79
+ color: #856404 !important;
80
+ }
81
+
82
+ .verdict-mixed h3, .verdict-mixed p, .verdict-mixed strong {
83
+ color: #856404 !important;
84
+ }
85
+
86
+ /* UNVERIFIED - Blue with dark text */
87
+ .verdict-unverified {
88
+ background: linear-gradient(135deg, #e7f3ff 0%, #cfe2ff 100%);
89
+ border-left: 6px solid #0d6efd;
90
+ padding: 1.5rem;
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
+ st.markdown("""
134
+ <style>
135
+
136
+ /* ===== FIX TEXT INPUT & TEXT AREA VISIBILITY ===== */
137
+
138
+ /* Text area (Enter your claim) */
139
+ textarea {
140
+ background-color: #f8f9fa !important;
141
+ color: #000000 !important;
142
+ border-radius: 8px !important;
143
+ border: 2px solid #ced4da !important;
144
+ font-size: 16px !important;
145
  }
146
 
147
+ /* Text input (API Key) */
148
+ input {
149
+ background-color: #f8f9fa !important;
150
+ color: #000000 !important;
 
 
 
 
 
151
  border-radius: 6px !important;
152
+ border: 2px solid #ced4da !important;
153
  }
154
 
155
+ /* Placeholder text */
156
+ textarea::placeholder,
157
+ input::placeholder {
158
+ color: #6c757d !important;
159
+ opacity: 1 !important;
160
+ }
161
+
162
+ /* Labels */
163
  label {
164
+ color: #212529 !important;
165
+ font-weight: 600 !important;
166
  }
167
 
168
+ /* Fix Streamlit BaseWeb components */
169
+ [data-baseweb="textarea"] textarea {
170
+ color: #000000 !important;
171
+ background-color: #f8f9fa !important;
 
 
172
  }
173
 
174
+ [data-baseweb="input"] input {
175
+ color: #000000 !important;
176
+ background-color: #f8f9fa !important;
 
 
 
 
 
 
177
  }
178
 
179
+ /* Focus state */
180
+ textarea:focus,
181
+ input:focus {
182
+ border-color: #0d6efd !important;
183
+ box-shadow: 0 0 0 0.15rem rgba(13,110,253,.25) !important;
184
+ outline: none !important;
185
  }
 
 
 
 
186
 
 
 
187
  </style>
188
  """, unsafe_allow_html=True)
189
 
 
547
  st.markdown("""
548
  <div style="text-align: center; color: #666; padding: 2rem 0;">
549
  <p style="font-size: 1.1rem;"><strong>VeriFact</strong> | Powered by Google Fact Check Tools API</p>
550
+ <p>Built by <strong>Areeba Fatima</strong> with Python & Streamlit</p>
551
  <p style="font-size: 0.85rem; color: #999;">⚠️ Always verify important claims from multiple sources. This tool is for informational purposes.</p>
552
  </div>
553
  """, unsafe_allow_html=True)