Spaces:
Running
Running
XQ commited on
Commit ·
c58e0ea
1
Parent(s): 105db3e
Update UI
Browse files- src/ui/app.py +58 -47
src/ui/app.py
CHANGED
|
@@ -387,48 +387,62 @@ st.markdown(
|
|
| 387 |
border-radius: 0 !important;
|
| 388 |
}
|
| 389 |
|
| 390 |
-
/* ---------- Language toggle ---------- */
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
}
|
| 396 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 397 |
display: none !important;
|
| 398 |
}
|
| 399 |
-
|
| 400 |
-
gap: 0 !important;
|
| 401 |
justify-content: flex-end;
|
|
|
|
| 402 |
}
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
padding: 0.3rem 0.9rem;
|
| 407 |
-
font-size: 0.88rem;
|
| 408 |
-
font-weight: 600;
|
| 409 |
-
cursor: pointer;
|
| 410 |
-
border: 1px solid #CCCCCC;
|
| 411 |
-
margin: 0;
|
| 412 |
-
transition: background-color 0.15s, color 0.15s;
|
| 413 |
-
}
|
| 414 |
-
.lang-toggle-wrap [data-testid="stRadio"] [role="radiogroup"] label:first-child {
|
| 415 |
-
border-right: none;
|
| 416 |
-
}
|
| 417 |
-
.lang-toggle-wrap [data-testid="stRadio"] [role="radiogroup"] label:last-child {
|
| 418 |
-
border-left: none;
|
| 419 |
}
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
background
|
| 423 |
-
|
| 424 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 425 |
}
|
| 426 |
-
/*
|
| 427 |
-
|
| 428 |
-
|
|
|
|
| 429 |
}
|
| 430 |
-
|
| 431 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 432 |
}
|
| 433 |
|
| 434 |
/* ---------- Expander ---------- */
|
|
@@ -494,19 +508,16 @@ st.markdown(
|
|
| 494 |
# ---------------------------------------------------------------------------
|
| 495 |
# Language selector -- right-aligned toggle styled in KU red
|
| 496 |
# ---------------------------------------------------------------------------
|
| 497 |
-
_col_spacer, _col_lang = st.columns([
|
| 498 |
with _col_lang:
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
label_visibility="collapsed",
|
| 508 |
-
)
|
| 509 |
-
st.markdown('</div>', unsafe_allow_html=True)
|
| 510 |
|
| 511 |
t = TEXTS[lang]
|
| 512 |
|
|
|
|
| 387 |
border-radius: 0 !important;
|
| 388 |
}
|
| 389 |
|
| 390 |
+
/* ---------- Language toggle (the only st.radio on the page) ---------- */
|
| 391 |
+
/* Collapse vertical space around the toggle row */
|
| 392 |
+
[data-testid="stRadio"] {
|
| 393 |
+
margin: 0 !important;
|
| 394 |
+
padding: 0 !important;
|
| 395 |
+
}
|
| 396 |
+
[data-testid="stRadio"] [role="radiogroup"] label {
|
| 397 |
+
min-height: 0 !important;
|
| 398 |
+
padding-top: 0 !important;
|
| 399 |
+
padding-bottom: 0 !important;
|
| 400 |
+
}
|
| 401 |
+
/* Reduce gap between language row and accent line */
|
| 402 |
+
[data-testid="stHorizontalBlock"]:first-child {
|
| 403 |
+
margin-bottom: -0.8rem !important;
|
| 404 |
+
}
|
| 405 |
+
/* Hide the "Language" label */
|
| 406 |
+
[data-testid="stRadio"] > label {
|
| 407 |
display: none !important;
|
| 408 |
}
|
| 409 |
+
[data-testid="stRadio"] [role="radiogroup"] {
|
| 410 |
+
gap: 0.15rem !important;
|
| 411 |
justify-content: flex-end;
|
| 412 |
+
align-items: center;
|
| 413 |
}
|
| 414 |
+
/* Hide the radio dot circle */
|
| 415 |
+
[data-testid="stRadio"] [role="radiogroup"] label > div:first-child {
|
| 416 |
+
display: none !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 417 |
}
|
| 418 |
+
/* Base style for both options */
|
| 419 |
+
[data-testid="stRadio"] [role="radiogroup"] label {
|
| 420 |
+
background: none !important;
|
| 421 |
+
border: none !important;
|
| 422 |
+
padding: 0 !important;
|
| 423 |
+
margin: 0 !important;
|
| 424 |
+
min-height: 0 !important;
|
| 425 |
+
}
|
| 426 |
+
[data-testid="stRadio"] [role="radiogroup"] label p {
|
| 427 |
+
font-size: 0.92rem !important;
|
| 428 |
+
font-weight: 600 !important;
|
| 429 |
+
color: #999999 !important;
|
| 430 |
+
cursor: pointer;
|
| 431 |
+
transition: color 0.15s;
|
| 432 |
+
line-height: 1 !important;
|
| 433 |
}
|
| 434 |
+
/* Active / checked option → KU red */
|
| 435 |
+
[data-testid="stRadio"] [role="radiogroup"] label[data-checked="true"] p,
|
| 436 |
+
[data-testid="stRadio"] [role="radiogroup"] label:has(input:checked) p {
|
| 437 |
+
color: #901A1E !important;
|
| 438 |
}
|
| 439 |
+
/* Separator between the two options (added via CSS pseudo-element) */
|
| 440 |
+
[data-testid="stRadio"] [role="radiogroup"] label:last-child::before {
|
| 441 |
+
content: "|";
|
| 442 |
+
color: #CCCCCC;
|
| 443 |
+
font-weight: 400;
|
| 444 |
+
margin-right: 0.35rem;
|
| 445 |
+
font-size: 0.92rem;
|
| 446 |
}
|
| 447 |
|
| 448 |
/* ---------- Expander ---------- */
|
|
|
|
| 508 |
# ---------------------------------------------------------------------------
|
| 509 |
# Language selector -- right-aligned toggle styled in KU red
|
| 510 |
# ---------------------------------------------------------------------------
|
| 511 |
+
_col_spacer, _col_lang = st.columns([5, 1.5])
|
| 512 |
with _col_lang:
|
| 513 |
+
lang = st.radio(
|
| 514 |
+
"Language",
|
| 515 |
+
options=["da", "en"],
|
| 516 |
+
format_func=lambda c: "Dansk" if c == "da" else "English",
|
| 517 |
+
index=0,
|
| 518 |
+
horizontal=True,
|
| 519 |
+
label_visibility="collapsed",
|
| 520 |
+
)
|
|
|
|
|
|
|
|
|
|
| 521 |
|
| 522 |
t = TEXTS[lang]
|
| 523 |
|