mirror of
https://github.com/zimplexing/OrionTV.git
synced 2026-03-05 18:27:30 +08:00
Update
This commit is contained in:
40
components/HelloWave.tsx
Normal file
40
components/HelloWave.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import {StyleSheet} from 'react-native';
|
||||
import Animated, {
|
||||
useSharedValue,
|
||||
useAnimatedStyle,
|
||||
withTiming,
|
||||
withRepeat,
|
||||
withSequence,
|
||||
} from 'react-native-reanimated';
|
||||
|
||||
import {ThemedText} from '@/components/ThemedText';
|
||||
|
||||
export function HelloWave() {
|
||||
const rotationAnimation = useSharedValue(0);
|
||||
|
||||
rotationAnimation.value = withRepeat(
|
||||
withSequence(
|
||||
withTiming(25, {duration: 150}),
|
||||
withTiming(0, {duration: 150}),
|
||||
),
|
||||
4, // Run the animation 4 times
|
||||
);
|
||||
|
||||
const animatedStyle = useAnimatedStyle(() => ({
|
||||
transform: [{rotate: `${rotationAnimation.value}deg`}],
|
||||
}));
|
||||
|
||||
return (
|
||||
<Animated.View style={animatedStyle}>
|
||||
<ThemedText style={styles.text}>👋</ThemedText>
|
||||
</Animated.View>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
text: {
|
||||
fontSize: 28,
|
||||
lineHeight: 32,
|
||||
marginTop: -6,
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user