Jump to content
Search Community

flip an object

Josefina test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I'm trying to create this effect.

A hand/paw pushes an object and the object either flips or wiggles a bit and drops something.

The wiggle effect so far looks a bit too strong.

When I try something like:

 
.to("#basket", 1, {rotation:-10, transformOrigin:"right 30%"})
.to("#basket", 1, {rotation:0, transformOrigin:"0"});
The object does not go back to its original spot. 
Any suggestions?
Link to comment
Share on other sites

Hi @Josefina :)

 

Welcome to the forum and thank you for joining Club GreenSock.

 

I'm not 100% sure I understand your question. I would think that transformOrigin change on the second tween would create a bit of a harsh jump. If these are SVG elements you could take a look at smoothOrigin. More info:

https://greensock.com/svg-tips

 

If you could put that into a demo, we could get you better answers. Here's some more info about that:

Happy tweening and welcome aboard.

:)

 

  • Like 2
Link to comment
Share on other sites

Okay, I just re-read your question and I think I understand what you'd like to happen. Since you're a Club member, you have access to CustomBounce and CustomWiggle: https://greensock.com/wiggle-bounce

 

Using that, you could easily wiggle an element and have another element drop from it. Here's a quick demo with a couple basic divs.

 

See the Pen aYrQgV by PointC (@PointC) on CodePen

Hopefully that points you in the right direction. Happy tweening.

:)

 

  • Like 6
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...