Hello guys, my last post got top voted of all time in this subreddit, so I took the time to refactor the project using hooks and functional components.
Looks cool, my only concern is that you're typing in one area while it's animating somewhere else in your peripherals. That creates competition for your attention which could lead to typing errors on the card number. It might be better to have the card update on blur instead of change, which would also be the more typical interaction because of auto-fill.
How do you do that css trick where you have a box floating over the top of another element? Like how you have the image of the card floating above the form?
I never understood how to explain it so it’s hard for me to google
Parent is static, card is relative and has top - n
Parent is static, card is static and has margin top - n
In the case above it‘s probably the second variant (I didn‘t check the code yet). When positioning the card relative with top - n, the content above wouldn‘t move up because technically the card still has the same position. With a negative margin top, the card actually moves.
A div can be positioned anywhere using absolute, relative, or fixed positioning. With z-index, the div can be set in front of or behind other elements. Give it a shot in jsfiddle or whatever. Not sure what you are stuck on if it wasn't z-index. Here's a fiddle: https://jsfiddle.net/3sze0kn4/
Edit: typos
Position the form some pixels down from the top, position the card to overlap both the form and the space/margin-top of the form, use z-index to make sure the card div is on top of both. Bonus: use dropshadow as sparingly as JJ Abrahms uses lens flares.
No offense, or I am missing what you are misunderstanding, but positioning the card "both on the form and on the background" is the z-index of the card set to something higher than than default elements below it. In this case the card is set to z-index 2, per the repo. The rest are margins and positioning (top, left, etc.)
My point is if the rest of your system is PCI compliant, using this React component for input and then handling that input in a PCI compliant manner will probably not make your system no longer PCI compliant.
I really like it but I would prefer to type the month and the year than to use the moose to pick it. I know the select element allows for typing as well, but I feel an input would be better
It looks nice, but something this flashy breaks user expectations IMO, they're gonna think twice about whether it's legit or not. Entering your credit card details is "supposed" to be a somewhat "solemn" and "utilitarian" experience, reflecting the gravity of what it is you're doing.
One tiny comment: the cardholder name animation (dashing from right to left) should have been consistent with the rest of the animation (spinning vertically). Other than that, it looks great!
Yes, why bother with this when it doesn’t add any usability or accessibility in the UI.. I mean it’s pretty cool, but it does not work in my honest opinion
195
u/albaneso May 12 '20 edited May 12 '20
Hello guys, my last post got top voted of all time in this subreddit, so I took the time to refactor the project using hooks and functional components.
Check it out on: https://github.com/jasminmif/react-interactive-paycard
647
u/[deleted] May 12 '20
Need a NSFW tag on this post because those transitions are sexy af
36
u/[deleted] May 12 '20
Looks cool, my only concern is that you're typing in one area while it's animating somewhere else in your peripherals. That creates competition for your attention which could lead to typing errors on the card number. It might be better to have the card update on blur instead of change, which would also be the more typical interaction because of auto-fill.
7
u/[deleted] May 12 '20
How do you do that css trick where you have a box floating over the top of another element? Like how you have the image of the card floating above the form?
I never understood how to explain it so it’s hard for me to google
75
u/trollbot69 May 12 '20
Is it PCI compliant tho
28
u/modemmute May 12 '20
That looks really slick!
23
u/swyx May 12 '20
previously the top voted post of all time here: https://www.reddit.com/r/reactjs/comments/du50op/reactinteractivepaycard/
3
u/jeevan90 May 12 '20
That's amazing. :)
3
u/fantasma91 May 12 '20
It’s 12:30am. Got a demo at 8 and now all I wanna do is go through this code....
2
u/[deleted] May 12 '20
Love it - thanks for sharing
2
u/nardogallardo May 12 '20
Wow, amazing, great work ... I am a beginner on react and I am looking forward to learn from your code, thanks for sharing.
2
u/andrerpena May 12 '20
I really like it but I would prefer to type the month and the year than to use the moose to pick it. I know the select element allows for typing as well, but I feel an input would be better
2
u/Suepahfly May 12 '20
Looks great, and very smooth!
Small tip, CRA supports css modules with sass our of the box. So you don’t have to rely on naming conventions.
1
u/[deleted] May 12 '20
I feel like I saw this before on here, but still I like it.
1
u/bandstand25 May 12 '20
Thats delicious.
1
u/[deleted] May 12 '20
Are you using pure CSS for the transitions?
1
u/CassWay75 May 12 '20
Absolutely Beautiful.
1
u/Osyris- May 12 '20
hot damn, looking great. Thanks for sharing
1
u/[deleted] May 12 '20
Amazing this!
1
u/harelams1 May 12 '20
Amazing. Thanks for letting us learn from your code
1
u/RagedBarbs May 12 '20
Never been turned on by JavaScript but I have
1
u/Acid_kenobi May 12 '20
Wow.. fantastic work 👍
1
u/N6MCA51593 May 12 '20
That's really cool, great job.
1
u/hasparus May 12 '20
daaamn
1
u/ProgramToday12 May 12 '20
woooow this is awesome what did you use...
1
u/Niweera May 12 '20
damn this is awesome
1
u/harvs_97 May 12 '20
Are you using a design system for this? Any component libraries. I really like your ui
1
u/fabiospampinato May 12 '20
Looks amazing, congrats!
What's the rational behind obscuring some numbers given that they are visible in the form anyway?
1
u/drivecrux May 12 '20
I replayed it 10 times till I came.
1
u/4lexDeLarge May 12 '20
Those transition are so cool. Nice job!
1
u/Keybraker May 12 '20
that's sexy af
1
u/[deleted] May 12 '20
Muhammed Derdem always kills it with his designs.
1
u/quarterpoundcheese May 12 '20
Ad Soyad? Turkish or azeri?
1
u/RealSlimMahdi May 12 '20
looks sharp man
1
u/ASshiro May 12 '20
Nive trick
1
u/friskfrugt May 12 '20
bloat
1
u/carcinogen75 May 12 '20
sexy
1
u/[deleted] May 12 '20
Wow, looks awesome
1
u/bmorrell23 May 12 '20
Keep building our enslavement camps 🥰🥰
1
u/codingideas May 12 '20
This is amazing! Thanks for sharing.
1
u/srhtkaya May 12 '20
Seeing Turkish words on a reddit post made me much more impressed than those fancy animations!
1
u/Sharpshooter2128 May 12 '20
Someone also posted something same like this months ago idk where :3
1
u/occsceo May 12 '20
really, really cool transitions/ux. great work!
1
u/Raju_rapper May 12 '20
That was lit
1
u/skbhardwaj May 12 '20
earlier i saw vue version of the same .. https://codepen.io/JavaScriptJunkie/pen/YzzNGeR
1
u/d4vsanchez May 12 '20
Woah, looks wonderful! Great work!
1
u/hamburger_bun May 13 '20
thats hot
1
u/laramiecorp May 13 '20
Let's see Paul Allen's card
1
u/NoInkling May 13 '20 edited May 13 '20
It looks nice, but something this flashy breaks user expectations IMO, they're gonna think twice about whether it's legit or not. Entering your credit card details is "supposed" to be a somewhat "solemn" and "utilitarian" experience, reflecting the gravity of what it is you're doing.
1
u/FightOnForUsc May 13 '20
This is porn 😍
1
u/sicario_stadia May 13 '20
Wow - this is legit stunning and is why I love front end development. The creativity and ideas that people come up with blow my mind.
1
u/Digicrests May 13 '20
Looks simple and beautiful, nice work
1
u/tbone6778 May 13 '20
Brilliant
1
u/TravezRipley May 14 '20
Beautiful
1
u/[deleted] May 15 '20
Thanks everyone I was able to implement the floating div thingy
1
u/inflame07 Jun 06 '20
this.handleChange(){ this.setState({event.target.name: event.target.value}) };🔥 Looking good!
1
u/KittenOfMine Jul 27 '20
Literally “Shut up and take my money”! All jokes aside look great nice job
1
u/Satanic_Jesus_Here Aug 31 '20
Why did you post this about 120 days after the original?
1
u/Majesty1337 Feb 22 '22
kinda looks like the one privacy.com uses.
very cool
1
u/Away_Chemistry_5506 Jul 16 '22
Awesome man
1
u/ahiyaLala Jan 23 '24
One tiny comment: the cardholder name animation (dashing from right to left) should have been consistent with the rest of the animation (spinning vertically). Other than that, it looks great!
1
u/MiAnClGr Feb 01 '24
Pretty nice, maybe try react hook.
-1
u/[deleted] May 12 '20
Boy , do I have an erection or what !!
-2
u/Dev_Paradice May 12 '20
Why the repost OP?
https://www.reddit.com/r/reactjs/comments/du50op/reactinteractivepaycard/?utm_source=share&utm_medium=ios_app&utm_name=iossmf
0
u/[deleted] May 12 '20
[deleted] — view deleted comment
0
u/[deleted] May 12 '20
[deleted] — view deleted comment