Browse Source

fix: 情绪高亮

pull/16/head
WIN-UGQIHHLSKBB\EDY 2 weeks ago
parent
commit
f6734eb0e8
  1. 1
      src/locales/en-US.json
  2. 1
      src/locales/zh-CN.json
  3. 1
      src/locales/zh-TW.json
  4. 19
      src/pages/Voice/components/speech/VoiceSpeechPanel.tsx
  5. 21
      src/pages/Voice/index.scss

1
src/locales/en-US.json

@ -839,6 +839,7 @@
"pages.voice.speech.language.placeholder": "Select language",
"pages.voice.speech.shortcut.emotion": "+ Emotion",
"pages.voice.speech.emotion.aria": "Select emotion",
"pages.voice.speech.emotion.reset": "Reset",
"pages.voice.speech.emotion.happy": "Happy",
"pages.voice.speech.emotion.sad": "Sad",
"pages.voice.speech.emotion.angry": "Angry",

1
src/locales/zh-CN.json

@ -839,6 +839,7 @@
"pages.voice.speech.language.placeholder": "选择语言",
"pages.voice.speech.shortcut.emotion": "+ 情绪",
"pages.voice.speech.emotion.aria": "选择情绪",
"pages.voice.speech.emotion.reset": "重置",
"pages.voice.speech.emotion.happy": "高兴",
"pages.voice.speech.emotion.sad": "悲伤",
"pages.voice.speech.emotion.angry": "愤怒",

1
src/locales/zh-TW.json

@ -817,6 +817,7 @@
"pages.voice.speech.language.placeholder": "選擇語言",
"pages.voice.speech.shortcut.emotion": "+ 情緒",
"pages.voice.speech.emotion.aria": "選擇情緒",
"pages.voice.speech.emotion.reset": "重設",
"pages.voice.speech.emotion.happy": "高興",
"pages.voice.speech.emotion.sad": "悲傷",
"pages.voice.speech.emotion.angry": "憤怒",

19
src/pages/Voice/components/speech/VoiceSpeechPanel.tsx

@ -1926,6 +1926,19 @@ export function VoiceSpeechPanel() {
getPopupContainer={() => document.body}
droplist={
<div className="voicePage__speechLanguageDropdown" role="menu" aria-label={t("pages.voice.speech.emotion.aria")}>
<button
type="button"
role="menuitem"
className="voicePage__speechLanguageOption voicePage__speechLanguageOption_reset"
disabled={selectedSpeechEmotion == null}
onClick={() => {
setSelectedSpeechEmotion(null);
setSpeechEmotionMenuOpen(false);
}}
>
{t("pages.voice.speech.emotion.reset")}
</button>
<div className="voicePage__speechEmotionDropdownDivider" role="separator" aria-hidden />
{SPEECH_EMOTION_OPTIONS.map((key) => {
const isActive = selectedSpeechEmotion === key;
return (
@ -1948,7 +1961,11 @@ export function VoiceSpeechPanel() {
>
<button
type="button"
className="voicePage__speechShortcut voicePage__speechShortcut_emotion"
className={classNames(
"voicePage__speechShortcut",
"voicePage__speechShortcut_emotion",
selectedSpeechEmotion != null && "voicePage__speechShortcut_emotion_selected",
)}
aria-haspopup="menu"
aria-expanded={speechEmotionMenuOpen}
aria-label={t("pages.voice.speech.emotion.aria")}

21
src/pages/Voice/index.scss

@ -1969,6 +1969,21 @@ $upload-crop-selection-rail-height: 3px;
font-weight: 500;
}
.voicePage__speechLanguageOption_reset {
color: #999999;
&:disabled {
cursor: not-allowed;
opacity: 0.5;
}
}
.voicePage__speechEmotionDropdownDivider {
height: 1px;
margin: 4px 0;
background: #e5e6eb;
}
.voicePage__speechLanguageBtn:disabled {
cursor: not-allowed;
opacity: 0.6;
@ -2330,9 +2345,9 @@ $upload-crop-selection-rail-height: 3px;
}
}
.voicePage__speechShortcut_emotion {
background: #d4d4d4;
color: #ffffff;
.voicePage__speechShortcut_emotion_selected {
background: linear-gradient(90deg, #f0f0f0 0%, #d6ceef 100%);
color: #333333;
}
.voicePage__speechShortcutTooltip {

Loading…
Cancel
Save