react-native-svg-animations icon indicating copy to clipboard operation
react-native-svg-animations copied to clipboard

New Feature request

Open jawwad22 opened this issue 4 years ago • 5 comments

Is there way we can define the starting point of animation, like i want my animation to be sync with a time (minute), like if timer is on 30 second, then animation start from 50% of its path,animate as my timer moved and stop as my timer stop

is this possible?

jawwad22 avatar Jun 12 '20 12:06 jawwad22

Hi @jawwad22 , thank you for opening this. Based on my understanding of your request, I think a way to make this possible is for you to define multiple d s (path) and dynamically change the duration property of your AnimatedSVGPath. As for the sync with timer, the SVGs are animated indefinitely without control for pause/play scenario. I haven't explored that yet.

73R3WY avatar Jun 13 '20 03:06 73R3WY

Hi, Thanks for replying, Ok ill work on your idea, let me give a update about it

jawwad22 avatar Jun 15 '20 06:06 jawwad22

i am unable to implement your idea, can you help me change the code according to your idea

const currentSecond =DataStore.getState().general.currentSecMin.sec

const withCheckPath = M${Size.widthInP(50.1)} ${Size.heightInP(1.88)} H${Size.widthInP(88.1)} Q${Size.widthInP(94.3)} ${Size.heightInP(2.2)} ${Size.widthInP(94.8)} ${Size.heightInP(5.7)} V${Size.heightInP(17.4)} Q${Size.widthInP(93.7)} ${Size.heightInP(20.6)} ${Size.widthInP(88.2)} ${Size.heightInP(20.7)} H${Size.widthInP(12.8)} Q${Size.widthInP(7.2)} ${Size.heightInP(20.1)} ${Size.widthInP(6.5)} ${Size.heightInP(17.5)} V${Size.heightInP(5.7)} Q${Size.widthInP(6.9)} ${Size.heightInP(2.5)} ${Size.widthInP(13)} ${Size.heightInP(1.88)} H${Size.widthInP(50)};

 <AnimatedSVGPath
						strokeColor={isDarkBlue ? "#2A9DFF" : "#B3D6FF"}
						duration={60000}
						delay={1}
						strokeWidth={2}
						strokeDashArray={[867]}
						height={Size.heightInP(22)}
						width={Size.widthInP(100)}
						d={withCheckPath}
						loop={true}
					/> 

jawwad22 avatar Jun 15 '20 11:06 jawwad22

@jawwad22 I tried, but I still wasn't able to achieve your goal. I will implement another way.

73R3WY avatar Jun 22 '20 02:06 73R3WY

Hi, actually i accomplish the goal but unfortunately withe help of react native Animated way =)

jawwad22 avatar Jun 22 '20 03:06 jawwad22

#47

73R3WY avatar Jan 22 '24 14:01 73R3WY