diff --git a/examples/crash_reporter/backend/public/assets/css/app.css b/examples/crash_reporter/backend/public/assets/css/app.css index 546b409..cd16996 100644 --- a/examples/crash_reporter/backend/public/assets/css/app.css +++ b/examples/crash_reporter/backend/public/assets/css/app.css @@ -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; diff --git a/examples/crash_reporter/backend/public/assets/js/i18n.js b/examples/crash_reporter/backend/public/assets/js/i18n.js index 252c1e4..5b35eaa 100644 --- a/examples/crash_reporter/backend/public/assets/js/i18n.js +++ b/examples/crash_reporter/backend/public/assets/js/i18n.js @@ -6,6 +6,12 @@ const SUPPORTED = ['en', 'ru']; const DEFAULT_LANG = 'en'; + /** @type {Record} */ + 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(); } diff --git a/examples/crash_reporter/backend/views/layout.php b/examples/crash_reporter/backend/views/layout.php index 5604e3e..885ac30 100644 --- a/examples/crash_reporter/backend/views/layout.php +++ b/examples/crash_reporter/backend/views/layout.php @@ -77,7 +77,8 @@