chore: listening css

This commit is contained in:
DDMeaqua 2024-10-14 14:11:23 +08:00
parent b91c224d75
commit 7475519473
2 changed files with 13 additions and 1 deletions

View File

@ -75,6 +75,14 @@
pointer-events: none;
}
&.listening {
width: var(--full-width);
.text {
opacity: 1;
transform: translate(0);
}
}
&:hover {
--delay: 0.5s;
width: var(--full-width);

View File

@ -370,6 +370,7 @@ export function ChatAction(props: {
text: string;
icon: JSX.Element;
onClick: () => void;
isListening: boolean;
}) {
const iconRef = useRef<HTMLDivElement>(null);
const textRef = useRef<HTMLDivElement>(null);
@ -391,7 +392,9 @@ export function ChatAction(props: {
return (
<div
className={`${styles["chat-input-action"]} clickable`}
className={`${styles["chat-input-action"]} clickable ${
props.isListening ? styles["listening"] : ""
}`}
onClick={() => {
props.onClick();
setTimeout(updateWidth, 1);
@ -838,6 +841,7 @@ export function ChatActions(props: {
}
text={isListening ? Locale.Chat.StopSpeak : Locale.Chat.StartSpeak}
icon={isListening ? <VoiceOpenIcon /> : <VoiceCloseIcon />}
isListening={isListening}
/>
)}
</div>