diff --git a/components/AIChatWidget.tsx b/components/AIChatWidget.tsx index e86f67e..a8d4f51 100644 --- a/components/AIChatWidget.tsx +++ b/components/AIChatWidget.tsx @@ -4,12 +4,23 @@ import { useState, useEffect, useRef } from 'react' import { useSession } from 'next-auth/react' import Image from 'next/image' -// 添加shimmer动画样式 +// 添加动画样式 const shimmerStyle = ` @keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } } + + @keyframes breathe { + 0%, 100% { + filter: blur(15px) brightness(0.7); + transform: scale(1); + } + 50% { + filter: blur(12px) brightness(0.8); + transform: scale(1.02); + } + } ` // 图片加载占位符组件 @@ -55,6 +66,7 @@ interface Message { timestamp: Date isGenerating?: boolean // 是否正在生成图片 imageCount?: number // 预期生成的图片数量 + sourceImages?: string[] // 用户发送的原始图片(用于显示模糊占位符) } export default function AIChatWidget() { @@ -256,7 +268,8 @@ export default function AIChatWidget() { content: '', timestamp: new Date(), isGenerating: shouldShowImagePlaceholder, - imageCount: shouldShowImagePlaceholder ? 4 : 0 + imageCount: shouldShowImagePlaceholder ? 4 : 0, + sourceImages: currentImages.length > 0 ? currentImages : undefined // 保存用户发送的原图 } setMessages(prev => [...prev, tempAiMessage]) @@ -414,31 +427,78 @@ export default function AIChatWidget() { } rounded-lg px-4 py-3`}> {msg.content &&