From 1fd3907ceb5c9a24e38486791182c8ce7f31c7b8 Mon Sep 17 00:00:00 2001 From: jinyaqiu Date: Fri, 1 Aug 2025 18:02:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/(tabs)/index.tsx | 38 +++++++++++++++++++++++++++++++++++++- app/(tabs)/owner.tsx | 8 +++----- 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/app/(tabs)/index.tsx b/app/(tabs)/index.tsx index 975b366..c80353f 100644 --- a/app/(tabs)/index.tsx +++ b/app/(tabs)/index.tsx @@ -29,6 +29,9 @@ export default function HomeScreen() { subtitle: new Animated.Value(0), // 副标题动画 })); + // 添加挥手动画值 + const waveAnim = useRef(new Animated.Value(0)).current; + // 启动IP图标摇晃动画 const startShaking = () => { // 停止任何正在进行的动画 @@ -176,6 +179,31 @@ export default function HomeScreen() { buttonLoopAnim.current.start(); }; + // 启动挥手动画 + const startWaveAnimation = () => { + // 创建循环动画:左右摇摆 + Animated.loop( + Animated.sequence([ + Animated.timing(waveAnim, { + toValue: 1, + duration: 500, + useNativeDriver: true, + }), + Animated.timing(waveAnim, { + toValue: -1, + duration: 500, + useNativeDriver: true, + }), + Animated.timing(waveAnim, { + toValue: 0, + duration: 500, + useNativeDriver: true, + }), + Animated.delay(1000), // 暂停1秒 + ]) + ).start(); + }; + // 组件挂载时启动动画 useEffect(() => { setIsLoading(true); @@ -199,6 +227,8 @@ export default function HomeScreen() { .then(() => startDescriptionAnimation()) .then(() => startButtonAnimation()) .catch(console.error); + // 启动挥手动画 + startWaveAnimation(); }); // 组件卸载时清理动画 @@ -231,6 +261,12 @@ export default function HomeScreen() { ], }; + // 旋转动画插值 + const rotate = waveAnim.interpolate({ + inputRange: [-1, 0, 1], + outputRange: ['-15deg', '0deg', '15deg'], + }); + if (isLoading) { return ( @@ -309,7 +345,7 @@ export default function HomeScreen() { {/* Animated IP */} - + diff --git a/app/(tabs)/owner.tsx b/app/(tabs)/owner.tsx index 3e7322e..2bffecc 100644 --- a/app/(tabs)/owner.tsx +++ b/app/(tabs)/owner.tsx @@ -1,9 +1,7 @@ import ConversationsSvg from '@/assets/icons/svg/conversations.svg'; import StoriesSvg from '@/assets/icons/svg/stories.svg'; import AskNavbar from '@/components/layout/ask'; -import CarouselComponent from '@/components/owner/carousel'; import CreateCountComponent from '@/components/owner/createCount'; -import Ranking from '@/components/owner/ranking'; import MemberCard from '@/components/owner/rights/memberCard'; import SettingModal from '@/components/owner/setting'; import UserInfo from '@/components/owner/userName'; @@ -91,9 +89,9 @@ export default function OwnerPage() { {/* 分类 */} - + {/* - + */} {/* 作品数据 */} @@ -102,7 +100,7 @@ export default function OwnerPage() { {/* 排行榜 */} - + {/* */} } // 优化性能:添加 getItemLayout