import { Ionicons } from '@expo/vector-icons'; import { BlurView } from 'expo-blur'; import { LinearGradient } from 'expo-linear-gradient'; import { useRouter } from 'expo-router'; import React, { useEffect } from 'react'; import { Dimensions, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; import Animated, { Easing, useAnimatedStyle, useSharedValue, withDelay, withRepeat, withSequence, withTiming } from 'react-native-reanimated'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { HeaderBar } from '@/components/ui/HeaderBar'; import { Colors } from '@/constants/Colors'; const { width: SCREEN_WIDTH, height: SCREEN_HEIGHT } = Dimensions.get('window'); export default function AIPostureProcessingScreen() { const insets = useSafeAreaInsets(); const router = useRouter(); const theme = Colors.dark; // Core looping animations const spin = useSharedValue(0); const pulse = useSharedValue(0); const scanY = useSharedValue(0); const particle = useSharedValue(0); useEffect(() => { spin.value = withRepeat(withTiming(1, { duration: 6000, easing: Easing.linear }), -1); pulse.value = withRepeat(withSequence( withTiming(1, { duration: 1600, easing: Easing.inOut(Easing.quad) }), withTiming(0, { duration: 1600, easing: Easing.inOut(Easing.quad) }) ), -1, true); scanY.value = withRepeat(withTiming(1, { duration: 3800, easing: Easing.inOut(Easing.cubic) }), -1, false); particle.value = withDelay(400, withRepeat(withTiming(1, { duration: 5200, easing: Easing.inOut(Easing.quad) }), -1, true)); }, []); const ringStyleOuter = useAnimatedStyle(() => ({ transform: [{ rotate: `${spin.value * 360}deg` }], opacity: 0.8, })); const ringStyleInner = useAnimatedStyle(() => ({ transform: [{ rotate: `${-spin.value * 360}deg` }, { scale: 0.98 + pulse.value * 0.04 }], })); const scannerStyle = useAnimatedStyle(() => ({ transform: [{ translateY: (scanY.value * (SCREEN_HEIGHT * 0.45)) - (SCREEN_HEIGHT * 0.225) }], opacity: 0.6 + Math.sin(scanY.value * Math.PI) * 0.2, })); const particleStyleA = useAnimatedStyle(() => ({ transform: [ { translateX: Math.sin(particle.value * Math.PI * 2) * 40 }, { translateY: Math.cos(particle.value * Math.PI * 2) * 24 }, { rotate: `${particle.value * 360}deg` }, ], opacity: 0.5 + 0.5 * Math.abs(Math.sin(particle.value * Math.PI)), })); return ( router.back()} tone="light" transparent /> {/* Layered background */} {/* Hero visualization */} {Array.from({ length: 9 }).map((_, i) => ( {Array.from({ length: 9 }).map((__, j) => ( ))} ))} {/* Copy & actions */} 正在进行体态特征提取与矢量评估 这通常需要 10-30 秒。你可以停留在此页面等待结果,或点击返回稍后在个人中心查看。 router.replace('/ai-posture-result')} > 保持页面等待 router.replace('/(tabs)/personal')}> 返回个人中心 ); } const RING_SIZE = Math.min(SCREEN_WIDTH, SCREEN_HEIGHT) * 0.62; const INNER_RING_SIZE = RING_SIZE * 0.72; const styles = StyleSheet.create({ screen: { flex: 1, }, hero: { flex: 1, alignItems: 'center', justifyContent: 'center', }, blurBlobA: { position: 'absolute', top: -80, right: -60, width: 240, height: 240, borderRadius: 120, backgroundColor: 'rgba(187,242,70,0.20)', }, blurBlobB: { position: 'absolute', bottom: 120, left: -40, width: 220, height: 220, borderRadius: 110, backgroundColor: 'rgba(89, 198, 255, 0.16)', }, heroBackdrop: { position: 'absolute', width: RING_SIZE * 1.08, height: RING_SIZE * 1.08, borderRadius: (RING_SIZE * 1.08) / 2, backgroundColor: 'rgba(25,33,38,0.25)', }, ringOuter: { position: 'absolute', width: RING_SIZE, height: RING_SIZE, borderRadius: RING_SIZE / 2, borderWidth: 1, borderColor: 'rgba(25,33,38,0.16)', }, ringInner: { position: 'absolute', width: INNER_RING_SIZE, height: INNER_RING_SIZE, borderRadius: INNER_RING_SIZE / 2, borderWidth: 2, borderColor: 'rgba(187,242,70,0.65)', shadowColor: Colors.light.accentGreen, shadowOffset: { width: 0, height: 0 }, shadowOpacity: 0.35, shadowRadius: 24, }, grid: { width: RING_SIZE * 0.9, height: RING_SIZE * 0.9, borderRadius: RING_SIZE * 0.45, overflow: 'hidden', padding: 10, backgroundColor: 'rgba(25,33,38,0.08)', }, gridRow: { flexDirection: 'row', }, gridCell: { flex: 1, aspectRatio: 1, margin: 2, borderRadius: 3, backgroundColor: 'rgba(255,255,255,0.16)', }, scanner: { position: 'absolute', left: 0, right: 0, top: '50%', height: 60, marginTop: -30, backgroundColor: 'rgba(187,242,70,0.10)', borderWidth: 1, borderColor: 'rgba(187,242,70,0.25)', }, particleA: { position: 'absolute', right: SCREEN_WIDTH * 0.18, top: 40, width: 14, height: 14, borderRadius: 7, backgroundColor: Colors.light.accentGreen, shadowColor: Colors.light.accentGreen, shadowOffset: { width: 0, height: 0 }, shadowOpacity: 0.4, shadowRadius: 16, }, particleB: { position: 'absolute', right: SCREEN_WIDTH * 0.08, top: 120, width: 8, height: 8, borderRadius: 4, backgroundColor: 'rgba(89, 198, 255, 1)', shadowColor: 'rgba(89, 198, 255, 1)', shadowOffset: { width: 0, height: 0 }, shadowOpacity: 0.4, shadowRadius: 12, }, panel: { paddingHorizontal: 20, paddingTop: 8, }, title: { color: '#ECEDEE', fontSize: 18, fontWeight: '800', marginBottom: 8, }, subtitle: { color: 'rgba(255,255,255,0.75)', fontSize: 14, lineHeight: 20, }, actions: { flexDirection: 'row', gap: 10, marginTop: 14, }, primaryBtn: { flexDirection: 'row', alignItems: 'center', justifyContent: 'center', gap: 6, height: 44, paddingHorizontal: 16, borderRadius: 12, }, primaryBtnText: { color: '#192126', fontSize: 14, fontWeight: '800', }, secondaryBtn: { flex: 1, height: 44, borderRadius: 12, alignItems: 'center', justifyContent: 'center', borderWidth: 1, borderColor: 'rgba(255,255,255,0.18)', }, secondaryBtnText: { color: 'rgba(255,255,255,0.85)', fontSize: 14, fontWeight: '700', }, });