fix(skins): localize selector and animate gradient states

This commit is contained in:
illusia committed 2026-09-27 09:17:46 +08:00
1 parent e09a19b7b4
commit 30682cd659
7 files changed
+47 -24

No files matched your search

+29 -7
View File
@@ -142,24 +142,46 @@ onUnmounted(() => document.removeEventListener("pointerdown", onDocumentPointerD
min-height: 36px;
padding: 0 9px;
color: #123849;
background: rgba(255, 255, 255, .62);
border: 1px solid rgba(255, 255, 255, .5);
background: linear-gradient(112deg, rgba(255, 255, 255, .96), rgba(225, 250, 249, .96), rgba(188, 241, 237, .94), rgba(255, 255, 255, .96));
background-size: 240% 100%;
border: 1px solid rgba(139, 218, 216, .46);
border-radius: 7px;
font: inherit;
font-size: 11px;
text-align: left;
cursor: pointer;
animation: skin-option-gradient 8s ease-in-out infinite alternate;
transition: color .18s, border-color .18s, box-shadow .18s, background-position .4s ease;
}
.skin-option > .ui-icon:first-child { color: #64858a; }
.skin-option > .ui-icon:last-child { margin-left: auto; color: #087e86; }
.skin-option:hover,
.skin-option:focus-visible,
.skin-option.selected {
.skin-option:focus-visible {
color: #087e86;
background: rgba(211, 245, 248, .92);
border-color: rgba(71, 201, 212, .42);
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .82);
border-color: rgba(57, 195, 193, .74);
background-position: 100% 50%;
box-shadow: 0 4px 13px rgba(43, 179, 181, .16), inset 0 0 0 1px rgba(255, 255, 255, .84);
}
.skin-option.selected {
color: #056f73;
border-color: rgba(44, 183, 181, .78);
background-image: linear-gradient(112deg, #faffff 0%, #c8f5f1 36%, #82e2dc 70%, #d9fbf8 100%);
background-position: 100% 50%;
box-shadow: 0 5px 16px rgba(37, 170, 171, .22), inset 0 0 0 1px rgba(255, 255, 255, .94), inset 0 -1px 0 rgba(31, 164, 163, .12);
}
.skin-option.selected > .ui-icon:first-child,
.skin-option.selected > .ui-icon:last-child { color: #087e86; }
@keyframes skin-option-gradient {
from { background-position: 0% 50%; }
to { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
.skin-option { animation: none; }
}
@media (max-width: 520px) {
+5
View File
@@ -8,6 +8,7 @@ export const webClientTranslations: Record<string, Record<string, string>> = {
skinSelector: "皮肤",
skinDay: "日间模式",
skinNight: "夜间模式",
skinIllusia: "ILLUSIA 风",
switchToLightTheme: "切换到浅色主题",
switchToDarkTheme: "切换到深色主题",
browserWorkspace: "浏览器语音工作台",
@@ -339,6 +340,7 @@ export const webClientTranslations: Record<string, Record<string, string>> = {
skinSelector: "Skin",
skinDay: "Day mode",
skinNight: "Night mode",
skinIllusia: "ILLUSIA style",
switchToLightTheme: "Switch to light theme",
switchToDarkTheme: "Switch to dark theme",
browserWorkspace: "Browser voice workspace",
@@ -673,6 +675,7 @@ webClientTranslations.de = {
skinSelector: "Design",
skinDay: "Tagesmodus",
skinNight: "Nachtmodus",
skinIllusia: "ILLUSIA-Stil",
switchToLightTheme: "Zum hellen Design wechseln",
switchToDarkTheme: "Zum dunklen Design wechseln",
browserWorkspace: "Sprachbereich im Browser",
@@ -997,6 +1000,7 @@ webClientTranslations.ru = {
skinSelector: "Оформление",
skinDay: "Дневной режим",
skinNight: "Ночной режим",
skinIllusia: "Стиль ILLUSIA",
switchToLightTheme: "Включить светлую тему",
switchToDarkTheme: "Включить тёмную тему",
browserWorkspace: "Голосовое пространство в браузере",
@@ -1115,6 +1119,7 @@ webClientTranslations.ja = {
skinSelector: "スキン",
skinDay: "昼モード",
skinNight: "夜モード",
skinIllusia: "ILLUSIA スタイル",
switchToLightTheme: "ライトテーマに切り替え",
switchToDarkTheme: "ダークテーマに切り替え",
browserWorkspace: "ブラウザ音声ワークスペース",
+3 -2
View File
@@ -37,12 +37,13 @@ import Icon from "../components/Icon.vue";
import LanguageSwitcher from "../components/LanguageSwitcher.vue";
import SkinSwitcher, { type SkinOption } from "../components/SkinSwitcher.vue";
import { listInstalledSkins, loadLocalPreferences, saveLocalPreferences } from "../services/local-persistence.js";
import { getPublicDefaultSkinId, isPublicSkinEnabled, listPublicSkins, type SkinCatalogEntry } from "../services/skin-catalog.js";
import { BUILTIN_ILLUSIA_SKIN_ID, getPublicDefaultSkinId, isPublicSkinEnabled, listPublicSkins, type SkinCatalogEntry } from "../services/skin-catalog.js";
import { activateSkin, BUILTIN_DARK_SKIN, BUILTIN_LIGHT_SKIN, getStoredSkinId } from "../services/skin-runtime.js";
import type { InstalledSkin } from "../services/skin-pack.js";
import { getStoredTheme, isDarkTheme } from "../services/theme.js";
type Language = "zh" | "en" | "de" | "ru" | "ja";
const illusiaSkinLabels: Record<Language, string> = { zh: "ILLUSIA 风", en: "ILLUSIA style", de: "ILLUSIA-Stil", ru: "Стиль ILLUSIA", ja: "ILLUSIA スタイル" };
interface DemoMessage { id: number; author: string; time: string; text: string; zhText?: string; enText?: string; ruText?: string; jaText?: string; mine: boolean }
type Tab = "channel" | "server";
const storedLanguage = localStorage.getItem("webspeak:language");
@@ -57,7 +58,7 @@ const catalogSkins = ref<SkinCatalogEntry[]>([]);
const skinOptions = computed<SkinOption[]>(() => [
...catalogSkins.value.map((skin) => ({
value: skin.id,
label: skin.id === BUILTIN_LIGHT_SKIN ? copy.value.skinDay : skin.id === BUILTIN_DARK_SKIN ? copy.value.skinNight : skin.name,
label: skin.id === BUILTIN_LIGHT_SKIN ? copy.value.skinDay : skin.id === BUILTIN_DARK_SKIN ? copy.value.skinNight : skin.id === BUILTIN_ILLUSIA_SKIN_ID ? illusiaSkinLabels[language.value] : skin.name,
icon: skin.id === BUILTIN_LIGHT_SKIN ? "sun" : skin.id === BUILTIN_DARK_SKIN ? "moon" : "compass",
})),
...installedSkins.value.filter((skin) => !catalogSkins.value.some((item) => item.id === skin.id) && isPublicSkinEnabled(skin.id)).map((skin) => ({ value: skin.id, label: skin.name, icon: "compass" })),
+1 -1
View File
@@ -558,7 +558,7 @@ const catalogSkins = ref<SkinCatalogEntry[]>([]);
const skinOptions = computed<SkinOption[]>(() => [
...catalogSkins.value.map((skin) => ({
value: skin.id,
label: skin.id === BUILTIN_LIGHT_SKIN ? t("skinDay") : skin.id === BUILTIN_DARK_SKIN ? t("skinNight") : skin.name,
label: skin.id === BUILTIN_LIGHT_SKIN ? t("skinDay") : skin.id === BUILTIN_DARK_SKIN ? t("skinNight") : skin.id === "community.illusia-voice" ? t("skinIllusia") : skin.name,
icon: skin.id === BUILTIN_LIGHT_SKIN ? "sun" : skin.id === BUILTIN_DARK_SKIN ? "moon" : "compass",
})),
...installedSkins.value.filter((skin) => !catalogSkins.value.some((item) => item.id === skin.id) && isPublicSkinEnabled(skin.id)).map((skin) => ({ value: skin.id, label: skin.name, icon: "compass" })),