header: language dropdown + Thai as default language

- replace the two inline TH/EN buttons with a single dropdown (icon + label +
  caret) mirroring the Next app's LangSwitch: aria-haspopup/expanded,
  menuitemradio + aria-checked, close on Esc/outside, focus management
- i18n.js: default language is Thai (no longer guesses from navigator.language);
  saved choice still wins via at_lang
- bump VERSION 2026.09.27.109
This commit is contained in:
Bkk1234 committed 2026-11-04 01:17:32 +07:00
1 parent 246b864c06
commit bea8f0773e
5 files changed
+147 -46

No files matched your search

+60 -16
View File
@@ -406,35 +406,79 @@ body:has(.mu-site-footer) .mu-footer { display: none; }
padding: 10px 12px 10px 38px;
}
/* ---------- ปุ่มสลับภาษา (ไทย / EN) ---------- */
/* ---------- ปุ่มสลับภาษา (dropdown เดียว — ไทย / English) ---------- */
.mu-lang-switch {
position: relative;
display: inline-flex;
align-items: center;
gap: 2px;
background: #f0edf7;
border: 1px solid #e4dcf2;
border-radius: 999px;
padding: 3px;
flex-shrink: 0;
}
.mu-lang-btn {
border: 0;
background: transparent;
display: inline-flex;
align-items: center;
gap: 6px;
min-height: 34px;
padding: 6px 12px;
border: 1px solid #e4dcf2;
border-radius: 999px;
background: #f0edf7;
color: #6d28d9;
font-family: inherit;
font-weight: 700;
font-size: .72rem;
font-size: .76rem;
line-height: 1;
padding: 6px 10px;
border-radius: 999px;
cursor: pointer;
transition: background .15s ease, color .15s ease;
transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.mu-lang-btn:hover { color: #5b21b6; }
.mu-lang-btn.active {
.mu-lang-btn:hover { color: #5b21b6; border-color: #d9cdf0; }
.mu-lang-btn[aria-expanded="true"] { background: #fff; border-color: #cbb8ea; }
.mu-lang-btn .ic { width: 15px; height: 15px; }
.mu-lang-caret {
width: 0 !important;
height: 0 !important;
margin-left: 1px;
border: 4px solid transparent;
border-top-color: currentColor;
transition: transform .18s ease;
}
.mu-lang-btn[aria-expanded="true"] .mu-lang-caret { transform: rotate(180deg); }
.mu-lang-menu {
position: absolute;
top: calc(100% + 6px);
right: 0;
z-index: 1200;
min-width: 168px;
padding: 6px;
background: #fff;
color: #7a4cc0;
box-shadow: 0 1px 4px rgba(63, 43, 94, .18);
border: 1px solid #e7e0f6;
border-radius: 12px;
box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
}
.mu-lang-menu[hidden] { display: none; }
.mu-lang-menu button {
display: flex;
align-items: center;
gap: 8px;
width: 100%;
min-height: 38px;
padding: 8px 10px;
border: 0;
border-radius: 8px;
background: transparent;
color: #2c3550;
font-family: inherit;
font-size: .84rem;
font-weight: 600;
text-align: left;
cursor: pointer;
}
.mu-lang-menu button:hover { background: #f6f2ff; }
.mu-lang-menu button[aria-checked="true"] { color: #7a4cc0; font-weight: 800; background: #f4f0fb; }
.mu-lang-menu button .mu-lang-code {
margin-left: auto;
font-family: ui-monospace, "IBM Plex Mono", monospace;
font-size: .72rem;
color: #8a93a8;
}
/* ============================================================