diff --git a/CHANGELOG.md b/CHANGELOG.md index ac67ced1..8722bdad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to ### Added - ✨(backend) allow searching the recording admin table by owner email +- ✨(frontend) add participant color gradient when camera is off #1490 ### Changed diff --git a/src/frontend/src/features/rooms/livekit/components/ParticipantPlaceholder.tsx b/src/frontend/src/features/rooms/livekit/components/ParticipantPlaceholder.tsx index 13947f58..8338aa9a 100644 --- a/src/frontend/src/features/rooms/livekit/components/ParticipantPlaceholder.tsx +++ b/src/frontend/src/features/rooms/livekit/components/ParticipantPlaceholder.tsx @@ -2,6 +2,7 @@ import type { Participant } from 'livekit-client' import { styled } from '@/styled-system/jsx' import { Avatar } from '@/components/Avatar' import { useIsSpeaking } from '@livekit/components-react' +import { getParticipantBackgroundGradient } from '@/features/rooms/utils/getParticipantBackgroundGradient' import { getParticipantColor } from '@/features/rooms/utils/getParticipantColor' import { useSize } from '@/features/rooms/livekit/hooks/useResizeObserver' import { useMemo, useRef } from 'react' @@ -10,7 +11,6 @@ const StyledParticipantPlaceHolder = styled('div', { base: { width: '100%', height: '100%', - backgroundColor: 'primaryDark.100', display: 'flex', justifyContent: 'center', alignItems: 'center', @@ -26,6 +26,10 @@ export const ParticipantPlaceholder = ({ }: ParticipantPlaceholderProps) => { const isSpeaking = useIsSpeaking(participant) const participantColor = getParticipantColor(participant) + const backgroundGradient = useMemo( + () => getParticipantBackgroundGradient(participantColor), + [participantColor] + ) const placeholderEl = useRef(null) const { width, height } = useSize(placeholderEl) @@ -39,7 +43,13 @@ export const ParticipantPlaceholder = ({ const initialSize = useMemo(() => Math.round(avatarSize * 0.3), [avatarSize]) return ( - +
+ `radial-gradient(circle at 50% 45%, + color-mix(in oklch, ${color} 82%, white) 0%, + color-mix(in oklch, ${color} 90%, white) 8%, + ${color} 35%, + color-mix(in oklch, ${color} 85%, black) 65%, + color-mix(in oklch, ${color} 65%, black) 100%)`