Skip to content

Commit

Permalink
chore: listening css
Browse files Browse the repository at this point in the history
  • Loading branch information
DDMeaqua committed Oct 14, 2024
1 parent b91c224 commit 7475519
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions app/components/chat.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion app/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -838,6 +841,7 @@ export function ChatActions(props: {
}
text={isListening ? Locale.Chat.StopSpeak : Locale.Chat.StartSpeak}
icon={isListening ? <VoiceOpenIcon /> : <VoiceCloseIcon />}
isListening={isListening}
/>
)}
</div>
Expand Down

0 comments on commit 7475519

Please sign in to comment.