From 54e44dd737f6c5c4b529aad4550f4e06014a825f Mon Sep 17 00:00:00 2001 From: admtracksteel Date: Mon, 25 May 2026 12:44:07 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20Auto-deploy:=20melhoria=20no=20s?= =?UTF-8?q?nap=20e=20medi=C3=A7=C3=A3o=20AR=20em=2025/05/2026=2012:44:07?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/MeetingRoom.tsx | 213 ++++++-------------------------------- 1 file changed, 30 insertions(+), 183 deletions(-) diff --git a/src/pages/MeetingRoom.tsx b/src/pages/MeetingRoom.tsx index 5cce7bb..e3962d8 100644 --- a/src/pages/MeetingRoom.tsx +++ b/src/pages/MeetingRoom.tsx @@ -32,7 +32,7 @@ class ModelErrorBoundary extends React.Component) { const groupRef = useRef(null); const ringRef = useRef(null); + const headRef = useRef(null); const lastSenderRef = useRef(isLastChatSender); const pulseEndTimeRef = useRef(0); @@ -176,27 +177,26 @@ function MiiAvatarBackup({ lastSenderRef.current = isLastChatSender; }, [isLastChatSender]); - const mii = useMemo(() => { - const skin = SKIN_COLORS[(avatarId - 1) % SKIN_COLORS.length]; - return { - skin, - hairColor: avatarId === 3 ? '#eab308' : avatarId === 9 ? '#a855f7' : avatarId === 5 ? '#f97316' : '#27272a', - hasGlasses: avatarId === 1 || avatarId === 8, - glassesColor: avatarId === 8 ? '#18181b' : '#ef4444', - hasCap: avatarId === 4, - capColor: '#3b82f6', - hasHat: avatarId === 10, - hatColor: '#b45309', - hairStyle: avatarId === 7 ? 'bald' : (avatarId === 9 ? 'modern' : (avatarId % 3 === 0 ? 'long' : 'short')), - beard: avatarId === 7, - }; - }, [avatarId]); + const avatarUrl = useMemo(() => { + const seed = `${username || 'user'}_${avatarId}`; + return `https://api.dicebear.com/7.x/toon-head/png?seed=${encodeURIComponent(seed)}&backgroundColor=transparent`; + }, [username, avatarId]); useFrame((state) => { if (groupRef.current && props.position && Array.isArray(props.position) && props.position.length >= 2) { groupRef.current.position.y = (props.position[1] as number) + Math.sin(state.clock.getElapsedTime() * 2 + avatarId) * 0.012; } + if (headRef.current) { + if (isTalking) { + headRef.current.position.y = 0.16 + Math.abs(Math.sin(state.clock.getElapsedTime() * 12)) * 0.025; + headRef.current.rotation.z = Math.sin(state.clock.getElapsedTime() * 12) * 0.06; + } else { + headRef.current.position.y = THREE.MathUtils.lerp(headRef.current.position.y, 0.16, 0.15); + headRef.current.rotation.z = THREE.MathUtils.lerp(headRef.current.rotation.z, 0, 0.15); + } + } + if (ringRef.current) { const now = Date.now(); const material = ringRef.current.material as THREE.MeshBasicMaterial; @@ -236,7 +236,7 @@ function MiiAvatarBackup({ return ( - + @@ -253,175 +253,22 @@ function MiiAvatarBackup({ )} - - - - - - {mii.hairStyle === 'short' && ( - - - - - - - - - - - - - - - )} - - {mii.hairStyle === 'long' && ( - - - - - - - - - - - - - - - - - - - )} - - {mii.hairStyle === 'modern' && ( - - - - - - - - - - - - - - - - - - - )} - - {mii.hasCap && ( - - - - - - - - - - - )} - - {mii.hasHat && ( - - - - - - - - - - - )} - - - - - - - - - - - - - - - - - - - - - + {/* Cabeça do Avatar: Toon Head do Dicebear em Billboard com efeito de pulo ao falar */} + + + + - - - + {/* Base cônica para dar uma sustentação 3D estilizada */} + + + - - - - - - - - - - - - - - - - - - - - - - - - - {mii.beard && ( - - - - - - - - - - - )} - - {mii.hasGlasses && ( - - - - - - - - - - - - - - - )} ); }