1
0
mirror of git://f0xx.org/android_cast synced 2026-07-29 03:38:52 +03:00

Polish nav: distinct tickets icon and flag language picker.

Tickets use a clipboard-with-check glyph instead of a document stack.
Locale control shows country flag only when the shell is collapsed,
and flag plus two-letter code when expanded (login always shows both).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Anton Afanasyeu
2026-05-24 21:28:17 +02:00
parent 670b6b5f5f
commit 4e5f1a3732
4 changed files with 87 additions and 38 deletions

View File

@@ -129,10 +129,12 @@ a:hover { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) {
.nav-pane,
.nav-link,
.nav-label {
.nav-label,
.locale-code {
transition: none;
}
.nav-pane.open .nav-label {
.nav-pane.open .nav-label,
.nav-pane.open .locale-code {
transition-delay: 0s;
}
}
@@ -196,21 +198,42 @@ a:hover { text-decoration: underline; }
}
.nav-icon--reports::before { top: 5px; }
.nav-icon--reports::after { top: 10px; width: 70%; }
/* Task ticket — clipboard + check (distinct from stacked “reports” document) */
.nav-icon--tickets {
width: 16px;
width: 14px;
height: 16px;
margin-top: 2px;
border: 2px solid currentColor;
border-radius: 2px;
border-top: none;
border-radius: 0 0 4px 4px;
box-sizing: border-box;
}
.nav-icon--tickets::before {
content: "";
position: absolute;
top: 3px;
top: 0;
left: 50%;
transform: translateX(-50%);
width: 9px;
height: 5px;
border: 2px solid currentColor;
border-bottom: none;
border-radius: 3px 3px 0 0;
box-sizing: border-box;
background: var(--surface);
}
.nav-icon--tickets::after {
content: "";
position: absolute;
left: 3px;
bottom: 3px;
width: 6px;
height: 2px;
background: currentColor;
box-shadow: 0 4px 0 currentColor;
height: 4px;
border-left: 2px solid currentColor;
border-bottom: 2px solid currentColor;
transform: rotate(-45deg);
transform-origin: left bottom;
box-sizing: border-box;
}
.ticket-col-issue { min-width: 200px; max-width: 420px; }
.ticket-issue-title { font-weight: 600; }
@@ -481,43 +504,45 @@ a:hover { text-decoration: underline; }
}
.nav-locale .locale-picker {
width: 100%;
justify-content: flex-start;
justify-content: center;
padding: 6px 8px;
gap: 0;
}
.nav-icon--locale {
width: 18px;
height: 18px;
border: 2px solid currentColor;
border-radius: 50%;
box-sizing: border-box;
.nav-pane.open .nav-locale .locale-picker {
justify-content: flex-start;
gap: 8px;
}
.nav-icon--locale::before {
content: "";
position: absolute;
left: 50%;
top: 1px;
bottom: 1px;
width: 2px;
margin-left: -1px;
background: currentColor;
border-radius: 1px;
.locale-flag {
flex-shrink: 0;
font-size: 1.25rem;
line-height: 1;
width: 1.35rem;
text-align: center;
user-select: none;
pointer-events: none;
}
.nav-icon--locale::after {
content: "";
position: absolute;
left: 2px;
right: 2px;
top: 50%;
height: 2px;
margin-top: -1px;
background: currentColor;
border-radius: 1px;
.locale-code {
flex: 0 1 auto;
font-size: 12px;
font-weight: 700;
letter-spacing: 0.04em;
line-height: 1;
white-space: nowrap;
overflow: hidden;
opacity: 0;
max-width: 0;
transition: opacity .18s ease, max-width .22s ease;
}
.nav-pane.open .locale-code {
opacity: 1;
max-width: 2.5rem;
transition-delay: .06s;
}
.locale-picker {
position: relative;
display: inline-flex;
align-items: center;
gap: 4px;
gap: 6px;
min-height: 32px;
padding: 4px 6px;
border-radius: 8px;
@@ -561,6 +586,10 @@ a:hover { text-decoration: underline; }
right: 12px;
z-index: 5;
}
.login-locale .locale-code {
opacity: 1;
max-width: 2.5rem;
}
.login-page .login-card { margin-top: 2.5rem; }
.toolbar-select select {
padding: 6px 8px;

View File

@@ -6,6 +6,12 @@
const SUPPORTED = ['en', 'ru'];
const DEFAULT_LANG = 'en';
/** @type {Record<string, { flag: string, code: string }>} */
const LANG_DISPLAY = {
en: { flag: '\uD83C\uDDEC\uD83C\uDDE7', code: 'EN' },
ru: { flag: '\uD83C\uDDF7\uD83C\uDDFA', code: 'RU' },
};
let lang = DEFAULT_LANG;
let catalog = {};
let fallback = {};
@@ -104,6 +110,17 @@
document.querySelectorAll('.lang-select').forEach((sel) => {
if (sel.value !== lang) sel.value = lang;
});
syncLocaleDisplay(lang);
}
function syncLocaleDisplay(code) {
const meta = LANG_DISPLAY[code] || LANG_DISPLAY[DEFAULT_LANG];
document.querySelectorAll('.locale-flag').forEach((el) => {
el.textContent = meta.flag;
});
document.querySelectorAll('.locale-code').forEach((el) => {
el.textContent = meta.code;
});
}
async function setLang(code, options) {
@@ -142,6 +159,7 @@
await setLang(lang, { silent: true });
apply(document);
initLangSelect();
syncLocaleDisplay(lang);
readyResolve();
}

View File

@@ -77,7 +77,8 @@
</ul>
<div class="nav-locale">
<div class="locale-picker" data-i18n-title="lang.label" title="Language">
<span class="nav-icon nav-icon--locale" aria-hidden="true"></span>
<span class="locale-flag" id="locale-flag" aria-hidden="true">🇬🇧</span>
<span class="locale-code" id="locale-code" aria-hidden="true">EN</span>
<select class="lang-select locale-picker__select" id="lang-select" data-i18n-aria="lang.label" aria-label="Language">
<option value="en">EN</option>
<option value="ru">RU</option>

View File

@@ -30,7 +30,8 @@ $bp = Auth::basePath();
<body class="login-page" data-base-path="<?= h($bp) ?>">
<div class="login-locale">
<div class="locale-picker" data-i18n-title="lang.label" title="Language">
<span class="nav-icon nav-icon--locale" aria-hidden="true"></span>
<span class="locale-flag" aria-hidden="true">🇬🇧</span>
<span class="locale-code" aria-hidden="true">EN</span>
<select class="lang-select locale-picker__select" data-i18n-aria="lang.label" aria-label="Language">
<option value="en">EN</option>
<option value="ru">RU</option>