From 26ac8a55741fcb4de9f647d949028dd288a8328b Mon Sep 17 00:00:00 2001 From: Tristan Yang Date: Mon, 3 Apr 2023 11:59:51 +0800 Subject: [PATCH] feat: speaking animation --- src/routes/chat/VoiceChat/VoiceManagement.tsx | 10 ++++++---- tailwind.config.js | 11 +++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/routes/chat/VoiceChat/VoiceManagement.tsx b/src/routes/chat/VoiceChat/VoiceManagement.tsx index 7124d72e..0cd4d9a8 100644 --- a/src/routes/chat/VoiceChat/VoiceManagement.tsx +++ b/src/routes/chat/VoiceChat/VoiceManagement.tsx @@ -12,6 +12,7 @@ import IconMicOff from '../../../assets/icons/mic.off.svg'; import StyledButton from '../../../common/component/styled/Button'; import IconCallOff from '../../../assets/icons/call.off.svg'; import Tooltip from '../../../common/component/Tooltip'; +import SpeakingAnimate from './SpeakingAnimate'; // import User from '../../../common/component/User'; type Props = { @@ -48,12 +49,13 @@ const VoiceManagement = ({ info, setMute, setDeafen, leave }: Props) => { const { muted, speakingVolume = 0 } = membersData[uid]; const speaking = speakingVolume > 50; return
  • -
    -
    +
    +
    + {speaking &&
    } {
    {/* {deafen ? : } */} - {muted ? : } + {muted ? : }
    {/* */} {/* {userData[uid]?.name} */} diff --git a/tailwind.config.js b/tailwind.config.js index dbab1e2b..becc4e56 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -22,6 +22,9 @@ module.exports = { 900: "#164C63" } }, + animation: { + speaking: "speaking 0.5s infinite cubic-bezier(.36, .11, .89, .32) alternate" + }, keyframes: { fadeInUp: { from: { @@ -33,6 +36,14 @@ module.exports = { opacity: 1, transform: `translate3d(0, 0, 0)` } + }, + speaking: { + from: { + opacity: 0.8 + }, + to: { + opacity: 0 + } } } }