How do I animate something whereby upon hover, the card is flipped to display something else ?
For example, the front of the card says “Flip me to show the answer” and then upon clicking, the card is flipped (animated preferably) and the answer is revealed.
I am trying to use “rotate” 360 degs but it flips too quickly, any other alternative? thanks!
You’d probably need to do transforms with CSS, but also employ some JS to change the content once the card is flipped. To slow down your transitions, in case you’re using CSS transitions, you should be able to set transition: 10s for example, thus making your animation’s duration be 10 seconds (very slow).
What do I put under “Transform”? I tried to put rotate 360 degrees on Y axis but it doesn’t look like it flipped the card, it only looks like it flipped the card and then immediately flip the card back instead of staying on the flip side of the card.
If I put 180 degrees rotate on Y axis, the text is flipped too and can’t read it…
You might want to ask @flo or @Mael about the Animations beta feature to make this happen it’s basically a no-code interface for Animations. I think it would be a nice test for their feature also. As making this with CSS might take some time. I’d need to test this and tweak it
This is awesome - perfect timing for me! You are amazing, learned a lot from the video - thank you!
I think the part I am stuck at is has to do with the “ShowCard” execution. Like @raelyn said, when flip it on Y axis at 180 degrees, everything turns around and can’t read text. Are you doing something special on the Verso div of the card component to combat this?
Also, is there something you are doing to animate the card spinning? I am trying to investigate what is happening by extending the transform to be >0.3s, but unable to figure it out.
Oh I may have forgotten to talk about the custom styling added to the cards (that’s the style element in my layout panel)
Recto and verso divs have a custom class .card and I’ve added the following properties to hide the element when it’s backward.