|
@ -10,6 +10,17 @@ export default function YooBackground() { |
|
|
zIndex: -1, |
|
|
zIndex: -1, |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
|
|
|
// The animation won't play for the first 10 seconds
|
|
|
|
|
|
// if we just use setInterval. So we start the animation
|
|
|
|
|
|
// at the component mounted just for the first 10 seconds.
|
|
|
|
|
|
Animated.timing(imgPosition, { |
|
|
|
|
|
toValue: { |
|
|
|
|
|
x: -Math.floor(Math.random() * 5000), |
|
|
|
|
|
y: -Math.floor(Math.random() * 3000), |
|
|
|
|
|
}, |
|
|
|
|
|
duration: 10000, |
|
|
|
|
|
useNativeDriver: true, |
|
|
|
|
|
}).start(); |
|
|
setInterval(() => { |
|
|
setInterval(() => { |
|
|
Animated.timing(imgPosition, { |
|
|
Animated.timing(imgPosition, { |
|
|
toValue: { |
|
|
toValue: { |
|
|