r/javascript • • Mar 13 '22

Javascript mouse hover 3d card effect :D

https://codepen.io/rudtjd2548/details/GRyRwoj

[removed] — view removed post

114 Upvotes

22 comments sorted by

•

u/Ustice Mar 14 '22

Thanks for your contribution! In order to keep things organized here, we try to keep personal projects off of the main thread. Instead, we have two weekly threads that we steer these sorts of posts to. Show-off Saturday is where we invite you to wow the community with your awesome ideas. If instead you are looking for feedback, our WTF?! Wednesday post is the best place to get a code-review. Remember that here at /r/JavaScript, we’re all about the code. Tell us about your challenges and how you overcame them. Show us that particularly clever bit. Talk about your process and tools. Just because it’s made with JS, doesn’t mean that it is relevant to the community. Tell us what is special about your project, and what we might learn from it!

→ More replies (1)

7

u/Todoce Mar 13 '22

Neat!
Any plans on handling touch events? :)

3

u/yummy-codding Mar 13 '22

of course I do! currently I'm working on posting youtube series, so as soon as I make it, and then I'll post some cool works about touch events! thanks for you interests!

2

u/Todoce Mar 13 '22

Nice, don't forget to wrap the cards with a container with a fixed height, otherwise you will push content that comes after the card while resizing it during the mouse hover event.

You might even get a scrollbar that pops up when hovering the card (I got this when I checked the codepen on my smaller second monitor)

1

u/yummy-codding Mar 13 '22

oh thank you for your feedback! btw I really didn't fully understand what you meant.

I wrapped 'card'div with 'frame' div having 300px 450px fixed size, sorry I dont understand..!😓

1

u/yummy-codding Mar 13 '22

I commented on the other your question :) thank you

3

u/teerzo Mar 13 '22

That's really cool! Given me some ideas for something I'm working on

1

u/yummy-codding Mar 13 '22

Really appreciate it and happy to see its useful to you 😁😁😁

3

u/jefekjr Mar 13 '22

Wowzers. Great work.

1

u/yummy-codding Mar 13 '22

thanks! glad you like it :)

3

u/MurphsJr Mar 13 '22

Awesome work

1

u/yummy-codding Mar 13 '22

thank you :D

2

u/sigmazaddy Mar 13 '22

Idk why but when you hover down it looks like the bottom is coming up

3

u/yummy-codding Mar 13 '22

https://codepen.io/evan-jin/pen/VwywNOB

I made it for you to understand :) it is because we are rotating 2d card so if we just rotate to top or bottom, then it looks the same

transform: rotate3d(2, 0, 0, 20deg);

transform: rotate3d(-2, 0, 0, 20deg);

these two options will look the same

thank you!

ref: https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate3d()

2

u/_default_username Mar 14 '22

Damn, this always happens when I'm lurking /r/JavaScript on my phone. Someone posts a cool demo that isn't phone friendly.

1

u/yummy-codding Mar 14 '22

Sorry 😅 To make a simple sample, I didnt make touch event handler..!

2

u/Abhi_mech007 Mar 14 '22

Impressive...!!

1

u/yummy-codding Mar 14 '22

Thank you so muchhhh🙏🏻

1

u/Ustice Mar 14 '22

Reaching out to other software engineers is important when you need it; however, unfortunately this isn’t the place for that. /r/JavaScript is not a support forum. You might want to check out /r/LearnJavaScript for the newer members of our community. Also, Stack Overflow is a great resource for getting support. For more information, check out our AskJS wiki page. Good luck! We hope that you find the answers that you are looking for.