diff --git a/Frontend-Learner/components/common/LanguageSwitcher.vue b/Frontend-Learner/components/common/LanguageSwitcher.vue index d27b9129..366cae3a 100644 --- a/Frontend-Learner/components/common/LanguageSwitcher.vue +++ b/Frontend-Learner/components/common/LanguageSwitcher.vue @@ -15,10 +15,8 @@ const availableLocales = computed(() => { })) }) -// Get current locale display (TH or EN) -const currentLocaleDisplay = computed(() => { - return locale.value.toUpperCase() -}) +// Get flag image path for a locale +const getFlagPath = (code: string) => `/flags/${code}.png` // Handle locale change const changeLocale = async (code: string) => { @@ -34,14 +32,19 @@ const changeLocale = async (code: string) => { class="language-btn" :aria-label="$t('language.label')" > - {{ currentLocaleDisplay }} + + - + {{ $t('language.label') }} @@ -56,7 +59,11 @@ const changeLocale = async (code: string) => { class="language-item" > - {{ loc.code === 'th' ? 'πŸ‡ΉπŸ‡­' : 'πŸ‡ΊπŸ‡Έ' }} + @@ -81,21 +88,33 @@ const changeLocale = async (code: string) => { .language-btn { width: 40px; height: 40px; - background: linear-gradient(135deg, var(--primary) 0%, #2f5ed7 100%); - color: white; + background: #ffffff; + border: 2px solid var(--border-color); transition: all 0.3s ease; - box-shadow: 0 2px 8px rgba(75, 130, 247, 0.3); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); + overflow: hidden; + padding: 0; } .language-btn:hover { transform: scale(1.05); - box-shadow: 0 4px 12px rgba(75, 130, 247, 0.4); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); + border-color: var(--primary); } -.language-text { - font-size: 12px; - font-weight: 800; - letter-spacing: 0.5px; +.flag-icon { + width: 28px; + height: 28px; + object-fit: cover; + border-radius: 50%; +} + +.flag-icon-menu { + width: 28px; + height: 20px; + object-fit: cover; + border-radius: 4px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); } .language-item { @@ -120,12 +139,14 @@ const changeLocale = async (code: string) => { } :global(.dark) .language-btn { - background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%); - box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4); + background: #1e293b; + border-color: rgba(255, 255, 255, 0.15); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); } :global(.dark) .language-btn:hover { - box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); + border-color: var(--primary); } :global(.dark) :deep(.language-menu) { diff --git a/Frontend-Learner/public/flags/en.png b/Frontend-Learner/public/flags/en.png new file mode 100644 index 00000000..fbdbf489 Binary files /dev/null and b/Frontend-Learner/public/flags/en.png differ diff --git a/Frontend-Learner/public/flags/th.png b/Frontend-Learner/public/flags/th.png new file mode 100644 index 00000000..45b16f48 Binary files /dev/null and b/Frontend-Learner/public/flags/th.png differ