Spaces:
Sleeping
Sleeping
File size: 11,809 Bytes
fc03437 b0e888e b0fac1b b0e888e b0fac1b b0e888e b0fac1b 5e190d3 b0e888e b0fac1b e012fea b0e888e 5e190d3 b0e888e 5e190d3 b0e888e e012fea b0e888e e1c490b b0e888e e012fea b0e888e b0fac1b 01b19e0 b0e888e b0fac1b b0e888e b0fac1b b0e888e b0fac1b b0e888e b0fac1b 5e190d3 b0e888e b0fac1b b0e888e b0fac1b b0e888e b0fac1b b0e888e b0fac1b 5e190d3 b0e888e b0fac1b b0e888e b0fac1b b0e888e b0fac1b e1c490b b0e888e 5e190d3 b0e888e e012fea b0fac1b e012fea b0e888e b0fac1b b0e888e 5e190d3 b0e888e 58b0fdc b0e888e 58b0fdc e012fea 58b0fdc 5e190d3 b0e888e 58b0fdc b0e888e b0fac1b 5e190d3 b0e888e e012fea b0e888e e012fea b0e888e b0fac1b b0e888e b0fac1b b0e888e b0fac1b e1c490b b0fac1b b0e888e b0fac1b b0e888e b0fac1b b0e888e e1c490b b0fac1b b0e888e b0fac1b b0e888e e1c490b b0e888e b0fac1b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 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 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 | import gradio as gr
custom_css = """
/* ──────────────────────────────────────────────
Base / layout
────────────────────────────────────────────── */
body {
background: linear-gradient(135deg, #020617 0%, #1e0b45 50%, #020617 100%);
}
.gradio-container {
font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
"Segoe UI", sans-serif;
max-width: 1200px !important;
margin: 0 auto !important;
padding: 36px 36px 48px 36px !important;
color: #f9fafb;
}
.gradio-container .block {
background: transparent !important;
border: none !important;
box-shadow: none !important;
}
/* Give all rows breathing room between columns */
.gradio-container .row > .column {
padding: 0 6px;
}
.gradio-container .row {
gap: 18px !important;
}
/* Tabs spacing */
.gradio-container .tab-nav,
.gradio-container .tabs > .tab-nav {
margin-bottom: 18px !important;
}
.gradio-container .tab-nav button {
padding: 10px 18px !important;
font-size: 14px !important;
}
/* ──────────────────────────────────────────────
Glass card shell
────────────────────────────────────────────── */
.glass-card {
background: rgba(15, 23, 42, 0.96) !important;
border-radius: 22px !important;
border: 1px solid rgba(148, 163, 184, 0.28) !important;
box-shadow: 0 24px 60px rgba(15, 23, 42, 0.55) !important;
overflow: hidden;
margin-bottom: 18px !important;
}
/* Padding via ID selectors (beats Svelte scoped styles) */
#input-card,
#result-card,
#hiw-intro-card,
#hiw-step1-card,
#hiw-step2-card,
#hiw-step3-card,
#about-intro-card,
#about-thesis-card,
#fb-intro-card,
#fb-form-card,
#fb-faq-card {
padding: 28px 30px !important;
}
/* Inner Gradio form wrapper (Svelte renders this inside every Group) */
#input-card > .form,
#result-card > .form,
#hiw-intro-card > .form,
#hiw-step1-card > .form,
#hiw-step2-card > .form,
#hiw-step3-card > .form,
#about-intro-card > .form,
#about-thesis-card > .form,
#fb-intro-card > .form,
#fb-form-card > .form,
#fb-faq-card > .form {
padding: 0 !important;
gap: 16px !important;
}
/* Markdown blocks inside cards — vertical rhythm */
.glass-card .prose,
.glass-card .markdown-body {
margin: 0 !important;
}
.glass-card h2,
.glass-card h3,
.glass-card h4 {
margin-top: 0 !important;
margin-bottom: 12px !important;
color: #f8fafc !important;
}
.glass-card p,
.glass-card li {
color: #e5e7eb !important;
line-height: 1.65 !important;
}
.glass-card blockquote {
border-left: 3px solid rgba(148, 163, 184, 0.45) !important;
padding: 10px 14px !important;
margin: 4px 0 !important;
color: #cbd5f5 !important;
background: rgba(148, 163, 184, 0.06) !important;
border-radius: 8px !important;
}
/* Equal-height card rows */
.card-row {
align-items: stretch !important;
}
.card-row .glass-card {
height: 100%;
}
/* ──────────────────────────────────────────────
Hero section
────────────────────────────────────────────── */
.hero-section {
max-width: 1120px;
margin: 4px auto 28px auto;
padding: 0 4px;
}
.hero-title {
font-size: 34px;
font-weight: 700;
letter-spacing: -0.01em;
line-height: 1.25;
color: #f1f5f9;
margin-bottom: 12px;
}
.hero-subtitle {
font-size: 14.5px;
line-height: 1.6;
max-width: 720px;
color: #cbd5f5;
opacity: 0.92;
}
/* ──────────────────────────────────────────────
Confidence display
────────────────────────────────────────────── */
.conf-text-row {
display: flex;
align-items: flex-end;
gap: 8px;
margin-top: 14px;
margin-bottom: 10px;
}
.conf-val {
font-size: 32px;
font-weight: 700;
color: #f8fafc;
line-height: 1;
letter-spacing: -0.01em;
}
.conf-caption {
font-size: 12px;
opacity: 0.75;
color: #cbd5f5;
padding-bottom: 4px;
}
.conf-bar-bg {
width: 100%;
height: 10px;
border-radius: 999px;
background: rgba(148, 163, 184, 0.22);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
overflow: hidden;
margin-top: 4px;
}
.conf-bar-fill {
height: 100%;
border-radius: inherit;
background: linear-gradient(90deg, #f97316, #fb923c);
transition: width 0.4s ease;
}
/* ──────────────────────────────────────────────
Label badges
────────────────────────────────────────────── */
.badge-pill {
display: inline-flex;
align-items: center;
padding: 6px 18px;
border-radius: 999px;
font-size: 12px;
font-weight: 700;
letter-spacing: 0.05em;
text-transform: uppercase;
}
.badge-fake { background: #f97316; color: #111827; }
.badge-real { background: #22c55e; color: #022c22; }
.badge-neutral {
background: rgba(148, 163, 184, 0.25);
color: #cbd5f5;
}
/* ──────────────────────────────────────────────
Textboxes & inputs
────────────────────────────────────────────── */
#news-textbox textarea,
#fb-textbox textarea,
#fb-email-textbox textarea,
#fb-email-textbox input {
background: #020617 !important;
border-radius: 12px !important;
border: 1px solid rgba(148, 163, 184, 0.30) !important;
color: #f9fafb !important;
font-size: 14px !important;
padding: 16px 18px !important;
line-height: 1.6 !important;
box-sizing: border-box !important;
transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#news-textbox textarea:focus,
#fb-textbox textarea:focus,
#fb-email-textbox input:focus {
border-color: rgba(165, 180, 252, 0.7) !important;
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18) !important;
outline: none !important;
}
#news-textbox textarea::placeholder,
#fb-textbox textarea::placeholder,
#fb-email-textbox input::placeholder {
color: #94a3b8 !important;
opacity: 1 !important;
}
/* Labels */
.gradio-container label {
margin-bottom: 8px !important;
font-size: 13px !important;
color: #e2e8f0 !important;
}
/* Dropdown */
.gradio-container .wrap.svelte-1ipelgc,
.gradio-container select,
.gradio-container .gr-dropdown {
background: #020617 !important;
color: #f9fafb !important;
border-radius: 12px !important;
border: 1px solid rgba(148, 163, 184, 0.30) !important;
}
/* Checkbox label spacing */
.gradio-container .gr-checkbox label,
.gradio-container input[type="checkbox"] + span {
color: #e2e8f0 !important;
font-size: 13px !important;
}
/* ──────────────────────────────────────────────
Buttons
────────────────────────────────────────────── */
.btn-row {
gap: 12px !important;
margin-top: 4px !important;
}
.btn-primary-custom,
.btn-secondary-custom {
border-radius: 12px !important;
font-size: 14px !important;
font-weight: 600 !important;
padding: 11px 22px !important;
min-height: 42px !important;
transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease !important;
border: 1px solid transparent !important;
cursor: pointer !important;
}
.btn-primary-custom {
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
color: #ffffff !important;
box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35) !important;
}
.btn-primary-custom:hover {
transform: translateY(-1px);
box-shadow: 0 10px 22px rgba(99, 102, 241, 0.45) !important;
}
.btn-primary-custom:active {
transform: translateY(0);
}
.btn-secondary-custom {
background: rgba(148, 163, 184, 0.12) !important;
color: #e5e7eb !important;
border: 1px solid rgba(148, 163, 184, 0.35) !important;
}
.btn-secondary-custom:hover {
background: rgba(148, 163, 184, 0.20) !important;
transform: translateY(-1px);
}
/* ──────────────────────────────────────────────
Helper text
────────────────────────────────────────────── */
.helper-text {
font-size: 12px;
opacity: 0.75;
color: #cbd5f5;
display: inline-block;
margin-top: 4px;
}
/* ──────────────────────────────────────────────
Responsive
────────────────────────────────────────────── */
@media (max-width: 900px) {
.gradio-container {
padding: 20px 18px 32px 18px !important;
}
.two-col {
flex-direction: column !important;
}
.hero-title {
font-size: 26px;
}
#input-card,
#result-card,
#hiw-intro-card,
#hiw-step1-card,
#hiw-step2-card,
#hiw-step3-card,
#about-intro-card,
#about-thesis-card,
#fb-intro-card,
#fb-form-card,
#fb-faq-card {
padding: 22px 22px !important;
}
}
"""
def header():
return gr.HTML(
"""
<div style="max-width:1120px;margin:0 auto 4px auto;">
<header style="display:flex;align-items:center;justify-content:space-between;
margin-bottom:22px;padding:0 4px;">
<div style="display:flex;align-items:center;gap:12px;">
<div style="width:36px;height:36px;border-radius:999px;
background:radial-gradient(circle at 30% 30%, #a5b4fc, #6366f1);
display:flex;align-items:center;justify-content:center;
color:#020617;font-weight:700;font-size:17px;
box-shadow:0 6px 16px rgba(99,102,241,0.35);">
C
</div>
<div style="line-height:1.25;">
<div style="font-weight:600;font-size:13px;letter-spacing:0.10em;
text-transform:uppercase;color:#f1f5f9;">
CMD‑BERT
</div>
<div style="font-size:11.5px;color:#94a3b8;margin-top:2px;">
Cebuano Misinformation Detector
</div>
</div>
</div>
<div style="display:flex;align-items:center;gap:10px;font-size:13px;
color:#e5e7eb;opacity:0.9;">
<span>About CMD‑BERT</span>
<div style="width:26px;height:26px;border-radius:999px;
background:rgba(148,163,184,0.30);
border:1px solid rgba(148,163,184,0.35);"></div>
</div>
</header>
</div>
"""
)
|