refactor: 注释掉浮动卡片动画逻辑,调整样式以增强视觉效果
This commit is contained in:
@@ -42,27 +42,27 @@ const FloatingCard = ({ children, delay = 0, style }: {
|
|||||||
}) => {
|
}) => {
|
||||||
const floatAnim = useRef(new Animated.Value(0)).current;
|
const floatAnim = useRef(new Animated.Value(0)).current;
|
||||||
|
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
const startAnimation = () => {
|
// const startAnimation = () => {
|
||||||
Animated.loop(
|
// Animated.loop(
|
||||||
Animated.sequence([
|
// Animated.sequence([
|
||||||
Animated.timing(floatAnim, {
|
// Animated.timing(floatAnim, {
|
||||||
toValue: 1,
|
// toValue: 1,
|
||||||
duration: 3000,
|
// duration: 3000,
|
||||||
delay: delay,
|
// delay: delay,
|
||||||
useNativeDriver: true,
|
// useNativeDriver: true,
|
||||||
}),
|
// }),
|
||||||
Animated.timing(floatAnim, {
|
// Animated.timing(floatAnim, {
|
||||||
toValue: 0,
|
// toValue: 0,
|
||||||
duration: 3000,
|
// duration: 3000,
|
||||||
useNativeDriver: true,
|
// useNativeDriver: true,
|
||||||
}),
|
// }),
|
||||||
])
|
// ])
|
||||||
).start();
|
// ).start();
|
||||||
};
|
// };
|
||||||
|
|
||||||
startAnimation();
|
// startAnimation();
|
||||||
}, [floatAnim, delay]);
|
// }, [floatAnim, delay]);
|
||||||
|
|
||||||
const translateY = floatAnim.interpolate({
|
const translateY = floatAnim.interpolate({
|
||||||
inputRange: [0, 1],
|
inputRange: [0, 1],
|
||||||
@@ -730,6 +730,8 @@ const styles = StyleSheet.create({
|
|||||||
shadowOpacity: 0.12,
|
shadowOpacity: 0.12,
|
||||||
shadowRadius: 12,
|
shadowRadius: 12,
|
||||||
elevation: 6,
|
elevation: 6,
|
||||||
|
minHeight: 100,
|
||||||
|
justifyContent: 'center',
|
||||||
},
|
},
|
||||||
basalMetabolismCardOverride: {
|
basalMetabolismCardOverride: {
|
||||||
margin: -16, // 抵消 masonryCard 的 padding
|
margin: -16, // 抵消 masonryCard 的 padding
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ export function StressMeter({ value, updateTime, style, hrvValue }: StressMeterP
|
|||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
|
flex: 1,
|
||||||
shadowColor: '#000',
|
shadowColor: '#000',
|
||||||
shadowOffset: {
|
shadowOffset: {
|
||||||
width: 0,
|
width: 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user