Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Aizy

Add "shaking effect" to an image.

Recommended Posts

I want to create sort of an "impact effect" on my house image when the sold image finishes it's animation.
I don't know how to describe it properly but I would like both the images to shake a little if that makes sense.

I tried animating margin but it looked janky.

See the Pen Jjpzzqv by Aizazulhaq (@Aizazulhaq) on CodePen

Link to comment
Share on other sites

Hey there Aizy!

 

Just a gentle request not to tag people for help. All the forum questions will get answered - tagging people just adds pressure on people who are volunteering their time.

Maybe customWiggle will give you the effect you're after? It's a Club GreenSock perk but you can use it for free on codepen

https://greensock.com/docs/v3/Eases/CustomWiggle

 

  • Like 4
Link to comment
Share on other sites

@CassieI'm sorry it wasn't the intention behind tagging you in the post. I'm new around here and bringing in my bad habits from Reddit. I'll be more considerate from now on.

Thanks for the help, I used TweenMax and animated the rotation. which is close enough to what I want.

Link to comment
Share on other sites

Yep, if you're okay with a less refined "shake" (CustomWiggle is super smooth), you could use keyframes, like:

gsap.to("#id", {
  keyframes: {
    rotation: [10,-8,6,-5,3,-1,0]
  },
  duration: 1
});

Just an idea. 

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.
×