r/reactnative • u/alexandr1us • Mar 19 '19
The login animation I implemented using React Native
10
u/CuriousPenguin13 Mar 19 '19
Finally some implemented code to look at for these animations. I always see crazy animations on dribbble designs and wonder how they would be done, never see code examples (granted I haven't looked too hard). Nice job!
32
u/alexandr1us Mar 19 '19
I could do these quite frequently if you guys are interested. I love doing animations and sharing them
4
u/CuriousPenguin13 Mar 19 '19
The more the better! Plenty of designs already made to choose from too
3
u/Jcole47 Mar 19 '19
Very interested! Animating in react native is not something I've wrapped my head around yet.
1
Apr 08 '19
This is really cool! I’m just getting started with learning JavaScript but plan on picking up React Native once I have a decent foundation. Thanks for sharing this!
3
2
u/anklot Mar 19 '19
You used react elements too right?
2
u/alexandr1us Mar 19 '19
No just react-native-material-textfield and slightly modified react-native-material-ripple
2
u/hzburki Mar 20 '19
Looks cool. But does it handle physical keyboard? I imagine the input fields get hidden underneath the keyboard when the user will type. Anyway great animation, I'll take a look at the code. Might even use it in my app :p thanks
2
12
5
Mar 19 '19
Can you post the GitHub please?
7
Mar 19 '19
OP posted the code here (from this comment). It's not Github, but that shouldn't matter.
1
1
Mar 20 '19
This looks really nice! I’d only maybe tone down the final transition, it felt like I was getting punched in the face :D Thanks for sharing the code.
1
1
1
u/theWindInYourButt Mar 20 '19
Great stuff! Is this all with out of the box RN, or did you use any additional libraries like reanimated?
1
1
u/Afrood Mar 22 '19
Hey u/alexandr1us this is awesome work!
I've implemented this in an app im fiddling with and it works like a charm!
Quick question, say I wanna use the Input fields (TextFields) only and not the button + button Animation, what can I remove from the code?
I am not very good at animating etc. so I am having a hard time working my head around it.
Cheers
1
u/alexandr1us Mar 22 '19
So you just want to have textfields fade away?
You only need these lines then:
Animated.timing(this.state.inputAnimation, {toValue: 0,duration: 300,delay: 100})
const translateY = this.state.inputAnimation.interpolate({inputRange: [0, 1],outputRange: [0, 60]})1
u/Afrood Mar 22 '19
Perfect! Thanks a lot man. If you have any other animations that you want to share please do! amazing work.
1
3
u/alexlee-dev Mar 19 '19
I’m porting my PWA to React native as my first React native project. Was currently stuck on animations (coincidentally on my login flow). This looks nice!
1
1
u/soumikcv Mar 19 '19
This looks really clean. I'm struggling with understanding how to approach animations in the react ecosystem. Will go through your implementation. Thanks for sharing.
1
1
1
1
1
1
u/King_Joffreys_Tits Apr 16 '19
This is such a sleek login animation!
How did you animate the textfield placeholder text to above the textfield on focus?
0
Mar 19 '19
[deleted]
2
u/alexandr1us Mar 19 '19
Since current implementation is scaling the bubble it needs to flash to other view. It could be done with size animation but animating size is pretty heavy operation
0
Mar 19 '19
[deleted]
4
u/alexandr1us Mar 19 '19
You can imitate reverse bubble animation for the next screen. That's great idea. Will implement it tomorrow
21
u/alexandr1us Mar 19 '19 edited Mar 22 '19
This example should be useful for beginners to animate RN components
Snack: https://snack.expo.io/@alexandrius/adequate-pretzel
Originally posted at: https://www.reddit.com/r/xamarindevelopers/comments/b059qt/how_can_i_shrink_the_button_and_turn_it_into_a/